Package org.nineml.coffeegrinder.parser
Class NonterminalSymbol
- java.lang.Object
-
- org.nineml.coffeegrinder.util.Decoratable
-
- org.nineml.coffeegrinder.parser.Symbol
-
- org.nineml.coffeegrinder.parser.NonterminalSymbol
-
public class NonterminalSymbol extends Symbol
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringsymbolName
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Test nonterminals for equality.java.lang.StringgetName()The name of this symbol.inthashCode()Assure that equal nonterminals return the same hash code.booleanmatches(Symbol input)Are these the same symbol?booleanmatches(Token input)Does this symbol match the input token?java.lang.StringtoString()Pretty print a nonterminal.-
Methods inherited from class org.nineml.coffeegrinder.util.Decoratable
addAttribute, addAttributes, getAttribute, getAttributes, getAttributesMap, getAttributeValue, hasAttribute
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
The name of this symbol.- Returns:
- the name of the symbol.
-
matches
public final boolean matches(Symbol input)
Are these the same symbol?
-
matches
public final boolean matches(Token input)
Does this symbol match the input token?No, it does not. No nonterminal ever matches an input token.
-
equals
public boolean equals(java.lang.Object obj)
Test nonterminals for equality.Two nonterminals are equal if they have the same name.
- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- An object.- Returns:
- true if
objis equal to this nonterminal.
-
hashCode
public int hashCode()
Assure that equal nonterminals return the same hash code.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hash code.
-
toString
public java.lang.String toString()
Pretty print a nonterminal.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of the object.
-
-