Package eu.bandm.tools.umod
Class UMod2java
java.lang.Object
eu.bandm.tools.umod.UMod2java
@PropertyDependency("eu.bandm.tools.umod.UMod2java.targetClassPath")
public class UMod2java
extends Object
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprotected classprotected classprotected classprotected classprotected classEvery method ".equals" and ".hashCode" does process all fields of all superclasses, without delegation.protected classprotected classprotected classprotected classprotected classprotected class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Format(package private) final FormatCode generation for abstract fields:protected Format(package private) final Map<String, GeneratedPackage> (package private) static final Patternprotected GeneratedClassfinal Stringstatic final Stringstatic final Stringprotected UMod.ForestGLO variable for the resolution of identifiers (local or exernal)static final Stringstatic final StringFirst sentence of default documentation text for generated entities which do not allow user doc.static final StringFirst sentence of default documentation text for classes and fields.static final Stringstatic final Formatprotected static final Format(package private) final Set<UMod.ExtDeclaration> static final Formatprotected booleanprotected static final Formatprotected GeneratedAnnotationprotected booleanprotected Types.HtmlDocTextVisitor which delivers a HTML representation of a umod type.protected Stringprotected Stringprotected static final Stringprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> protected MessageCounterprotected static final Stringprotected static final Stringfinal Stringfinal String(package private) final Format(package private) static final GeneratedAnnotationstatic final Stringstatic final ClassLoaderOnly used for "EXT" declarations, not for implicit use of "java.util.*"!protected intprotected static final MetaClassprotected static final MetaClassprotected static final MetaClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddDocumentation(GeneratedAnnotationTarget target, UMod.Item source, @Opt String genericAlternative, @Opt String concludingText) Adds metajava documentation objects to the generated metajava structure.protected voidaddDocumentation(GeneratedAnnotationTarget target, UMod.Item source, @Opt String prefixToUser, @Opt String genericAlternative, @Opt String concludingText) Adds metajava documentation objects to the generated metajava structure.protected voidaddDocumentation(GeneratedAnnotationTarget target, String text) Add comment text, but only iff we run in doc mode.protected voidaddIfaceDeclarations(UMod.Forest forest) static StringDeprecated.protected voidprotected voidcompileEnumDef(UMod.EnumDef td, GeneratedContext context) AnUMod.EnumDefis a simple UMod expression which is translated to a java enumeration type.protected voidcompileIfaceDef(UMod.IfaceDef td, GeneratedContext context) An UModINTERFACE A | B || Cconstruct is a lean notation which is translated into the definition of new java interfaces in the generated context (package or class).protected voidcompilePatterns(GeneratedContext context) protected voidprotected voidcompileTypeDef(UMod.TypeDef td, GeneratedContext context) FIXME assert that type expression is COMPLEX (not just T_reference or primitive!) Typedefs are CURRENTLY NOT YET USED NOR TESTED !protected voidERROR(Locatable<XMLDocumentIdentifier> loc, String txt) protected StringfieldCollectionToConstant(Collection<UMod.FieldDef> coll, String sep) protected StringfieldSetToString(Collection<UMod.FieldDef> coll, String sep) protected static Class<?> Only used for "EXT" declarations, not for implicit use of "java.util.*".protected voidlogE()protected voidprotected voidprotected voidmakePrivate0aryConstructors(boolean monolithicMode) protected voidmakeswingtree(UMod.Forest forest, GeneratedContext context, GeneratedClass basematcher, boolean visitoroptimize) protected voidmakeTConstructor(GeneratedClass gc, MetaType[] args) protected voidresolveExternals(UMod.Forest forest) <!ELEMENT extinstantiation (absoluteref, extinstantiation*) >protected void(package private) voidseparateBlockTags(String s, StringBuilder description, StringBuilder blocktext) protected static Formattranslate(UMod.Forest code, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg0, String pkgname, Format generationDescription, String dateAndTime, boolean getterfunctions, boolean setterfunctions, boolean make_patterns, boolean saxgen, boolean swingtreegen, boolean visitordebug, boolean visitoroptimize, boolean visitorcompile, boolean allrewriterwarnings, boolean monolithic, boolean floatNotDouble, boolean constructorsPre20181214) Main class for translating a UMod model into Java source code.protected voidWARNING(Locatable<XMLDocumentIdentifier> loc, String txt) protected void
-
Field Details
-
targetClassLoader
Only used for "EXT" declarations, not for implicit use of "java.util.*"! -
DOC_SEP
- See Also:
-
F_DOC_SEP
-
docMissing_x
- See Also:
-
docMissing
First sentence of default documentation text for classes and fields.- See Also:
-
docDefault
First sentence of default documentation text for generated entities which do not allow user doc. Currently these are only theINTERFACEsignatures defined in umod.- See Also:
-
blockTag
-
FORMAT_null
-
NAME_SAX_PARSER
- See Also:
-
NAME_SAX_WRITER
- See Also:
-
METHODNAME_GETFORMATHINT
- See Also:
-
CLASSNAME_TREEGEN
- See Also:
-
MODIF_PACKAGE_ACCESSIBLE
protected static final int MODIF_PACKAGE_ACCESSIBLE- See Also:
-
MODIF_TOPCLASS
protected static final int MODIF_TOPCLASS- See Also:
-
MODIF_STATICCLASS
protected static final int MODIF_STATICCLASS- See Also:
-
MODIF_STATIC_CONST
protected static final int MODIF_STATIC_CONST- See Also:
-
MODIF_STATICFIELD
protected static final int MODIF_STATICFIELD- See Also:
-
MODIF_STATICFINALFIELD
protected static final int MODIF_STATICFINALFIELD- See Also:
-
MODIF_CALLABLE
protected static final int MODIF_CALLABLE- See Also:
-
MODIF_STATICCALLABLE
protected static final int MODIF_STATICCALLABLE- See Also:
-
suffix_srcDoc
- See Also:
-
comment_link_to_prettyPrint
- See Also:
-
curforest
GLO variable for the resolution of identifiers (local or exernal) -
floatNotDouble
protected boolean floatNotDouble -
userDocLevel
protected int userDocLevel -
hasUserDoc
protected boolean hasUserDoc -
htmlDocText
Visitor which delivers a HTML representation of a umod type. This includes navigation links for reference types, etc. -
htmlPPfilename
-
msg
-
msgCounter
-
log_phase
-
annotationGeneratedArguments
-
generationAnnotation
-
artificialPackages
-
extUnderResolve
-
abstractSetFieldNotSupported
Code generation for abstract fields:curforest.concrete2abstractField: (set up by "Checker") A f ABSTRACT int ** --> int get_f(){throw new Excp...} bool set_f(int){throw new ..} [[OPT int]] ^^ [[return null]] | B1 || f int *| --> int get_f(){return f;} bool set_f(int){...} | int f ; | B2 | f int * -
abstractGetFieldNotSupported
-
returnNull
-
doubleColonComment
-
sonarqubeStringsEqual
-
CLASSNAME_TERM_PATTERNS
- See Also:
-
NAMESTUB_PATTERN_TERM
- See Also:
-
NAMESTUB_PATTERN_CAST
- See Also:
-
class_term_patterns
-
WRAPPEDCLASS_SwingForester
-
WRAPPEDCLASS_SwingForester_LazyNode
-
WRAPPEDCLASS_swing_tree_TreeNode
-
dueToAlg
-
-
Constructor Details
-
UMod2java
public UMod2java()
-
-
Method Details
-
findexternalclassforname
Only used for "EXT" declarations, not for implicit use of "java.util.*". Only called by "resolveExternals()". -
canonicalFieldName
Deprecated. -
strictnessCheck
-
fieldSetToString
-
fieldCollectionToConstant
-
addDocumentation
protected void addDocumentation(GeneratedAnnotationTarget target, @Opt UMod.Item source, @Opt @Opt String genericAlternative, @Opt @Opt String concludingText) Adds metajava documentation objects to the generated metajava structure. CallsaddDocumentation(GeneratedAnnotationTarget, UMod.INTERFACE, String, String, String)withprefixToUser==null. -
separateBlockTags
-
addDocumentation
protected void addDocumentation(GeneratedAnnotationTarget target, @Opt UMod.Item source, @Opt @Opt String prefixToUser, @Opt @Opt String genericAlternative, @Opt @Opt String concludingText) Adds metajava documentation objects to the generated metajava structure. Documentation is added iff umod runs in doc-mode. Doc-mode is enabled iff there is at least oneDOCentry in the umod source.The generated documentation consists of:
- The explicit documentation text from the umod source connected
to item
source, if the item is!=nulland there is such text. The documentation text is the concatenation of allDOCentries in the source, in source order. It shall adhere to the javadoc rules; esp. the first sentence should be self-contained and end with "." = period and space. This text is included in<div class="bandmUser">and prefixed byprefixToUser, if that is not==null. - Otherwise the text in
genericAlternative, if!=null. - Followed by a textual and linked source indication, if
item != null. - Followed by
concludingText, if!=null.
- Parameters:
target- the generated metajava object to be documented.source- the umod source which led to the generation, ornull. FIXME DOCME wann ist das null ?prefixToUser- inserted before the user-defined doc text.genericAlternative- text which is used if there is no doc-text in the the umod source related to the item given bysource; may be==null.concludingText- text appended to the end of the doc text. Only this text may contain@see,@paramand@returntags. The contents of these are not HTML, but plain text only.
- The explicit documentation text from the umod source connected
to item
-
addDocumentation
Add comment text, but only iff we run in doc mode. -
ERROR
-
WARNING
-
WARNING
-
logS
-
logE
-
logE
protected void logE() -
checkErrors
protected void checkErrors() -
translate
public GeneratedPackage translate(UMod.Forest code, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg0, String pkgname, Format generationDescription, String dateAndTime, boolean getterfunctions, boolean setterfunctions, boolean make_patterns, boolean saxgen, boolean swingtreegen, boolean visitordebug, boolean visitoroptimize, boolean visitorcompile, boolean allrewriterwarnings, boolean monolithic, boolean floatNotDouble, boolean constructorsPre20181214) Main class for translating a UMod model into Java source code. It is alled with anUMod.Forestobject, which (nearly always) comes from aReducer, which translates some umod source file. It outputs aGeneratedPackage, which can be written to a source text file as usual.This main method calls additionally the main methods in the separate classes
UMod2visitors,UMod2TsoapandUMod2format.The sub-workes defined LOVALLY here are Visitors, namely
UMod2java.ExtInstantier.UMod2java.V_compileVerbatimJava.UMod2java.V_importFieldTypes,UMod2java.V_compileFieldDefs,UMod2java.V__compileSwingTree,UMod2java.V_compileAlgebraic,UMod2java.V_compileOrdered,UMod2java.V_initFrom.
Additionally, the classTypesis used for type algebraics, and mapping UMod types to Java types. -
resolveExternals
<!ELEMENT extinstantiation (absoluteref, extinstantiation*) > -
resolveOneExternal
-
compileEnumDef
AnUMod.EnumDefis a simple UMod expression which is translated to a java enumeration type. FIXME MISSING embedded java with enum or enum item currently not supported by input grammar. -
compileIfaceDef
An UModINTERFACE A | B || Cconstruct is a lean notation which is translated into the definition of new java interfaces in the generated context (package or class). (Do not mix up withIMPLEMENTS!) FIXME currently documentation text is not supported. -
compileTypeDef
FIXME assert that type expression is COMPLEX (not just T_reference or primitive!) Typedefs are CURRENTLY NOT YET USED NOR TESTED ! -
makeTConstructor
-
addIfaceDeclarations
-
compilePatterns
-
compilePatterns
-
makePrivate0aryConstructors
protected void makePrivate0aryConstructors(boolean monolithicMode) -
makeswingtree
protected void makeswingtree(UMod.Forest forest, GeneratedContext context, GeneratedClass basematcher, boolean visitoroptimize)
-