Package eu.bandm.tools.d2d2.base
Class Resolver4
java.lang.Object
eu.bandm.tools.d2d2.model.MATCH_ONLY_00
eu.bandm.tools.d2d2.model.Rewrite
eu.bandm.tools.d2d2.base.Resolver4
- All Implemented Interfaces:
Rewriter
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Descend to all reachable References and set their local fields.resolved
andsourceText
to the result of the rewriting process.protected class
protected class
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<Resolver4.Inst,
Boolean> For cycle detection of insertions "@".protected Map<Resolver4.Inst,
Classifier.Instance> Becomes sensible as soon as Binding has an extended/sematic equality.(package private) final Classifier
Is ==null iff "c" is visited from "import a = b ^(c/d)"protected @Opt FlattenContext
protected Binding
protected int
protected ImportContext
protected final ModuleRegistry
protected final MessageTee<SimpleMessage<XMLDocumentIdentifier>>
Splits tomsgcount
and to the message channel of the caller.protected final MessageCounter
Own counter to abolish processing when an error has occured.(package private) boolean
protected Map<Reference,
Resolver4.Inst> protected Map<Reference,
Classifier.Instance> protected final ResolvedModule
protected final ImportContext
protected final Module
static final String
static final String
(package private) boolean
protected final int
Fields inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00
_visitor_debug_stream, partial
-
Constructor Summary
ConstructorDescriptionResolver4
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msgoutput, ModuleRegistry moduleRegistry, Module rootModule, int verbosity) Central service providing method. -
Method Summary
Modifier and TypeMethodDescriptionvoid
"rewriteFields()" is NOT called on this level, but "match()" on the contained expression, with a further "FlattenContext" added to their stack.void
void
(package private) static String
Return compound string which reflects the path of imports reaching this context.(package private) static String
compoundKey
(ImportContext ic, Definition def) Return the compound string for the definition instantiation in this context.(package private) static String
Return compound string which reflects the path of imports reaching this context.(package private) static boolean
equivalentBindings
(Binding shorter, Binding longer, Set<String> copies) Tests whether longer is semantically equivalent to shorter, and shorter is a prefix of longer.protected void
findBinding
(@Opt Binding binding, String id) protected void
protected void
protected @Opt ImportContext
loadImportedModule
(Location<XMLDocumentIdentifier> loc, ImportContext ic, String pref) Create and store a new import context and load the uninstantiated module text, if not yet done.(package private) ImportContext
newImportContext
(@Opt ImportContext predec, ImportItem importItem, String moduleAddress, Module rawModule, String key) Allows the module to contain references which are already resolved.protected void
rewriteFields
(Alt clone) protected void
rewriteFields
(CharBinary clone) protected void
rewriteFields
(CharSetConst clone) Simply clones.protected void
rewriteFields
(GrUnary clone) protected void
rewriteFields
(ParseParticle clone) Rewrite sub-expression and propagate "empty" upwards.protected void
rewriteFields
(Perm clone) void
rewriteFields
(Reference ref) protected void
rewriteFields
(Seq clone) protected void
rewriteFields
(StringConst clone) Simply clones.protected void
switchModuleRest
(Location<XMLDocumentIdentifier> loc, Reference currentReference, String... prefs) Discard the first prefix, as reflected in the global state, and call resolution for the rest components of the identifier.protected void
protected void
protected void
visitDefinition
(Location<XMLDocumentIdentifier> loc, Reference currentReference, String... prefs) protected void
visitPossiblyImportedDefinition
(Location<XMLDocumentIdentifier> loc, Reference currentReference, String id) protected void
visitPossiblyImportedDefinition
(Location<XMLDocumentIdentifier> loc, Reference currentReference, String... prefs) protected void
Methods inherited from class eu.bandm.tools.d2d2.model.Rewrite
action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, breakLoop, follow_definitions, follow_defInstances, follow_docu, follow_firsts, follow_globalSubsts, follow_imports, follow_itemDocu, follow_localdefs, follow_localSubsts, follow_modules, follow_namespaces, follow_obligates, follow_on, follow_rawModules, follow_text, follow_weakfirsts, follow_xattributes, getResult, isMulti, lookUp, putToCache, revert, rewrite, rewrite_typed, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, rewriteFields, substitute, substitute_empty, useCache
Methods inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00
_visitor_trace, action, action, action, action, compile, followAll_definitions, followAll_defInstances, followAll_docu, followAll_firsts, followAll_globalSubsts, followAll_imports, followAll_itemDocu, followAll_localdefs, followAll_localSubsts, followAll_modules, followAll_namespaces, followAll_obligates, followAll_on, followAll_rawModules, followAll_text, followAll_weakfirsts, followAll_xattributes, foreignObject, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, nomatch
-
Field Details
-
partialMode
boolean partialMode -
rootModuleSymbolicName
- See Also:
-
rootModuleExpandedSuffix
- See Also:
-
classifier
-
msg
Splits tomsgcount
and to the message channel of the caller. -
msgcount
Own counter to abolish processing when an error has occured. -
moduleRegistry
-
verbosity
protected final int verbosity -
rootModule
-
rootImportContext
-
resolvedModule
-
tagsNotCharParser
boolean tagsNotCharParser -
currentLocalSubsts
-
activeInsts
For cycle detection of insertions "@". -
patchCycles
-
allSynthetics
Becomes sensible as soon as Binding has an extended/sematic equality. -
importContextForDefs
-
currentDefinitionName
Is ==null iff "c" is visited from "import a = b ^(c/d)" -
currentFlattenContext
-
flattenDepth
protected int flattenDepth -
reference2instance
-
-
Constructor Details
-
Resolver4
public Resolver4(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msgoutput, ModuleRegistry moduleRegistry, Module rootModule, int verbosity) Central service providing method. Create a new instance for one particular raw root module. AfterwardsresolveAllPublics()
must be called. (Can only by used once.)
-
-
Method Details
-
resolveAllPublics_partial
Allows the module to contain references which are already resolved. This happens when a resolved module is embedded into the generic xslt module. This mode ignores resolved references, while the other moderesolveAllPublics()
throws an IllegalStateException. -
resolveAllPublics
-
error
-
warning
-
hint
-
TRACE
-
TRACE
-
newImportContext
ImportContext newImportContext(@Opt @Opt ImportContext predec, ImportItem importItem, String moduleAddress, Module rawModule, String key) -
compoundKeyX
Return compound string which reflects the path of imports reaching this context. This variant returns a symbolic name for the top-level module. Is NOT called recursively but uses#compoundKey()
. -
compoundKey
Return compound string which reflects the path of imports reaching this context. This variant returns empty string for the top-level module. -
compoundKey
Return the compound string for the definition instantiation in this context. -
findBinding
-
equivalentBindings
Tests whether longer is semantically equivalent to shorter, and shorter is a prefix of longer. -
installCode
-
action
-
action
"rewriteFields()" is NOT called on this level, but "match()" on the contained expression, with a further "FlattenContext" added to their stack. Thus the result of rewriting is the expansion of that expression, and the Insertion operator itself is eliminated. (NEW insertions containing only one single reference will be synthesized whenever a cycle is detected.) -
rewriteFields
- Overrides:
rewriteFields
in classRewrite
-
rewriteFields
- Overrides:
rewriteFields
in classRewrite
-
rewriteFields
- Overrides:
rewriteFields
in classRewrite
-
rewriteFields
- Overrides:
rewriteFields
in classRewrite
-
rewriteFields
- Overrides:
rewriteFields
in classRewrite
-
rewriteFields
Rewrite sub-expression and propagate "empty" upwards.- Overrides:
rewriteFields
in classRewrite
-
rewriteFields
Simply clones.- Overrides:
rewriteFields
in classRewrite
-
rewriteFields
Simply clones.- Overrides:
rewriteFields
in classRewrite
-
action
-
rewriteFields
- Overrides:
rewriteFields
in classRewrite
-
visitPossiblyImportedDefinition
protected void visitPossiblyImportedDefinition(Location<XMLDocumentIdentifier> loc, Reference currentReference, String id) -
visitPossiblyImportedDefinition
protected void visitPossiblyImportedDefinition(Location<XMLDocumentIdentifier> loc, Reference currentReference, String... prefs) -
switchModuleRest
protected void switchModuleRest(Location<XMLDocumentIdentifier> loc, Reference currentReference, String... prefs) Discard the first prefix, as reflected in the global state, and call resolution for the rest components of the identifier. -
loadImportedModule
@Opt protected @Opt ImportContext loadImportedModule(Location<XMLDocumentIdentifier> loc, ImportContext ic, String pref) Create and store a new import context and load the uninstantiated module text, if not yet done. -
visitDefinition
protected void visitDefinition(Location<XMLDocumentIdentifier> loc, Reference currentReference, String... prefs)
-