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
Modifier and TypeFieldDescriptionprotected int
Reigster for the current precedence, for inserting parentheses.protected PrintWriter
The target for printingFields inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00
_visitor_debug_stream, partial
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Print an alternative expression.void
Print a character cut expression.void
Print a character join expression.void
Print a character minus expression.void
Print a character range expression.void
Print a character set constant.void
Print an insertion expression.void
Prints the sub-expression, followed by a question mark.void
Print a parse particle sub-expression of a character expression.void
Print the symbolic tag for pcdata contents.void
Print a permutation expression.void
Prints the sub-expression, followed by a plus, possibly preceded by a tilde.void
Print the source text of a reference.void
Print a sequence expression.void
Prints the sub-expression, followed by a star, possibly preceded by a tilde.void
Print a string constant.void
Raise error because all substitutions must be resolved when a parsing state is constructed.(package private) void
printCharBin
(CharBinary x, String sep, int predec) Print a binary character operator.protected void
printMult
(Collection<Expression> subs, String sep, int prec) Prints the argument sequence of Seq/Alt/Perm and puts parentheses iff the precedence decreases.protected void
Prints 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_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
-
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:
action
in classSinglePhase
-
action
Print the symbolic tag for pcdata contents.- Overrides:
action
in 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:
action
in classSinglePhase
-
action
Prints the sub-expression, followed by a star, possibly preceded by a tilde.- Overrides:
action
in classSinglePhase
-
action
Prints the sub-expression, followed by a plus, possibly preceded by a tilde.- Overrides:
action
in classSinglePhase
-
printMult
Prints the argument sequence of Seq/Alt/Perm and puts parentheses iff the precedence decreases. -
action
Print an alternative expression.- Overrides:
action
in classSinglePhase
-
action
Print a sequence expression.- Overrides:
action
in classSinglePhase
-
action
Print a permutation expression.- Overrides:
action
in 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:
action
in classSinglePhase
-
printCharBin
Print a binary character operator. -
action
Print a character join expression.- Overrides:
action
in classSinglePhase
-
action
Print a character cut expression.- Overrides:
action
in classSinglePhase
-
action
Print a character minus expression.- Overrides:
action
in classSinglePhase
-
action
Print a character range expression.- Overrides:
action
in classSinglePhase
-
action
Print a parse particle sub-expression of a character expression.- Overrides:
action
in classSinglePhase
-
action
Print a character set constant.- Overrides:
action
in classSinglePhase
-
action
Print a string constant.- Overrides:
action
in classSinglePhase
-
action
Raise error because all substitutions must be resolved when a parsing state is constructed.- Overrides:
action
in classSinglePhase
-