|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.tree.Visitor
xtc.parser.PrettyPrinter
xtc.parser.HtmlPrinter
public class HtmlPrinter
A grammar pretty printer producing HTML.
| Field Summary | |
|---|---|
protected Analyzer |
analyzer
The analyzer utility. |
protected boolean |
isGrammar
The flag for whether we are processing a grammar or single module. |
protected int |
pNumber
The number of the current production. |
protected Runtime |
runtime
The runtime. |
| Fields inherited from class xtc.parser.PrettyPrinter |
|---|
ast, isTopLevel, newline, parenChoice, parenSequence, printer, verbose |
| Constructor Summary | |
|---|---|
HtmlPrinter(Runtime runtime,
Analyzer analyzer,
AST ast,
boolean verbose)
Create a new HTML printer. |
|
| Method Summary | |
|---|---|
protected void |
enter(Production p)
Enter the specified production. |
protected void |
exit(Production p)
Exit the specified production. |
protected void |
open(java.lang.String name)
Create a printer for the specified file. |
protected void |
print(Module m)
Actually print the specified module. |
protected void |
print(ModuleDependency dep,
java.lang.String name)
Print the specified module dependency. |
protected void |
print(ModuleName name,
boolean resolved)
Print a linked version of the specified module name. |
protected void |
print(java.lang.String s)
Print the specified action string. |
protected void |
printDocumentation(Module m)
Print the specified module documentation comment. |
protected void |
printOption(Module m)
Print the specified module's options. |
protected int |
regexEscapes()
Get the flags for escaping regex strings. |
protected int |
stringEscapes()
Get the flags for escaping regular strings. |
void |
visit(Grammar g)
Print the specified grammar. |
void |
visit(Module m)
Print the specified module. |
void |
visit(NonTerminal nt)
Print the specified nonterminal. |
void |
visit(SequenceName n)
Print the specified sequence name. |
void |
visit(StringValue v)
Print the specified string value. |
void |
visit(TokenValue v)
Print the specified token value. |
| Methods inherited from class xtc.parser.PrettyPrinter |
|---|
flush, format, isPrefix, print, print, printActions, printModule, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit |
| Methods inherited from class xtc.tree.Visitor |
|---|
dispatch, equals, hashCode, iterate, map, mapInPlace, unableToVisit, visit |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Runtime runtime
protected final Analyzer analyzer
protected boolean isGrammar
protected int pNumber
| Constructor Detail |
|---|
public HtmlPrinter(Runtime runtime,
Analyzer analyzer,
AST ast,
boolean verbose)
runtime - The runtime.analyzer - The analyzer.ast - The type operations.verbose - The verbose flag.| Method Detail |
|---|
protected int stringEscapes()
PrettyPrinter
stringEscapes in class PrettyPrinterprotected int regexEscapes()
PrettyPrinter
regexEscapes in class PrettyPrinter
protected void open(java.lang.String name)
throws java.io.IOException
printer to a printer writing to the
file with the specified name in the runtime's output directory.
name - The file name.
java.io.IOExceptionprotected void printDocumentation(Module m)
PrettyPrinter
printDocumentation in class PrettyPrinterm - The module.protected void printOption(Module m)
PrettyPrinter
printOption in class PrettyPrinterm - The module.protected void print(Module m)
m - The module to print.public void visit(Grammar g)
PrettyPrinter
visit in class PrettyPrinterpublic void visit(Module m)
PrettyPrinter
visit in class PrettyPrinter
protected void print(ModuleName name,
boolean resolved)
name - The module name.resolved - The flag for whether the name can be resolved.
protected void print(ModuleDependency dep,
java.lang.String name)
PrettyPrinter
print in class PrettyPrinterdep - The dependency.name - The corresponding name.protected void enter(Production p)
PrettyPrinterPrettyPrinter.parenChoice and PrettyPrinter.parenSequence to false.
enter in class PrettyPrinterp - The production.protected void exit(Production p)
PrettyPrinter
exit in class PrettyPrinterp - The production.public void visit(SequenceName n)
PrettyPrinter
visit in class PrettyPrinterpublic void visit(NonTerminal nt)
PrettyPrinter
visit in class PrettyPrinterprotected void print(java.lang.String s)
PrettyPrinter
print in class PrettyPrinters - The string.public void visit(StringValue v)
PrettyPrinter
visit in class PrettyPrinterpublic void visit(TokenValue v)
PrettyPrinter
visit in class PrettyPrinter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||