net.sf.parser4j.kernelgenerator.entity.state
Class AbstractState

java.lang.Object
  extended by net.sf.parser4j.kernelgenerator.entity.state.AbstractState
All Implemented Interfaces:
IState
Direct Known Subclasses:
LexState, State

public abstract class AbstractState
extends java.lang.Object
implements IState

state is a set of recognition point

Author:
luc peuvrier

Field Summary
protected  java.util.Map<java.lang.Integer,StateAndWhiteSpaceFlag> gotoByNonTerminalMap
          goto by non terminal map for non token
protected  GotoByTerminalMap gotoByTerminalMap
          goto by terminal map for non token
protected  java.util.List<RecognitionPoint> matchList
          matched non terminal list for non token
protected  NonTerminalMap nonTerminalMap
           
protected  java.util.Map<java.lang.Integer,RecognitionPointSetAndWhiteSpaceFlag> recognitionPointByNonTerminal
          recognition point by non terminal from this state for non token
protected  RecognitionPointByTerminalMap recognitionPointByTerminal
          recognition point by terminal from this state for non token
protected  java.util.Set<RecognitionPoint> recognitionPointSet
          recognition point set of this state for non token
protected  int stateIdentifier
          identifier of this state
 
Constructor Summary
AbstractState(NonTerminalMap nonTerminalMap)
           
 
Method Summary
 void addGotoByNonTerminal(int nonTerminalIdentifier, IState state, boolean whiteSpace)
           
 void addGotoByTerminal(TerminalCharRange terminalCharRange, IState state)
           
protected abstract  void addMatch(RecognitionPoint recognitionPoint)
          add recognition point to match list
 void addRecognitionPoint(RecognitionPoint rootRecognitionPoint, boolean acceptStringTokenRecognitionPoint)
          add a recognition point to this state
protected  boolean addRecognitionPointToNonTokenSet(RecognitionPoint recognitionPoint)
           
protected abstract  boolean addRecognitionPointToSet(RecognitionPoint recognitionPoint)
           
protected abstract  void addToRecognitionPointByNonTerminal(int nonTerminalIdentifier, RecognitionPoint recognitionPoint, boolean whiteSpace)
           
protected abstract  void addToRecognitionPointByTerminal(TerminalCharRange terminalCharRange, RecognitionPoint recognitionPoint)
           
 boolean equals(java.lang.Object obj)
           
 java.util.Set<RecognitionPoint> getRecognitionPointSet()
           
 int getStateIdentifier()
           
 java.util.Iterator<java.util.Map.Entry<java.lang.Integer,StateAndWhiteSpaceFlag>> gotoByNonTerminalIterator()
           
protected  void gotoByNonTerminalToString(java.lang.StringBuilder builder, java.util.Iterator<java.util.Map.Entry<java.lang.Integer,StateAndWhiteSpaceFlag>> iteratorByNonTerminal)
           
 java.util.Iterator<StateByTerminalRange> gotoByTerminalIterator()
           
protected  void gotoByTerminalToString(java.lang.StringBuilder builder, java.util.Iterator<StateByTerminalRange> iteratorByTerminal)
           
 int hashCode()
           
protected abstract  boolean isNewRecognitionPoint(OperandGrammarNode expectedGrammarNode)
           
 java.util.Iterator<RecognitionPoint> matchListIterator()
           
 java.util.Iterator<java.util.Map.Entry<java.lang.Integer,RecognitionPointSetAndWhiteSpaceFlag>> recognitionPointByNonTerminalIterator()
           
 java.util.Iterator<RecognitionPointForTerminalRange> recognitionPointByTerminalIterator()
           
 void setStateIdentifier(int stateIdentifier)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stateIdentifier

protected int stateIdentifier
identifier of this state


recognitionPointSet

protected final java.util.Set<RecognitionPoint> recognitionPointSet
recognition point set of this state for non token


recognitionPointByTerminal

protected final RecognitionPointByTerminalMap recognitionPointByTerminal
recognition point by terminal from this state for non token


