dk.brics.grammar
Class NonterminalEntity

java.lang.Object
  extended by dk.brics.grammar.Entity
      extended by dk.brics.grammar.NonterminalEntity

public class NonterminalEntity
extends Entity

A nonterminal in a production.


Constructor Summary
NonterminalEntity(String nonterminal, String label, String example)
          Constructs a new nonterminal entity.
 
Method Summary
 String getNonterminal()
          Returns the name of this nonterminal entity.
 String toString()
          Returns string representation of this entity.
<T> T
visitBy(EntityVisitor<T> v)
          Visits this entity with the given visitor.
 
Methods inherited from class dk.brics.grammar.Entity
getExample, getLabel, isExplicitlyLabeled, isLabeled, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NonterminalEntity

public NonterminalEntity(String nonterminal,
                         String label,
                         String example)
                  throws GrammarException
Constructs a new nonterminal entity.

Parameters:
nonterminal - nonterminal
label - entity label, null if ignorable
example - example string, null if absent
Throws:
GrammarException
Method Detail

getNonterminal

public String getNonterminal()
Returns the name of this nonterminal entity.

Returns:
nonterminal name

toString

public String toString()
Returns string representation of this entity.

Overrides:
toString in class Object

visitBy

public <T> T visitBy(EntityVisitor<T> v)
Description copied from class: Entity
Visits this entity with the given visitor.

Specified by:
visitBy in class Entity
Parameters:
v - entity visitor


Copyright © 2005-2008 Anders Møller.