net.sf.parser4j.kernelgenerator.entity.grammarnode
Class AbstractGrammarNode

java.lang.Object
  extended by net.sf.parser4j.kernelgenerator.entity.grammarnode.AbstractGrammarNode
All Implemented Interfaces:
java.lang.Comparable<IGrammarNode>, IGrammarNode
Direct Known Subclasses:
AbstractNonTerminalNode, AbstractTerminalNode, GrammarNodeNull

public abstract class AbstractGrammarNode
extends java.lang.Object
implements IGrammarNode

Author:
luc peuvrier

Field Summary
protected  java.lang.Boolean emptyNonTerminal
           
protected  java.lang.String matchClassSimpleName
           
protected  java.lang.String nonTerminalName
          non terminal name
 
Constructor Summary
protected AbstractGrammarNode(EnumNodeType grammarNodeType)
           
 
Method Summary
protected  void badRecognitionPointIndex(int recognitionPointIndex)
          throws IllegalArgumentException because of bad recognition point index value
protected  java.lang.String characterValueToString(int value)
           
 int compareTo(IGrammarNode grammarNode)
           
 boolean equals(java.lang.Object obj)
           
 EnumNodeType getGrammarNodeType()
           
 java.lang.String getMatchClassSimpleName()
           
 int getNonTerminalIdentifier()
           
 java.lang.String getNonTerminalName()
           
 int hashCode()
           
 boolean isEmptyNonTerminal()
           
 boolean isEmptyType()
           
 boolean isIntermediate()
           
 boolean isNonTerminal()
           
 boolean isStringTerminal()
           
 boolean isStringToken()
           
 boolean isTerminal()
           
 boolean isToken()
           
protected  java.lang.String matchClassToString()
           
protected  java.lang.String nonTerminalToString()
           
 void setMatchClassSimpleName(java.lang.String matchClassSimpleName)
           
 void setNonTerminalIdentifier(int nonTerminalIdentifier, boolean intermediate)
           
 void setNonTerminalName(java.lang.String nonTerminalName)
           
 void setStringToken(boolean stringToken)
           
 void setToken(boolean token)
           
 java.lang.String toString()
          Returns a string full representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.parser4j.kernelgenerator.entity.grammarnode.IGrammarNode
accept, expectedNonTerminal, getRightPart, match, setOperandList, terminalValuesIterator, toDefinitionString
 

Field Detail

nonTerminalName

protected java.lang.String nonTerminalName
non terminal name


matchClassSimpleName

protected java.lang.String matchClassSimpleName

emptyNonTerminal

protected java.lang.Boolean emptyNonTerminal
Constructor Detail

AbstractGrammarNode

protected AbstractGrammarNode(EnumNodeType grammarNodeType)
Method Detail

getGrammarNodeType

public EnumNodeType getGrammarNodeType()
Specified by:
getGrammarNodeType in interface IGrammarNode
Returns:
grammar node type

setNonTerminalIdentifier

public void setNonTerminalIdentifier(int nonTerminalIdentifier,
                                     boolean intermediate)
Specified by:
setNonTerminalIdentifier in interface IGrammarNode
Parameters:
nonTerminalIdentifier - non terminal identifier

setNonTerminalName

public void setNonTerminalName(java.lang.String nonTerminalName)
Specified by:
setNonTerminalName in interface IGrammarNode
Parameters:
nonTerminalName - non terminal name

getNonTerminalIdentifier

public int getNonTerminalIdentifier()
Specified by:
getNonTerminalIdentifier in interface IGrammarNode
Returns:
non terminal identifier

getNonTerminalName

public java.lang.String getNonTerminalName()
Specified by:
getNonTerminalName in interface IGrammarNode
Returns:
non terminal name

getMatchClassSimpleName

public java.lang.String getMatchClassSimpleName()
Specified by:
getMatchClassSimpleName in interface IGrammarNode
Returns:
match manager class simple name

setMatchClassSimpleName

public void setMatchClassSimpleName(java.lang.String matchClassSimpleName)
Specified by:
setMatchClassSimpleName in interface IGrammarNode
Parameters:
matchClassSimpleName - match manager class simple name

setToken

public void setToken(boolean token)
Specified by:
setToken in interface IGrammarNode

isToken

public boolean isToken()
Specified by:
isToken in interface IGrammarNode
Returns:
true if this grammar node define a token

isStringToken

public boolean isStringToken()
Specified by:
isStringToken in interface IGrammarNode

setStringToken

public void setStringToken(boolean stringToken)
Specified by:
setStringToken in interface IGrammarNode

isTerminal

public boolean isTerminal()
Specified by:
isTerminal in interface IGrammarNode
Returns:
true is this grammar node is a terminal

isNonTerminal

public boolean isNonTerminal()
Specified by:
isNonTerminal in interface IGrammarNode

isStringTerminal

public boolean isStringTerminal()
Specified by:
isStringTerminal in interface IGrammarNode

isEmptyType

public boolean isEmptyType()
Specified by:
isEmptyType in interface IGrammarNode

badRecognitionPointIndex

protected void badRecognitionPointIndex(int recognitionPointIndex)
throws IllegalArgumentException because of bad recognition point index value

Parameters:
recognitionPointIndex -
Throws:
java.lang.IllegalArgumentException - bad recognition point index value

isEmptyNonTerminal

public boolean isEmptyNonTerminal()
Specified by:
isEmptyNonTerminal in interface IGrammarNode
Returns:
true if non terminal can be an empty derivation

isIntermediate

public boolean isIntermediate()
Specified by:
isIntermediate in interface IGrammarNode

compareTo

public int compareTo(IGrammarNode grammarNode)
Specified by:
compareTo in interface java.lang.Comparable<IGrammarNode>

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

characterValueToString

protected java.lang.String characterValueToString(int value)

nonTerminalToString

protected java.lang.String nonTerminalToString()

matchClassToString

protected java.lang.String matchClassToString()

toString

public java.lang.String toString()
Description copied from interface: IGrammarNode
Returns a string full representation of the object.

Specified by:
toString in interface IGrammarNode
Overrides:
toString in class java.lang.Object


Copyright © 2008-2009 Luc Peuvrier. All Rights Reserved.