Package org.h2.bnf

Class RuleList

java.lang.Object
org.h2.bnf.RuleList
All Implemented Interfaces:
Rule

public class RuleList extends Object implements Rule
Represents a sequence of BNF rules, or a list of alternative rules.
  • Field Details

    • or

      final boolean or
    • list

      final ArrayList<Rule> list
    • mapSet

      private boolean mapSet
  • Constructor Details

    • RuleList

      public RuleList(Rule first, Rule next, boolean or)
  • Method Details

    • accept

      public void accept(BnfVisitor visitor)
      Description copied from interface: Rule
      Call the visit method in the given visitor.
      Specified by:
      accept in interface Rule
      Parameters:
      visitor - the visitor
    • setLinks

      public void setLinks(HashMap<String,RuleHead> ruleMap)
      Description copied from interface: Rule
      Update cross references.
      Specified by:
      setLinks in interface Rule
      Parameters:
      ruleMap - the reference map
    • autoComplete

      public boolean autoComplete(Sentence sentence)
      Description copied from interface: Rule
      Add the next possible token(s). If there was a match, the query in the sentence is updated (the matched token is removed).
      Specified by:
      autoComplete in interface Rule
      Parameters:
      sentence - the sentence context
      Returns:
      true if a full match
    • toString

      public String toString()
      Overrides:
      toString in class Object