Package eu.bandm.tools.umod
Class Options
Generated source for command line processing.
The parallel GUI class is
The normal way of operation is:
The parallel GUI class is
GuiOptions
. The normal way of operation is:
- Create a fresh instance by the only constructor
Options()
. - Analyse command line by invoking
Model.parse(String[],MessageReceiver,String)
- Inquire whether a particular
option X has been set on the commandline
by invoking
has_[X]()
. - The arguments of each option are
determined by a sequence of types: first a leading sequence,
values for which appear exactly once, followed by a sequence
which may be repeated. Both type sequences may be empty.
Inquire value of the options n-th argument in the fixed, leading argument sequence byget_[X]_[n]()
. - Inquire value of the
options n-th argument in the k-th repetition group by
get_[X]_[n](k)
.
If anything went wrong in parsing, errors
have been sent to the MessageReceiver
.
Then further analysis methods can be applied (Model.getParsingProtocol()
, Model.getMissingOptions()
, Model.usage()
, etc.)
For further details. please see the
documentation of the methods inherited from the superclass Model
and the option
compiler's user documentation.
Here is the source text.
There have been description texts only in one language, namely en.
The usage()
method will show this screen:
====== USAGE: ====== -------------------------------- Model substantial information -------------------------------- -0 / --sourceroot uri(="") file system directory which is the root of the source code hierarchie -1 / --packagename string(="") name of the package of the generated model class -2 / --sourcefiles ( uri(="") )+ source files containing the model declaration -m / --monolithic boolean(=true) generate a single class instead of a package -p / --targetclasspath ( uri(="") )* classpath to search for existing class files, if different from current classpath. NOT YET ACTIVE!! ------------------------------- Code generation modification ------------------------------- --floatNotDouble boolean(=false) implement the umod type "float" not by doubles but by floats. -G / --getterfunctions boolean(=false) whether to generate getter function objects DEPRECATED -S / --setterfunctions boolean(=false) whether to generate setter function objects DEPRECATED -x / --xmlgen boolean(=true) whether to generate SAX de-/serialization -s / --swingtree boolean(=false) whether to generate a swing tree visualization --patterns (bool)?(=true iff present) Generate methods for lifting and applying "Paisley" patterns to model elements and their fields --constructorsPre20181214 (bool)?(=true iff present) Use old constructor code generation scheme, prior to 20181214 redefinition. -V / --visitordebug boolean(=false) whether to add logging code to the generated visitors -v / --visitoroptimize boolean(=false) whether to cut superfluous descends --visitorcompile boolean(=false) whether to cut superfluous descends by code generation --rewriterwarnings (bool)?(=true iff present) whether all warnings from rewriter code shall be printed, even when the code generation algorithm takes the responsibility. -w / --linewidth int(=80) line width for the formatting of the generated source code
Created on 2024-09-15_20h22m13
by program bandm/metatools/option/compiler, version 2.1
command line =
java bandm/metatools/option/compiler umodOptions.xml eu.bandm.tools.umod Options GuiOptions $(HOME)/metatools/src
by program bandm/metatools/option/compiler, version 2.1
command line =
java bandm/metatools/option/compiler umodOptions.xml eu.bandm.tools.umod Options GuiOptions $(HOME)/metatools/src
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Programmatically generated catalog of translations.class
One instance realizes one repeated argument group of optionsourcefiles
.class
One instance realizes one repeated argument group of optiontargetclasspath
.Nested classes/interfaces inherited from class eu.bandm.tools.option.runtime.Model
Model.ExcDuplicate, Model.ExcEndOfRepet, Model.ExcNoData, Model.ExcNoData_allowed, Model.ExcSkipReachesEnd, Model.ExcUnknownOpt, Model.ExcWrongType, Model.Pre20220613, Model.SeemsToWorkForLinuxAndSomeWindowsVersions20220613
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected List<Options.Values_sourcefiles>
protected List<Options.Values_targetclasspath>
protected boolean
protected boolean
protected boolean
protected int
protected boolean
protected String
protected boolean
protected boolean
protected boolean
protected String
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
Fields inherited from class eu.bandm.tools.option.runtime.Model
curArg, curArgGroup, curOption, currentErrorPos, descriptions, dummyRat, GNU_VERSION_OPTION, hasNonMetaOptions, inputlength, inputstring, matcher, messages, msg, nextToken, optionDirector, p_rest, positionalPhase, positionalsExplicit, positionalsFound, protocol, shellAdapter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Callback, overridden by compiled code.Is overridden in the generated code and concatenates the "longest names" of all otions marked as required, but not present in the parsed input.Callback, overridden by compiled code.protected void
The generated code will evaluate all conditions to activate/deactive options in the GUI.boolean
Getter method for the 0th argument of optionconstructorsPre20181214
.boolean
Getter method for the only argument of optionfloatNotDouble
.boolean
Getter method for the only argument of optiongetterfunctions
.int
Getter method for the only argument of optionlinewidth
.boolean
Getter method for the only argument of optionmonolithic
.Getter method for the only argument of optionpackagename
.boolean
Getter method for the only argument of optionpatterns
.boolean
Getter method for the only argument of optionrewriterwarnings
.boolean
Getter method for the only argument of optionsetterfunctions
.Getter method for all repetition groups of optionsourcefiles
.get_sourcefiles_0
(int index) Getter method for the only repeated argument of optionsourcefiles
.Getter method for the only argument of optionsourceroot
.boolean
Getter method for the only argument of optionswingtree
.Getter method for all repetition groups of optiontargetclasspath
.get_targetclasspath_0
(int index) Getter method for the only repeated argument of optiontargetclasspath
.boolean
Getter method for the only argument of optionvisitorcompile
.boolean
Getter method for the only argument of optionvisitordebug
.boolean
Getter method for the only argument of optionvisitoroptimize
.boolean
Getter method for the only argument of optionxmlgen
.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.Overriden by the generated code to make a constructor call of the actual Model (sub-)class.protected int
The generated code will return the number of positional parameters.protected void
parseAbbrev
(String select) Callback, overridden by compiled code, which realizes a switch over all one character option names.protected void
Callback, overridden by compiled code, which realizes a switch over all long option names.protected void
Callback, overridden by compiled code, which calls one after the other the positional parameters.Called to generate a String representation of the model's state.void
usage
(PrintStream pr) Print usage information in the default language.void
usage
(PrintStream pr, String lang) Print usage information in the requested language.void
usage_en()
Print usage information in the language 'en' on System.err.void
usage_en
(PrintStream pr) Print usage information in the language 'en'.Methods inherited from class eu.bandm.tools.option.runtime.Model
ARG_ERROR, ARG_ERROR, canReenterRepetitionGroup, convert_integer_10_or_16, descriptionKeyForCommentField, descriptionKeyForEnum, descriptionKeyForEnum, descriptionKeyForEnumItem, ERROR, ERROR_plus, ERROR_UNKNOWN_ABBREV, ERROR_UNKNOWN_NAME, getInputString, getMissingOptions, getNextToken, getNextToken_required, getParsingProtocol, HINT, INSITU, parse, parseBool, parseBool_optional, parseBoolTest, parseEnum, parseEnumSet, parseFloat, parseInit, parseInt, parseInt_16or10, parseOneString, parseOneString, parseOneString, parseOneUri, parseRational, parseString, putprot, putprot_option, serialize, serialize, serialize, serialize, serialize, serialize, serialize, serialize, serialize_hex, skipToOption, type_error, TYPE_MISMATCH, TYPE_MISMATCH, usage, usage, WARNING
-
Field Details
-
has_sourceroot
protected boolean has_sourceroot -
value_sourceroot_0
-
has_packagename
protected boolean has_packagename -
value_packagename_0
-
has_sourcefiles
protected boolean has_sourcefiles -
repvalues_sourcefiles
-
serialize_sourcefiles
-
has_monolithic
protected boolean has_monolithic -
value_monolithic_0
protected boolean value_monolithic_0 -
has_targetclasspath
protected boolean has_targetclasspath -
repvalues_targetclasspath
-
serialize_targetclasspath
-
has_floatNotDouble
protected boolean has_floatNotDouble -
value_floatNotDouble_0
protected boolean value_floatNotDouble_0 -
has_getterfunctions
protected boolean has_getterfunctions -
value_getterfunctions_0
protected boolean value_getterfunctions_0 -
has_setterfunctions
protected boolean has_setterfunctions -
value_setterfunctions_0
protected boolean value_setterfunctions_0 -
has_xmlgen
protected boolean has_xmlgen -
value_xmlgen_0
protected boolean value_xmlgen_0 -
has_swingtree
protected boolean has_swingtree -
value_swingtree_0
protected boolean value_swingtree_0 -
has_patterns
protected boolean has_patterns -
value_patterns_0
protected boolean value_patterns_0 -
has_constructorsPre20181214
protected boolean has_constructorsPre20181214 -
value_constructorsPre20181214_0
protected boolean value_constructorsPre20181214_0 -
has_visitordebug
protected boolean has_visitordebug -
value_visitordebug_0
protected boolean value_visitordebug_0 -
has_visitoroptimize
protected boolean has_visitoroptimize -
value_visitoroptimize_0
protected boolean value_visitoroptimize_0 -
has_visitorcompile
protected boolean has_visitorcompile -
value_visitorcompile_0
protected boolean value_visitorcompile_0 -
has_rewriterwarnings
protected boolean has_rewriterwarnings -
value_rewriterwarnings_0
protected boolean value_rewriterwarnings_0 -
has_linewidth
protected boolean has_linewidth -
value_linewidth_0
protected int value_linewidth_0
-
-
Constructor Details
-
Options
public Options()
-
-
Method Details
-
makeDefaultInstance
Description copied from class:Model
Overriden by the generated code to make a constructor call of the actual Model (sub-)class.- Specified by:
makeDefaultInstance
in classModel<Options>
-
checkActive
protected void checkActive()Description copied from class:Model
The generated code will evaluate all conditions to activate/deactive options in the GUI.- Specified by:
checkActive
in classModel<Options>
-
has_sourceroot
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_sourceroot_0()
.
-
get_sourceroot_0
Getter method for the only argument of optionsourceroot
.This option indicates: file system directory which is the root of the source code hierarchie.
The format of this option on the command line is-0 / --sourceroot uri(="")
-
has_packagename
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_packagename_0()
.
-
get_packagename_0
Getter method for the only argument of optionpackagename
.This option indicates: name of the package of the generated model class.
The format of this option on the command line is-1 / --packagename string(="")
-
has_sourcefiles
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_sourcefiles()
.
-
get_sourcefiles
Getter method for all repetition groups of optionsourcefiles
.This option indicates: source files containing the model declaration.
The format of this option on the command line is-2 / --sourcefiles ( uri(="") )+
-
get_sourcefiles_0
Getter method for the only repeated argument of optionsourcefiles
. For details of this option see the methodget_sourcefiles()
.- Parameters:
index
- the index of the repetition group, zero based.
-
has_monolithic
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_monolithic_0()
.
-
get_monolithic_0
public boolean get_monolithic_0()Getter method for the only argument of optionmonolithic
.This option indicates: generate a single class instead of a package.
The format of this option on the command line is-m / --monolithic boolean(=true)
-
has_targetclasspath
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_targetclasspath()
.
-
get_targetclasspath
Getter method for all repetition groups of optiontargetclasspath
.This option indicates: classpath to search for existing class files, if different from current classpath. NOT YET ACTIVE!!.
The format of this option on the command line is-p / --targetclasspath ( uri(="") )*
-
get_targetclasspath_0
Getter method for the only repeated argument of optiontargetclasspath
. For details of this option see the methodget_targetclasspath()
.- Parameters:
index
- the index of the repetition group, zero based.
-
has_floatNotDouble
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_floatNotDouble_0()
.
-
get_floatNotDouble_0
public boolean get_floatNotDouble_0()Getter method for the only argument of optionfloatNotDouble
.This option indicates: implement the umod type "float" not by doubles but by floats.
The format of this option on the command line is--floatNotDouble boolean(=false)
-
has_getterfunctions
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_getterfunctions_0()
.
-
get_getterfunctions_0
public boolean get_getterfunctions_0()Getter method for the only argument of optiongetterfunctions
.This option indicates: whether to generate getter function objects DEPRECATED.
The format of this option on the command line is-G / --getterfunctions boolean(=false)
-
has_setterfunctions
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_setterfunctions_0()
.
-
get_setterfunctions_0
public boolean get_setterfunctions_0()Getter method for the only argument of optionsetterfunctions
.This option indicates: whether to generate setter function objects DEPRECATED.
The format of this option on the command line is-S / --setterfunctions boolean(=false)
-
has_xmlgen
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_xmlgen_0()
.
-
get_xmlgen_0
public boolean get_xmlgen_0()Getter method for the only argument of optionxmlgen
.This option indicates: whether to generate SAX de-/serialization.
The format of this option on the command line is-x / --xmlgen boolean(=true)
-
has_swingtree
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_swingtree_0()
.
-
get_swingtree_0
public boolean get_swingtree_0()Getter method for the only argument of optionswingtree
.This option indicates: whether to generate a swing tree visualization.
The format of this option on the command line is-s / --swingtree boolean(=false)
-
has_patterns
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_patterns_0()
.
-
get_patterns_0
public boolean get_patterns_0()Getter method for the only argument of optionpatterns
.This option indicates: Generate methods for lifting and applying "Paisley" patterns to model elements and their fields.
The format of this option on the command line is--patterns (bool)?(=true iff present)
-
has_constructorsPre20181214
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_constructorsPre20181214_0()
.
-
get_constructorsPre20181214_0
public boolean get_constructorsPre20181214_0()Getter method for the 0th argument of optionconstructorsPre20181214
.This option indicates: Use old constructor code generation scheme, prior to 20181214 redefinition.
The format of this option on the command line is--constructorsPre20181214 (bool)?(=true iff present)
-
has_visitordebug
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_visitordebug_0()
.
-
get_visitordebug_0
public boolean get_visitordebug_0()Getter method for the only argument of optionvisitordebug
.This option indicates: whether to add logging code to the generated visitors.
The format of this option on the command line is-V / --visitordebug boolean(=false)
-
has_visitoroptimize
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_visitoroptimize_0()
.
-
get_visitoroptimize_0
public boolean get_visitoroptimize_0()Getter method for the only argument of optionvisitoroptimize
.This option indicates: whether to cut superfluous descends.
The format of this option on the command line is-v / --visitoroptimize boolean(=false)
-
has_visitorcompile
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_visitorcompile_0()
.
-
get_visitorcompile_0
public boolean get_visitorcompile_0()Getter method for the only argument of optionvisitorcompile
.This option indicates: whether to cut superfluous descends by code generation.
The format of this option on the command line is--visitorcompile boolean(=false)
-
has_rewriterwarnings
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_rewriterwarnings_0()
.
-
get_rewriterwarnings_0
public boolean get_rewriterwarnings_0()Getter method for the only argument of optionrewriterwarnings
.This option indicates: whether all warnings from rewriter code shall be printed, even when the code generation algorithm takes the responsibility.
The format of this option on the command line is--rewriterwarnings (bool)?(=true iff present)
-
has_linewidth
Deprecated.- Returns:
- whether the option has been set on the command line.
(The result is of no significance when using GUI input, and should neither be used in command line mode.)
For details of this option see the method
get_linewidth_0()
.
-
get_linewidth_0
public int get_linewidth_0()Getter method for the only argument of optionlinewidth
.This option indicates: line width for the formatting of the generated source code.
The format of this option on the command line is-w / --linewidth int(=80)
-
serialize
Description copied from class:Model
Called to generate a String representation of the model's state. Code is overridden by the compiled code. -
usage
Print usage information in the default language. -
usage
Print usage information in the requested language. Falls back to default language, if that language is not supported. -
usage_en
public void usage_en()Print usage information in the language 'en' on System.err. -
usage_en
Print usage information in the language 'en'. -
parseAbbrev
Description copied from class:Model
Callback, overridden by compiled code, which realizes a switch over all one character option names. The generated code calls the argument parsers and stores the resulting values to the model's fields.- Specified by:
parseAbbrev
in classModel<Options>
- Parameters:
select
- the one-character option name, as parsed by this code.
-
parseName
Description copied from class:Model
Callback, overridden by compiled code, which realizes a switch over all long option names. The generated code calls the argument parsers and stores the resulting values to the model's fields. -
numberOfPositionals
protected int numberOfPositionals()Description copied from class:Model
The generated code will return the number of positional parameters.- Specified by:
numberOfPositionals
in classModel<Options>
-
parsePositionals
protected void parsePositionals()Description copied from class:Model
Callback, overridden by compiled code, which calls one after the other the positional parameters. Each of them corresponds to an implicit option (with short names "-0 ", "-1 ", "-2 ", ...). These can also be defined explicitly, e.g. be given a long name, etc. Anyhow, they can be set explicitly by their short name. If one single positional option is given explicitly, the implicit parsing of the others is suppressed and this code will not be called.- Specified by:
parsePositionals
in classModel<Options>
-
_finalCheck
protected void _finalCheck()Description copied from class:Model
Callback, overridden by compiled code.- Specified by:
_finalCheck
in classModel<Options>
-
_getMissingOptions
Description copied from class:Model
Is overridden in the generated code and concatenates the "longest names" of all otions marked as required, but not present in the parsed input. Length==0 iff none is missing. Cf "sourcedtd required='yes'" in tools/tdom_withOptions/Options.xml- Specified by:
_getMissingOptions
in classModel<Options>
-
_getRedundantOptions
Description copied from class:Model
Callback, overridden by compiled code.- Specified by:
_getRedundantOptions
in classModel<Options>
-