Package org.javacc.jjdoc
Class TextGenerator
java.lang.Object
org.javacc.jjdoc.TextGenerator
- All Implemented Interfaces:
Generator
- Direct Known Subclasses:
HTMLGenerator
,XTextGenerator
Output BNF in text format.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Output comment from a production.protected PrintWriter
Create an output stream for the generated Jack code.void
Log debug messages.void
Output document footer.void
Output document header.void
Log error messages.void
expansionEnd
(Expansion e, boolean first) Output end of Expansion.void
expansionStart
(Expansion e, boolean first) Output start of an Expansion.void
void
Log informational messages.void
Output comment from a production.void
Output end of non-terminal.void
Output end of non-terminal.void
Output start of non-terminal.void
Output start of non-terminal.void
Output String.void
Output end of a normal production.void
Output start of a normal production.void
Output end of regular expression.void
Output start of regular expression.void
Output Special Tokens.void
Output string with entity substitution for brackets and ampersands.void
Output end of tokens.void
Output start of tokens.void
Log warning messages.
-
Field Details
-
ostr
-
-
Constructor Details
-
TextGenerator
public TextGenerator()
-
-
Method Details
-
text
Output string with entity substitution for brackets and ampersands. -
print
Output String. -
documentStart
public void documentStart()Output document header.- Specified by:
documentStart
in interfaceGenerator
- See Also:
-
documentEnd
public void documentEnd()Output document footer.- Specified by:
documentEnd
in interfaceGenerator
- See Also:
-
specialTokens
Output Special Tokens.- Specified by:
specialTokens
in interfaceGenerator
- Parameters:
s
- tokens to output- See Also:
-
nonterminalsStart
public void nonterminalsStart()Output start of non-terminal.- Specified by:
nonterminalsStart
in interfaceGenerator
- See Also:
-
nonterminalsEnd
public void nonterminalsEnd()Output end of non-terminal.- Specified by:
nonterminalsEnd
in interfaceGenerator
- See Also:
-
tokensStart
public void tokensStart()Output start of tokens.- Specified by:
tokensStart
in interfaceGenerator
- See Also:
-
handleTokenProduction
- Specified by:
handleTokenProduction
in interfaceGenerator
-
tokensEnd
public void tokensEnd()Output end of tokens. -
javacode
Output comment from a production. -
cppcode
Output comment from a production. -
productionStart
Output start of a normal production.- Specified by:
productionStart
in interfaceGenerator
- Parameters:
np
- the NormalProduction being output- See Also:
-
productionEnd
Output end of a normal production.- Specified by:
productionEnd
in interfaceGenerator
- Parameters:
np
- the NormalProduction being output- See Also:
-
expansionStart
Output start of an Expansion.- Specified by:
expansionStart
in interfaceGenerator
- Parameters:
e
- Expansion being outputfirst
- whether this is the first expansion- See Also:
-
expansionEnd
Output end of Expansion.- Specified by:
expansionEnd
in interfaceGenerator
- Parameters:
e
- Expansion being outputfirst
- whether this is the first expansion- See Also:
-
nonTerminalStart
Output start of non-terminal.- Specified by:
nonTerminalStart
in interfaceGenerator
- Parameters:
nt
- the NonTerminal being output- See Also:
-
nonTerminalEnd
Output end of non-terminal.- Specified by:
nonTerminalEnd
in interfaceGenerator
- Parameters:
nt
- the NonTerminal being output- See Also:
-
reStart
Output start of regular expression. -
reEnd
Output end of regular expression. -
create_output_stream
Create an output stream for the generated Jack code. Try to open a file based on the name of the parser, but if that fails use the standard output stream. -
debug
Log debug messages. -
info
Log informational messages. -
warn
Log warning messages. -
error
Log error messages.
-