## org.h2.bnf
Interface Rule

All Known Implementing Classes:
  DbContextRule, RuleElement, RuleFixed, RuleList, RuleOptional, RuleRepeat

    public interface Rule

Represents a BNF rule.

Method Summary
`void` `accept(BnfVisitor visitor)` Call the visit method in the given visitor.
`void` `addNextTokenList(Sentence sentence)` Add the next possible token for a query.
`boolean` `matchRemove(Sentence sentence)` Remove a token from a sentence.
`java.lang.String` `name()` Get the name of the rule.
`void` `setLinks(java.util.HashMap<java.lang.String,RuleHead> ruleMap)` Update cross references.

Method Detail

### name

    java.lang.String name()

  Get the name of the rule.

  Returns:
    the name

### setLinks

    void setLinks(java.util.HashMap<java.lang.String,RuleHead> ruleMap)

  Update cross references.

  Parameters:
    `ruleMap` - the reference map

### addNextTokenList

    void addNextTokenList(Sentence sentence)

  Add the next possible token for a query. Used for autocomplete support.

  Parameters:
    `sentence` - the sentence context

### matchRemove

    boolean matchRemove(Sentence sentence)

  Remove a token from a sentence. Used for autocomplete support. If there was a match, the query in the sentence is updated (the matched token is removed).

  Parameters:
    `sentence` - the sentence context
  Returns:
    false if not a match or a partial match, true if a full match

### accept

    void accept(BnfVisitor visitor)

  Call the visit method in the given visitor.

  Parameters:
    `visitor` - the visitor