public class BnfSyntax extends java.lang.Object implements BnfVisitor
| Constructor and Description |
|---|
BnfSyntax() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getHtml(Bnf bnf,
java.lang.String syntaxLines)
Get the HTML syntax for the given syntax.
|
void |
visitRuleElement(boolean keyword,
java.lang.String name,
Rule link)
Visit a rule element.
|
void |
visitRuleFixed(int type)
Visit a fixed rule.
|
void |
visitRuleList(boolean or,
java.util.ArrayList<Rule> list)
Visit a rule list.
|
void |
visitRuleOptional(Rule rule)
Visit an optional rule.
|
void |
visitRuleRepeat(boolean comma,
Rule rule)
Visit a repeat rule.
|
public java.lang.String getHtml(Bnf bnf, java.lang.String syntaxLines)
bnf - the BNFsyntaxLines - the syntaxpublic void visitRuleElement(boolean keyword,
java.lang.String name,
Rule link)
BnfVisitorvisitRuleElement in interface BnfVisitorkeyword - whether this is a keywordname - the element namelink - the linked rule if it's not a keywordpublic void visitRuleFixed(int type)
BnfVisitorvisitRuleFixed in interface BnfVisitortype - the typepublic void visitRuleList(boolean or,
java.util.ArrayList<Rule> list)
BnfVisitorvisitRuleList in interface BnfVisitoror - true for OR, false for ANDlist - the rulespublic void visitRuleOptional(Rule rule)
BnfVisitorvisitRuleOptional in interface BnfVisitorrule - the rulepublic void visitRuleRepeat(boolean comma,
Rule rule)
BnfVisitorvisitRuleRepeat in interface BnfVisitorcomma - whether the comma is repeated as wellrule - the element to repeat