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
Nested ClassesModifier and TypeClassDescriptionclassDescend to all reachable References and set their local fields.resolvedandsourceTextto the result of the rewriting process.protected classprotected class -
Field Summary
FieldsModifier 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 ClassifierIs ==null iff "c" is visited from "import a = b ^(c/d)"protected @Opt FlattenContextprotected Bindingprotected intprotected ImportContextprotected final ModuleRegistryprotected final MessageTee<SimpleMessage<XMLDocumentIdentifier>> Splits tomsgcountand to the message channel of the caller.protected final MessageCounterOwn counter to abolish processing when an error has occured.(package private) booleanprotected Map<Reference, Resolver4.Inst> protected Map<Reference, Classifier.Instance> protected final ResolvedModuleprotected final ImportContextprotected final Modulestatic final Stringstatic final String(package private) booleanprotected final intFields inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00
_visitor_debug_stream, partial -
Constructor Summary
ConstructorsConstructorDescriptionResolver4(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.voidvoid(package private) static StringReturn compound string which reflects the path of imports reaching this context.(package private) static StringcompoundKey(ImportContext ic, Definition def) Return the compound string for the definition instantiation in this context.(package private) static StringReturn compound string which reflects the path of imports reaching this context.(package private) static booleanequivalentBindings(Binding shorter, Binding longer, Set<String> copies) Tests whether longer is semantically equivalent to shorter, and shorter is a prefix of longer.protected voidfindBinding(@Opt Binding binding, String id) protected voidprotected void(package private) voidinstallCode_X(Definition def, ImportContext imp) protected @Opt ImportContextloadImportedModule(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) ImportContextnewImportContext(@Opt ImportContext predec, ImportItem importItem, String moduleAddress, Module rawModule, String key) Allows the module to contain references which are already resolved.protected voidrewriteFields(Alt clone) protected voidrewriteFields(CharBinary clone) protected voidrewriteFields(CharSetConst clone) Simply clones.protected voidrewriteFields(GrUnary clone) protected voidrewriteFields(ParseParticle clone) Rewrite sub-expression and propagate "empty" upwards.protected voidrewriteFields(Perm clone) voidrewriteFields(Reference ref) protected voidrewriteFields(Seq clone) protected voidrewriteFields(StringConst clone) Simply clones.protected voidswitchModuleRest(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 voidprotected voidprotected voidvisitDefinition(Location<XMLDocumentIdentifier> loc, Reference currentReference, String... prefs) protected voidvisitPossiblyImportedDefinition(Location<XMLDocumentIdentifier> loc, Reference currentReference, String id) protected voidvisitPossiblyImportedDefinition(Location<XMLDocumentIdentifier> loc, Reference currentReference, String... prefs) protected voidMethods 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, useCacheMethods inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00
_visitor_trace, action, 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 tomsgcountand 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. -
installCode_X
-
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 usescompoundKey(ImportContext). -
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:
rewriteFieldsin classRewrite
-
rewriteFields
- Overrides:
rewriteFieldsin classRewrite
-
rewriteFields
- Overrides:
rewriteFieldsin classRewrite
-
rewriteFields
- Overrides:
rewriteFieldsin classRewrite
-
rewriteFields
- Overrides:
rewriteFieldsin classRewrite
-
rewriteFields
Rewrite sub-expression and propagate "empty" upwards.- Overrides:
rewriteFieldsin classRewrite
-
rewriteFields
Simply clones.- Overrides:
rewriteFieldsin classRewrite
-
rewriteFields
Simply clones.- Overrides:
rewriteFieldsin classRewrite
-
action
-
rewriteFields
- Overrides:
rewriteFieldsin 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)
-