Package eu.bandm.tools.d2d2.base
Class Navigate.CharSetCalc
java.lang.Object
eu.bandm.tools.d2d2.model.MATCH_ONLY_00
eu.bandm.tools.d2d2.model.SinglePhase
eu.bandm.tools.d2d2.base.Navigate.CharSetCalc
- Enclosing class:
- Navigate
Expand all character set expressions from the d2d definition language to
an extensional representation as
CharSet
.
Cache the results locally.
Under a CharBinary operator, all refs and defs and operators MUST be of character type. Otherwise (esp. under a star or plus operator) the top expression MAY be of character set type, which is indicated by a result!=null.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<Expression,
CharSet> Cache for all results calculated so far.protected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>>
Evidentprotected CharSet
Temporary visitor register.protected boolean
Whether the visited focus is argument to a binary character expression.Fields inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00
_visitor_debug_stream, partial
-
Constructor Summary
ConstructorDescriptionEvident -
Method Summary
Modifier and TypeMethodDescriptionvoid
Evaluate the arguments of the binary expression and construct the result.void
Evaluate the arguments of the binary expression and construct the result.void
Evaluate the arguments of the binary expression and construct the result.void
Evaluate the arguments of the binary expression and construct the result.void
A character set constant directly evaluates to itself.void
Visit the defined expressions.void
action
(Definition x) All definitions which are not CharsRegExp are NOT a character set.void
action
(Expression x) All other expressions are not character expressions.void
Visit the expression defined by the inserted reference.void
Any parse particle is NOT a character set.void
Only considered to be a character set when under a character set operator.void
A string constant of length==1 is treated as a character set constant.find
(Expression exp) Evaluate the expression: Either return the cache or invoke visiting.protected boolean
lookUp
(Expression exp) Copy the cached value to theresult
register.makeRange
(CharSet from, CharSet to, CharBinary rangeExpr) Construct the range between two singleton sets.protected void
memorize
(Expression exp) Put to cache.protected void
operation
(CharBinary x, char code) Evaluate the arguments of the binary expression and construct the result.protected void
rangeerror
(Expression exp, String pos) Range operator between non-singleton sets.protected boolean
reportError
(CharBinary x, String pos) Report the case that a char set binary operator is wrongly applied.protected void
xerror
(Location<XMLDocumentIdentifier> loc, String txt) Emit an error message.Methods inherited from class eu.bandm.tools.d2d2.model.SinglePhase
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, 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
Methods 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
-
charsets
Cache for all results calculated so far. -
msg
Evident -
result
Temporary visitor register. -
underExpr
protected boolean underExprWhether the visited focus is argument to a binary character expression.
-
-
Constructor Details
-
CharSetCalc
Evident
-
-
Method Details
-
memorize
Put to cache. -
lookUp
Copy the cached value to theresult
register.- Returns:
- whether the cache contains a value.
-
find
Evaluate the expression: Either return the cache or invoke visiting. -
xerror
Emit an error message. -
action
Only considered to be a character set when under a character set operator.- Overrides:
action
in classSinglePhase
-
action
All definitions which are not CharsRegExp are NOT a character set.- Overrides:
action
in classSinglePhase
-
action
Any parse particle is NOT a character set.- Overrides:
action
in classSinglePhase
-
action
Visit the defined expressions.- Overrides:
action
in classSinglePhase
-
action
Visit the expression defined by the inserted reference.- Overrides:
action
in classSinglePhase
-
action
A character set constant directly evaluates to itself.- Overrides:
action
in classSinglePhase
-
action
A string constant of length==1 is treated as a character set constant.- Overrides:
action
in classSinglePhase
-
rangeerror
Range operator between non-singleton sets. -
makeRange
Construct the range between two singleton sets. -
reportError
Report the case that a char set binary operator is wrongly applied. -
operation
Evaluate the arguments of the binary expression and construct the result. -
action
Evaluate the arguments of the binary expression and construct the result.- Overrides:
action
in classSinglePhase
-
action
Evaluate the arguments of the binary expression and construct the result.- Overrides:
action
in classSinglePhase
-
action
Evaluate the arguments of the binary expression and construct the result.- Overrides:
action
in classSinglePhase
-
action
Evaluate the arguments of the binary expression and construct the result.- Overrides:
action
in classSinglePhase
-
action
All other expressions are not character expressions.- Overrides:
action
in classSinglePhase
-