Package eu.bandm.tools.umod
Class UMod2java
java.lang.Object
eu.bandm.tools.umod.UMod2java
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
protected class
protected class
protected class
protected class
protected class
Every method ".equals" and ".hashCode" does process all fields of all superclasses, without delegation.protected class
protected class
protected class
protected class
protected class
protected class
-
Field Summary
Modifier and TypeFieldDescription(package private) final Format
(package private) final Format
Code generation for abstract fields:(package private) final Map<String,
GeneratedPackage> (package private) static final Pattern
protected GeneratedClass
final String
static final String
static final String
protected UMod.Forest
GLO variable for the resolution of identifiers (local or exernal)static final String
static final String
First sentence of default documentation text for generated entities which do not allow user doc.static final String
First sentence of default documentation text for classes and fields.static final String
static final Format
protected static final Format
(package private) final Set<UMod.ExtDeclaration>
static final Format
protected boolean
protected static final Format
protected boolean
protected Types.HtmlDocText
Visitor which delivers a HTML representation of a umod type.protected String
protected String
protected static final String
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>>
protected MessageCounter
protected static final String
protected static final String
final String
final String
(package private) final Format
(package private) static final GeneratedAnnotation
static final String
static final ClassLoader
Only used for "EXT" declarations, not for implicit use of "java.util.*"protected int
protected static final MetaClass
protected static final MetaClass
protected static final MetaClass
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addDocumentation
(GeneratedAnnotationTarget target, UMod.Item source, @Opt String genericAlternative, @Opt String concludingText) Adds metajava documentation objects to the generated metajava structure.protected void
addDocumentation
(GeneratedAnnotationTarget target, UMod.Item source, @Opt String prefixToUser, @Opt String genericAlternative, @Opt String concludingText) Adds metajava documentation objects to the generated metajava structure.protected void
addDocumentation
(GeneratedAnnotationTarget target, String text) Add comment text, but only iff we run in doc mode.protected void
addIfaceDeclarations
(UMod.Forest forest) static String
Deprecated.protected void
protected void
compileEnumDef
(UMod.EnumDef td, GeneratedContext context) AnUMod.EnumDef
is a simple UMod expression which is translated to a java enumeration type.protected void
compileIfaceDef
(UMod.IfaceDef td, GeneratedContext context) An UModINTERFACE A | B || C
construct is a lean notation which is translated into the definition of new java interfaces in the generated context (package or class).protected void
compilePatterns
(GeneratedContext context) protected void
protected void
compileTypeDef
(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 void
ERROR
(Locatable<XMLDocumentIdentifier> loc, String txt) protected String
fieldCollectionToConstant
(Collection<UMod.FieldDef> coll, String sep) protected String
fieldSetToString
(Collection<UMod.FieldDef> coll, String sep) protected static Class
Only used for "EXT" declarations, not for implicit use of "java.util.*".protected void
logE()
protected void
protected void
protected void
makePrivate0aryConstructors
(boolean monolithicMode) protected void
makeswingtree
(UMod.Forest forest, GeneratedContext context, GeneratedClass basematcher, boolean visitoroptimize) protected void
makeTConstructor
(GeneratedClass gc, MetaType[] args) protected void
resolveExternals
(UMod.Forest forest) <!ELEMENT extinstantiation (absoluteref, extinstantiation*) >
protected void
(package private) void
separateBlockTags
(String s, StringBuilder description, StringBuilder blocktext) protected static Format
translate
(UMod.Forest code, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg0, String pkgname, Format generationDescription, 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 void
WARNING
(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 theINTERFACE
signatures 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
-
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 oneDOC
entry 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!=null
and there is such text. The documentation text is the concatenation of allDOC
entries 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
,@param
and@return
tags. 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, 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.Forest
object, 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 classesUMod2visitors
,UMod2Tsoap
andUMod2format
.
The sub-workes defined LOVALLY here are Visitors, namelyUMod2java.ExtInstantier
.UMod2java.V_compileVerbatimJava
.UMod2java.V_importFieldTypes
,UMod2java.V_compileFieldDefs
,UMod2java.V__compileSwingTree
,UMod2java.V_compileAlgebraic
,UMod2java.V_compileOrdered
,UMod2java.V_initFrom
.
Additionally, the classTypes
is used for type algebraics, and mapping UMod types to Java types. -
resolveExternals
<!ELEMENT extinstantiation (absoluteref, extinstantiation*) >
-
resolveOneExternal
-
compileEnumDef
AnUMod.EnumDef
is 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 || C
construct 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)
-