public class Zbnf2Xml
extends java.lang.Object
>java -cp path/to/zbnf.jar org.vishia.zbnf.Zbnf2Xml -iINPUTPATHFILE -sSYNTAX.zbnf -yXMLOUTPUT
Modifier and Type | Class and Description |
---|---|
protected static class |
Zbnf2Xml.Args |
protected static class |
Zbnf2Xml.CmdLine
The inner class CmdLine helps to evaluate the command line arguments
and show help messages on command line.
|
static interface |
Zbnf2Xml.PrepareXmlNode |
Modifier and Type | Field and Description |
---|---|
protected Zbnf2Xml.Args |
argsx
Arguments from main of this class.
|
protected MainCmdLogging_ifc |
logmaincmd
Help reference to name the report output.
|
protected ZbnfParser |
parser |
static java.lang.String |
sVersion
Version, history and license.
|
Constructor and Description |
---|
Zbnf2Xml(java.lang.String input,
java.lang.String syntax,
java.lang.String output,
MainCmdLogging_ifc report) |
Zbnf2Xml(Zbnf2Xml.Args args,
MainCmdLogging_ifc report)
Constructor of the main class.
|
Modifier and Type | Method and Description |
---|---|
boolean |
execute()
Deprecated.
|
static void |
main(java.lang.String[] sArgs)
main started from java
|
boolean |
parseAndWriteXml() |
static java.lang.String |
smain(java.lang.String[] sArgs)
Invocation from another java program without exit the JVM
|
private static java.lang.String |
smain(java.lang.String[] sArgs,
boolean shouldExitVM) |
static void |
writeZbnf2Xml(ZbnfParser parser,
java.lang.String sFileXmlOut,
java.nio.charset.Charset encoding)
Write a XML file with the parse result from the given parser.
|
public static final java.lang.String sVersion
writeZbnf2Xml(ZbnfParser, String, Charset)
is new but only refactored.
content was given, own operation resolved.
smain(String[], boolean)
as alternative to main(String[])
to call from other Java parts. The main(String[])
calls System.exit(int)
which terminates the JVM. Is it a good idea? Maybe main should only return, but how to deliver a errorlevel
to a running shell script/batch without System.exit(errlevel). Maybe two methods are necessary.
ZbnfParser.getResultTree()
.
Zbnf2Text
.
protected final MainCmdLogging_ifc logmaincmd
protected final Zbnf2Xml.Args argsx
protected ZbnfParser parser
public Zbnf2Xml(Zbnf2Xml.Args args, MainCmdLogging_ifc report)
public Zbnf2Xml(java.lang.String input, java.lang.String syntax, java.lang.String output, MainCmdLogging_ifc report)
public static void main(java.lang.String[] sArgs)
public static java.lang.String smain(java.lang.String[] sArgs)
sArgs
- same like main(String[])
private static java.lang.String smain(java.lang.String[] sArgs, boolean shouldExitVM)
@Deprecated public final boolean execute()
parseAndWriteXml()
public boolean parseAndWriteXml()
public static void writeZbnf2Xml(ZbnfParser parser, java.lang.String sFileXmlOut, java.nio.charset.Charset encoding) throws java.io.IOException
parser
- has successfully parsed.sFileXmlOut
- pathfile, destination directories will be created.encoding
- maybe null, then UTF-8java.io.IOException
- especially FileNotFoundException on any error