Package eu.bandm.tools.formatfrontends
Class Tdom2format
- java.lang.Object
-
- eu.bandm.tools.tdom.runtime.BaseVisitor
-
- eu.bandm.tools.formatfrontends.absy.Visitor
-
- eu.bandm.tools.formatfrontends.GenericCompiler
-
- eu.bandm.tools.formatfrontends.Tdom2format
-
- All Implemented Interfaces:
PCDataVisitor
public class Tdom2format extends GenericCompiler
Application to translate a format description for elements of a tdom model into format generating code.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
Tdom2format.NameMangler
protected class
Tdom2format.Switchselection
protected class
Tdom2format.TdomSubformat
-
Nested classes/interfaces inherited from class eu.bandm.tools.formatfrontends.GenericCompiler
GenericCompiler.Subformat
-
-
Field Summary
-
Fields inherited from class eu.bandm.tools.formatfrontends.GenericCompiler
callFunctionForRaisingException, checkedmode, constcache, exprCache, fresult, isdynamic, MODIF_CONST, NAME_CONST_FORMAT_EMPTY, NAME_METHOD_THROW_TAKE_ALTERNATIVE, NAME_VAR_DEFAULT_INDENT, NAME_VAR_FORMAT_RESULT, NAME_VAR_MODE, rec, REF_FORMAT_Format, targetclass, WRAPPEDCLASS_CompoundConstructor, WRAPPEDCLASS_Format, WRAPPEDCLASS_Function, WRAPPEDCLASS_ListoidFormatter, WRAPPEDCLASS_Lists, WRAPPEDCLASS_MapEntry, WRAPPEDCLASS_MapoidFormatter, WRAPPEDCLASS_Object, WRAPPEDCLASS_TakeAlternativeException, WRAPPEDCLASS_TryerCatcher
-
Fields inherited from class eu.bandm.tools.tdom.runtime.BaseVisitor
validating
-
-
Constructor Summary
Constructors Constructor Description Tdom2format(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> rec)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GeneratedClass
compile(GeneratedPackage targetpackage, MetaClass basevisitor, java.lang.String classname, eu.bandm.tools.formatfrontends.absy.Element_tdomRules rules)
protected Format
FORMATTER_fieldSelection(Format f, java.lang.String s)
protected Format
getCurrentModel()
Currently only needed to compileescapeToJava()
in the variant operating directly on the model element.protected static eu.bandm.tools.formatfrontends.absy.Document_tdomRules
loadDocument(java.io.Reader str, java.lang.String filename, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg)
static void
main(java.lang.String[] args)
needs :protected void
ruleerror(Location<XMLDocumentIdentifier> l, java.lang.String s)
void
visit(eu.bandm.tools.formatfrontends.absy.Element_cas el)
MISSING FIXME check if numbers correspond to kind of selector (0/1 for elements!)void
visit(eu.bandm.tools.formatfrontends.absy.Element_cases el)
void
visit(eu.bandm.tools.formatfrontends.absy.Element_child el)
Compile code for a child reference.void
visit(eu.bandm.tools.formatfrontends.absy.Element_clss el)
void
visit(eu.bandm.tools.formatfrontends.absy.Element_clssUPCASE el)
void
visit(eu.bandm.tools.formatfrontends.absy.Element_instanceTest el)
void
visit(eu.bandm.tools.formatfrontends.absy.Element_supr el)
void
visit(eu.bandm.tools.formatfrontends.absy.Element_swtch el)
void
visit(eu.bandm.tools.formatfrontends.absy.Element_t_pcdata element)
void
visit(eu.bandm.tools.formatfrontends.absy.Element_tdomRule el)
-
Methods inherited from class eu.bandm.tools.formatfrontends.GenericCompiler
checkconst, compileCallToFormatText, compileModeSwitch, compileOnePattern, create_resultfield, error, expr, getMsgReceiver, initTransformerClass, process_compound, refer, setMsgReceiver, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, warning
-
Methods inherited from class eu.bandm.tools.formatfrontends.absy.Visitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Methods inherited from class eu.bandm.tools.tdom.runtime.BaseVisitor
visit
-
-
-
-
Field Detail
-
WRAPPEDCLASS_Arrays
public final EnvironmentClass WRAPPEDCLASS_Arrays
-
WRAPPEDCLASS_String
public final EnvironmentClass WRAPPEDCLASS_String
-
WRAPPEDCLASS_List
public final EnvironmentClass WRAPPEDCLASS_List
-
WRAPPEDCLASS_ArrayList
public final EnvironmentClass WRAPPEDCLASS_ArrayList
-
WRAPPEDCLASS_Visitable
public final EnvironmentClass WRAPPEDCLASS_Visitable
-
WRAPPEDCLASS_ListoidFormatter_Visitable
public final GeneratedParameterizedType WRAPPEDCLASS_ListoidFormatter_Visitable
-
lineWidth
public static final int lineWidth
-
targetClassLoader
public static final java.lang.ClassLoader targetClassLoader
-
FORMAT_fieldSelection
protected Format FORMAT_fieldSelection
-
NAME_COMPILER_DEFAULT
protected final java.lang.String NAME_COMPILER_DEFAULT
- See Also:
- Constant Field Values
-
VISIT_MODIF
protected final int VISIT_MODIF
- See Also:
- Constant Field Values
-
VISIT_NAME
protected final java.lang.String VISIT_NAME
- See Also:
- Constant Field Values
-
VISIT_PARAMETER_NAME
protected final java.lang.String VISIT_PARAMETER_NAME
- See Also:
- Constant Field Values
-
NAME_METHOD_toFormat
protected final java.lang.String NAME_METHOD_toFormat
- See Also:
- Constant Field Values
-
NAME_METHOD_toFormat_throwing
protected final java.lang.String NAME_METHOD_toFormat_throwing
- See Also:
- Constant Field Values
-
NAME_METHOD_toFormat_array
protected final java.lang.String NAME_METHOD_toFormat_array
- See Also:
- Constant Field Values
-
wrappedclass_Element
protected EnvironmentClass wrappedclass_Element
-
absypackage
protected MetaPackage absypackage
-
visitmethods
protected final java.util.Map<java.lang.String,GeneratedMethod> visitmethods
-
namemangler
protected final Tdom2format.NameMangler namemangler
-
currentModel
protected Format currentModel
-
diag_rule
protected java.lang.String diag_rule
-
subformat
protected Tdom2format.TdomSubformat subformat
-
NAME_FUNCTION_ARGUMENT
protected final java.lang.String NAME_FUNCTION_ARGUMENT
- See Also:
- Constant Field Values
-
FORMAT_FUNCTION_ARGUMENT
protected final Format FORMAT_FUNCTION_ARGUMENT
-
switchselection
protected Tdom2format.Switchselection switchselection
<!ELEMENT numberedref (ref, number?) >
-
altnum
java.lang.String altnum
-
-
Constructor Detail
-
Tdom2format
public Tdom2format(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> rec)
-
-
Method Detail
-
getCurrentModel
protected Format getCurrentModel()
Description copied from class:GenericCompiler
Currently only needed to compileescapeToJava()
in the variant operating directly on the model element. Introduced 20170428.- Specified by:
getCurrentModel
in classGenericCompiler
-
compile
public GeneratedClass compile(GeneratedPackage targetpackage, MetaClass basevisitor, java.lang.String classname, eu.bandm.tools.formatfrontends.absy.Element_tdomRules rules)
-
ruleerror
protected void ruleerror(Location<XMLDocumentIdentifier> l, java.lang.String s)
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_tdomRule el)
- Overrides:
visit
in classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_instanceTest el)
- Overrides:
visit
in classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_clss el)
- Overrides:
visit
in classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_clssUPCASE el)
- Overrides:
visit
in classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_supr el)
- Overrides:
visit
in classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_t_pcdata element)
- Overrides:
visit
in classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_child el)
Compile code for a child reference. This can be- Tag (num defaults to one(1) )
- Tag+num
- Seq+num
- Choice+num
- Choice+num+Altindex
[..]
". --- Overrides:
visit
in classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_swtch el)
- Overrides:
visit
in classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_cases el)
- Overrides:
visit
in classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_cas el)
MISSING FIXME check if numbers correspond to kind of selector (0/1 for elements!)- Overrides:
visit
in classeu.bandm.tools.formatfrontends.absy.Visitor
-
loadDocument
protected static eu.bandm.tools.formatfrontends.absy.Document_tdomRules loadDocument(java.io.Reader str, java.lang.String filename, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg)
-
main
public static void main(java.lang.String[] args)
needs :0: root of source tree 1: package name 2: name of base visitor class 3: name of class to generate 4: indication of source type "dtd" or other string 5: source file uri --OR-- dtd uri with PIs ""
-
-