Package eu.bandm.tools.d2d2.base
Class StackPrinter.ExpressionPrinter
java.lang.Object
eu.bandm.tools.d2d2.model.MATCH_ONLY_00
eu.bandm.tools.d2d2.model.SinglePhase
eu.bandm.tools.d2d2.base.StackPrinter.ExpressionPrinter
- Enclosing class:
StackPrinter
Simply prints expressions, inserting parentheses by priority.
The derived class (local to
StackPrinter) does additional highlighting for all
contained references.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intReigster for the current precedence, for inserting parentheses.protected PrintWriterThe target for printingFields inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00
_visitor_debug_stream, partial -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidPrint an alternative expression.voidPrint a character cut expression.voidPrint a character join expression.voidPrint a character minus expression.voidPrint a character range expression.voidPrint a character set constant.voidPrint an insertion expression.voidPrints the sub-expression, followed by a question mark.voidPrint a parse particle sub-expression of a character expression.voidPrint the symbolic tag for pcdata contents.voidPrint a permutation expression.voidPrints the sub-expression, followed by a plus, possibly preceded by a tilde.voidPrint the source text of a reference.voidPrint a sequence expression.voidPrints the sub-expression, followed by a star, possibly preceded by a tilde.voidPrint a string constant.voidRaise error because all substitutions must be resolved when a parsing state is constructed.(package private) voidprintCharBin(CharBinary x, String sep, int predec) Print a binary character operator.protected voidprintMult(Collection<Expression> subs, String sep, int prec) Prints the argument sequence of Seq/Alt/Perm and puts parentheses iff the precedence decreases.protected voidPrints the contents of a modifier Opt/Star/Plus.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, 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_xattributesMethods 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
-
pw
The target for printing -
precedence
protected int precedenceReigster for the current precedence, for inserting parentheses.
-
-
Constructor Details
-
ExpressionPrinter
Only constructor.
-
-
Method Details
-
action
Print the source text of a reference.- Overrides:
actionin classSinglePhase
-
action
Print the symbolic tag for pcdata contents.- Overrides:
actionin classSinglePhase
-
printPar
Prints the contents of a modifier Opt/Star/Plus. Alt, Perm and Seq are enclosed in brackets, with reset precedence, others not. -
action
Prints the sub-expression, followed by a question mark.- Overrides:
actionin classSinglePhase
-
action
Prints the sub-expression, followed by a star, possibly preceded by a tilde.- Overrides:
actionin classSinglePhase
-
action
Prints the sub-expression, followed by a plus, possibly preceded by a tilde.- Overrides:
actionin classSinglePhase
-
printMult
Prints the argument sequence of Seq/Alt/Perm and puts parentheses iff the precedence decreases. -
action
Print an alternative expression.- Overrides:
actionin classSinglePhase
-
action
Print a sequence expression.- Overrides:
actionin classSinglePhase
-
action
Print a permutation expression.- Overrides:
actionin classSinglePhase
-
action
Print an insertion expression. Most insertions have been eliminated in ResolvedModule, but some (containing only one reference) are inserted to close cycles.- Overrides:
actionin classSinglePhase
-
printCharBin
Print a binary character operator. -
action
Print a character join expression.- Overrides:
actionin classSinglePhase
-
action
Print a character cut expression.- Overrides:
actionin classSinglePhase
-
action
Print a character minus expression.- Overrides:
actionin classSinglePhase
-
action
Print a character range expression.- Overrides:
actionin classSinglePhase
-
action
Print a parse particle sub-expression of a character expression.- Overrides:
actionin classSinglePhase
-
action
Print a character set constant.- Overrides:
actionin classSinglePhase
-
action
Print a string constant.- Overrides:
actionin classSinglePhase
-
action
Raise error because all substitutions must be resolved when a parsing state is constructed.- Overrides:
actionin classSinglePhase
-