net.sf.parser4j.parser.entity.data
Class ParserData

java.lang.Object
  extended by net.sf.parser4j.parser.entity.data.ParserData
All Implemented Interfaces:
java.io.Serializable

public class ParserData
extends java.lang.Object
implements java.io.Serializable

Author:
luc peuvrier
See Also:
Serialized Form

Constructor Summary
ParserData(int numberOfState, int numberOfNonterminal)
          number of state and number of non terminal are knew at construction
 
Method Summary
 void addGotoByNonTerminal(boolean token, boolean stringToken, int fromStateIdentifier, int nonTerminalIdentifier, ToStateAndWhiteSpaceFlag toStateAndWhiteSpaceFlag)
          add a goto from state to state by non terminal
 void addGotoByTerminal(boolean token, int fromStateIdentifier, TerminalCharRange terminalCharRange, int toStateIdentifier)
          add a goto from state to state by terminal
 void addMatch(int fromStateIdentifier, int nonTerminalIdentifier, boolean intermediate, int length, int nodeType, boolean token)
          add non terminal match to a state for non token
 void addTokenMatch(int fromStateIdentifier, int nonTerminalIdentifier, boolean intermediate, int length, int nodeType, boolean token)
          add non terminal match to a state for token
 void fixState()
           
 StateRecognitionPointList[] getByStateRecognitionPointList()
           
 int[][] getExpectedStringToken()
           
 GotoByNonTerminalEntry[] getGotoByNonTerminalTable()
           
 GotoByTerminalEntry[] getGotoByTerminalTable()
           
 GotoByTerminalEntry[] getLexerGotoByTerminalTable()
           
 int[][] getLexerMatchedNonTerminalIdentifier()
           
 java.lang.String[] getMatchClassNameTable()
           
 MatchEntrySet[] getMatchTable()
           
 java.util.Map<java.lang.Integer,NonTerminal> getNonTerminalByIdentifierMap()
           
 int getNumberOfNonterminal()
           
 int getNumberOfState()
           
 java.util.List<ParserDataRecognitionPoint> getRecognitionPoint(int stateIdentifier)
           
 int getRootNonTerminalIdentifier()
           
 boolean[] getStringTokenRecognition()
           
 GotoByNonTerminalEntry[] getTokenGotoByNonTerminalTable()
           
 GotoByTerminalEntry[] getTokenGotoByTerminalTable()
           
 MatchEntrySet[] getTokenMatchTable()
           
 boolean[] getTokenRecognition()
           
 boolean isUseMatchClass()
           
 boolean match(int stateIdentifier)
           
 void setLexerData(LexerData lexerData)
           
 void setNonTerminalByIdentifierMap(java.util.Map<java.lang.Integer,NonTerminal> nonTerminalByIdentifierMap)
          set the non terminal name by non terminal identifier
 void setNonTerminalMatchClassName(int nonTerminalIdentifier, java.lang.String matchClassName)
           
 void setRecognitionPoint(int stateIdentifier, java.util.List<ParserDataRecognitionPoint> list)
           
 void setRootNonTerminalIdentifier(int rootNonTerminalIdentifier)
           
 void setStringTokenRecognition(int stateIdentifier)
           
 void setTokenRecognition(int stateIdentifier)
           
 void setUseMatchClass(boolean useMatchClass)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParserData

public ParserData(int numberOfState,
                  int numberOfNonterminal)
number of state and number of non terminal are knew at construction

Parameters:
numberOfState -
Method Detail

fixState

public void fixState()

getNumberOfNonterminal

public int getNumberOfNonterminal()

getNumberOfState

public int getNumberOfState()

addGotoByTerminal

public void addGotoByTerminal(boolean token,
                              int fromStateIdentifier,
                              TerminalCharRange terminalCharRange,
                              int toStateIdentifier)
add a goto from state to state by terminal

Parameters:
token -
fromStateIdentifier -
terminalCharRange -
toStateIdentifier -

addGotoByNonTerminal