recognitionPointByNonTerminal

protected final java.util.Map<java.lang.Integer,RecognitionPointSetAndWhiteSpaceFlag> recognitionPointByNonTerminal
recognition point by non terminal from this state for non token


gotoByTerminalMap

protected final GotoByTerminalMap gotoByTerminalMap
goto by terminal map for non token


gotoByNonTerminalMap

protected final java.util.Map<java.lang.Integer,StateAndWhiteSpaceFlag> gotoByNonTerminalMap
goto by non terminal map for non token


matchList

protected final java.util.List<RecognitionPoint> matchList
matched non terminal list for non token


nonTerminalMap

protected final NonTerminalMap nonTerminalMap
Constructor Detail

AbstractState

public AbstractState(NonTerminalMap nonTerminalMap)
Method Detail

setStateIdentifier

public void setStateIdentifier(int stateIdentifier)

getStateIdentifier

public int getStateIdentifier()
Specified by:
getStateIdentifier in interface IState

addRecognitionPoint

public void addRecognitionPoint(RecognitionPoint rootRecognitionPoint,
                                boolean acceptStringTokenRecognitionPoint)
add a recognition point to this state

Parameters:
rootRecognitionPoint - root recognition point for this state

addMatch

protected abstract void addMatch(RecognitionPoint recognitionPoint)
add recognition point to match list

Parameters:
recognitionPoint -

isNewRecognitionPoint

protected abstract boolean isNewRecognitionPoint(OperandGrammarNode expectedGrammarNode)
Parameters:
expectedGrammarNode -
Returns:

addRecognitionPointToSet

protected abstract boolean addRecognitionPointToSet(RecognitionPoint recognitionPoint)
Parameters:
recognitionPoint -
Returns:

addRecognitionPointToNonTokenSet

protected boolean addRecognitionPointToNonTokenSet(RecognitionPoint recognitionPoint)

addToRecognitionPointByTerminal

protected abstract void addToRecognitionPointByTerminal(TerminalCharRange terminalCharRange,
                                                        RecognitionPoint recognitionPoint)
Parameters:
terminalCharRange -
recognitionPoint -

addToRecognitionPointByNonTerminal

protected abstract void addToRecognitionPointByNonTerminal(int nonTerminalIdentifier,
                                                           RecognitionPoint recognitionPoint,
                                                           boolean whiteSpace)
Parameters:
nonTerminalIdentifier -
recognitionPoint -
whiteSpace -

recognitionPointByTerminalIterator

public java.util.Iterator<RecognitionPointForTerminalRange> recognitionPointByTerminalIterator()

recognitionPointByNonTerminalIterator

public java.util.Iterator<java.util.Map.Entry<java.lang.Integer,RecognitionPointSetAndWhiteSpaceFlag>> recognitionPointByNonTerminalIterator()

getRecognitionPointSet

public java.util.Set<RecognitionPoint> getRecognitionPointSet()

addGotoByTerminal

public void addGotoByTerminal(TerminalCharRange terminalCharRange,
                              IState state)

addGotoByNonTerminal

public void addGotoByNonTerminal(int nonTerminalIdentifier,
                                 IState state,
                                 boolean whiteSpace)

gotoByTerminalIterator

public java.util.Iterator<StateByTerminalRange> gotoByTerminalIterator()

gotoByNonTerminalIterator

public java.util.Iterator<java.util.Map.Entry<java.lang.Integer,StateAndWhiteSpaceFlag>> gotoByNonTerminalIterator()

matchListIterator

public java.util.Iterator<RecognitionPoint> matchListIterator()

gotoByNonTerminalToString

protected void gotoByNonTerminalToString(java.lang.StringBuilder builder,
                                         java.util.Iterator<java.util.Map.Entry<java.lang.Integer,StateAndWhiteSpaceFlag>> iteratorByNonTerminal)

gotoByTerminalToString

protected void gotoByTerminalToString(java.lang.StringBuilder builder,
                                      java.util.Iterator<StateByTerminalRange> iteratorByTerminal)

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


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