org.h2.build.doc
Class BnfSyntax

java.lang.Object
  extended by org.h2.build.doc.BnfSyntax
All Implemented Interfaces:
BnfVisitor

public class BnfSyntax
extends java.lang.Object
implements BnfVisitor

A BNF visitor that generates BNF in HTML form.


Constructor Summary
BnfSyntax()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BnfSyntax

public BnfSyntax()
Method Detail

getHtml

public java.lang.String getHtml(Bnf bnf,
                                java.lang.String syntaxLines)
Get the HTML syntax for the given syntax.

Parameters:
bnf - the BNF
syntaxLines - the syntax
Returns:
the HTML

visitRuleElement

public void visitRuleElement(boolean keyword,
                             java.lang.String name,
                             Rule link)
Description copied from interface: BnfVisitor
Visit a rule element.

Specified by:
visitRuleElement in interface BnfVisitor
Parameters:
keyword - whether this is a keyword
name - the element name
link - the linked rule if it's not a keyword

visitRuleFixed

public void visitRuleFixed(int type)
Description copied from interface: BnfVisitor
Visit a fixed rule.

Specified by:
visitRuleFixed in interface BnfVisitor
Parameters:
type - the type

visitRuleList

public void visitRuleList(boolean or,
                          java.util.ArrayList<Rule> list)
Description copied from interface: BnfVisitor
Visit a rule list.

Specified by:
visitRuleList in interface BnfVisitor
Parameters:
or - true for OR, false for AND
list - the rules

visitRuleOptional

public void visitRuleOptional(Rule rule)
Description copied from interface: BnfVisitor
Visit an optional rule.

Specified by:
visitRuleOptional in interface BnfVisitor
Parameters:
rule - the rule

visitRuleRepeat

public void visitRuleRepeat(boolean comma,
                            Rule rule)
Description copied from interface: BnfVisitor
Visit a repeat rule.

Specified by:
visitRuleRepeat in interface BnfVisitor
Parameters:
comma - whether the comma is repeated as well
rule - the element to repeat