public void addGotoByNonTerminal(boolean token,
                                 boolean stringToken,
                                 int fromStateIdentifier,
                                 int nonTerminalIdentifier,
                                 ToStateAndWhiteSpaceFlag toStateAndWhiteSpaceFlag)
add a goto from state to state by non terminal

Parameters:
token -
stringToken -
fromStateIdentifier -
nonTerminalIdentifier -
toStateAndWhiteSpaceFlag -

addMatch

public void addMatch(int fromStateIdentifier,
                     int nonTerminalIdentifier,
                     boolean intermediate,
                     int length,
                     int nodeType,
                     boolean token)
add non terminal match to a state for non token

Parameters:
fromStateIdentifier -
nonTerminalIdentifier -
length -
nodeType -
token -

addTokenMatch

public void addTokenMatch(int fromStateIdentifier,
                          int nonTerminalIdentifier,
                          boolean intermediate,
                          int length,
                          int nodeType,
                          boolean token)
add non terminal match to a state for token

Parameters:
fromStateIdentifier -
nonTerminalIdentifier -
intermediate -
length -
nodeType -
token -

setTokenRecognition

public void setTokenRecognition(int stateIdentifier)
Parameters:
stateIdentifier -

getTokenRecognition

public boolean[] getTokenRecognition()

setStringTokenRecognition

public void setStringTokenRecognition(int stateIdentifier)
Parameters:
stateIdentifier -

getStringTokenRecognition

public boolean[] getStringTokenRecognition()

setLexerData

public void setLexerData(LexerData lexerData)

setUseMatchClass

public void setUseMatchClass(boolean useMatchClass)

isUseMatchClass

public boolean isUseMatchClass()

setNonTerminalMatchClassName

public void setNonTerminalMatchClassName(int nonTerminalIdentifier,
                                         java.lang.String matchClassName)
Parameters:
nonTerminalIdentifier -
matchClassName - can be null

match

public boolean match(int stateIdentifier)

getGotoByTerminalTable

public GotoByTerminalEntry[] getGotoByTerminalTable()

getTokenGotoByTerminalTable

public GotoByTerminalEntry[] getTokenGotoByTerminalTable()

getGotoByNonTerminalTable

public GotoByNonTerminalEntry[] getGotoByNonTerminalTable()

getTokenGotoByNonTerminalTable

public GotoByNonTerminalEntry[] getTokenGotoByNonTerminalTable()

getExpectedStringToken

public int[][] getExpectedStringToken()

getLexerMatchedNonTerminalIdentifier

public int[][] getLexerMatchedNonTerminalIdentifier()

getLexerGotoByTerminalTable

public GotoByTerminalEntry[] getLexerGotoByTerminalTable()

getMatchClassNameTable

public java.lang.String[] getMatchClassNameTable()
Returns:
match management class name for non terminal

getMatchTable

public MatchEntrySet[] getMatchTable()

getTokenMatchTable

public MatchEntrySet[] getTokenMatchTable()

getRootNonTerminalIdentifier

public int getRootNonTerminalIdentifier()

setRootNonTerminalIdentifier

public void setRootNonTerminalIdentifier(int rootNonTerminalIdentifier)

setNonTerminalByIdentifierMap

public void setNonTerminalByIdentifierMap(java.util.Map<java.lang.Integer,NonTerminal> nonTerminalByIdentifierMap)
set the non terminal name by non terminal identifier

Parameters:
nonTerminalByIdentifierMap -

getNonTerminalByIdentifierMap

public java.util.Map<java.lang.Integer,NonTerminal> getNonTerminalByIdentifierMap()
Returns:
non terminal name by non terminal identifier

setRecognitionPoint

public void setRecognitionPoint(int stateIdentifier,
                                java.util.List<ParserDataRecognitionPoint> list)

getRecognitionPoint

public java.util.List<ParserDataRecognitionPoint> getRecognitionPoint(int stateIdentifier)

getByStateRecognitionPointList

public StateRecognitionPointList[] getByStateRecognitionPointList()
Returns:
the byStateRecognitionPointList

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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