marf.nlp.Parsing.GrammarCompiler
Class Terminal

java.lang.Object
  extended by marf.nlp.Parsing.GrammarCompiler.GrammarElement
      extended by marf.nlp.Parsing.GrammarCompiler.Terminal
All Implemented Interfaces:
java.io.Serializable

public class Terminal
extends GrammarElement

Represents terminal symbol grammar element. $Id: Terminal.java,v 1.11 2005/12/17 19:01:09 mokhov Exp $

Since:
0.3.0.2
Version:
$Revision: 1.11 $
Author:
Serguei Mokhov
See Also:
Serialized Form

Field Summary
protected  GrammarTokenType oType
          Grammar token type.
private static long serialVersionUID
          For serialization versioning.
 
Fields inherited from class marf.nlp.Parsing.GrammarCompiler.GrammarElement
iID, oFirstSet, oToken, strName
 
Constructor Summary
Terminal(java.lang.String pstrLexeme, int piID)
          Constructor with the token lexeme and its ID.
Terminal(Token poToken, int piID)
          Constructor with the token and its ID.
 
Method Summary
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 GrammarTokenType getType()
          Allows getting the enclosed grammar token type.
 boolean isNonTerminal()
          Allows querying this grammar element for non-terminality.
 boolean isTerminal()
          Allows querying this grammar element for terminality.
 boolean isToken(Token poToken)
          Checks is the parameter token is also token by having the same name.
 
Methods inherited from class marf.nlp.Parsing.GrammarCompiler.GrammarElement
addToFirstSet, addToFirstSet, addToFirstSet, getFirstSet, getID, getName, getToken, isEqualByName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

oType

protected GrammarTokenType oType
Grammar token type.


serialVersionUID

private static final long serialVersionUID
For serialization versioning. When adding new members or make other structural changes regenerate this number with the serialver tool that comes with JDK.

Since:
0.3.0.4
See Also:
Constant Field Values
Constructor Detail

Terminal

public Terminal(java.lang.String pstrLexeme,
                int piID)
Constructor with the token lexeme and its ID. This token upon construction is added to the first set of itself.

Parameters:
pstrLexeme - the spelling of the token
piID - corresponding integer ID

Terminal

public Terminal(Token poToken,
                int piID)
Constructor with the token and its ID. This token upon construction is added to the first set of itself.

Parameters:
poToken - token element that
piID - corresponding integer ID
Method Detail

isToken

public boolean isToken(Token poToken)
Checks is the parameter token is also token by having the same name.

Parameters:
poToken - parameter to compare token name against
Returns:
true if the parameter's lexeme is equal to this token's name; false otherwise

getType

public GrammarTokenType getType()
Allows getting the enclosed grammar token type.

Returns:
the type

isTerminal

public boolean isTerminal()
Description copied from class: GrammarElement
Allows querying this grammar element for terminality.

Specified by:
isTerminal in class GrammarElement
Returns:
true
See Also:
GrammarElement.isTerminal()

isNonTerminal

public boolean isNonTerminal()
Description copied from class: GrammarElement
Allows querying this grammar element for non-terminality.

Specified by:
isNonTerminal in class GrammarElement
Returns:
false
See Also:
GrammarElement.isNonTerminal()

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Retrieves class' revision.

Returns:
revision string


SourceForge Logo