net.sf.parser4j.parser.entity.parsestate
Class ParseStack

java.lang.Object
  extended by net.sf.parser4j.parser.entity.parsestate.ParseStack
All Implemented Interfaces:
java.lang.Comparable<ParseStack>

public class ParseStack
extends java.lang.Object
implements java.lang.Comparable<ParseStack>

parse stack

Author:
luc peuvrier

Constructor Summary
ParseStack()
           
ParseStack(int stateNumber)
           
 
Method Summary
 int compareTo(ParseStack parseStack)
           
 ParseStack copy()
           
 boolean equals(java.lang.Object obj)
           
 int getId()
           
 IParseNode getMatchAllParseNode()
           
 IParseNode[] getMatchedParseNode(int matchedLength)
           
 int[] getNotWhiteIndexes()
           
 IParseNode[] getParseNode()
           
 java.util.List<IParseNode> getParseNodeList()
           
 IParseNode[] getParseNodeStack()
           
 int getParseNodeTreeDepth()
           
 int getSize()
           
 int getStateNumber()
           
 int[] getStateNumberStack()
           
 int hashCode()
           
 boolean isMatchAll()
           
 void reduce(int matchedLength)
           
static void resetId()
          FOR TESTS ONLY
 void resetParseNodeTreeDepth()
           
 void setMatchAll(IParseNode matchAllParseNode)
          set this stack match all the input
 void shift(IParseNode parseNode, int toState, boolean forReduce)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseStack

public ParseStack()

ParseStack

public ParseStack(int stateNumber)
Method Detail

resetId

public static void resetId()
                    throws ParserException
FOR TESTS ONLY

Throws:
ParserException

getSize

public int getSize()

getStateNumberStack

public int[] getStateNumberStack()

getParseNodeStack

public IParseNode[] getParseNodeStack()

getId

public int getId()
Returns:
id number of this parse stack

getStateNumber

public int getStateNumber()

shift

public void shift(IParseNode parseNode,
                  int toState,
                  boolean forReduce)

reduce

public void reduce(int matchedLength)

getMatchedParseNode

public IParseNode[] getMatchedParseNode(int matchedLength)

getNotWhiteIndexes

public int[] getNotWhiteIndexes()

getParseNode

public IParseNode[] getParseNode()

getParseNodeList

public java.util.List<IParseNode> getParseNodeList()

copy

public ParseStack copy()

setMatchAll

public void setMatchAll(IParseNode matchAllParseNode)
set this stack match all the input

Parameters:
matchAllParseNode - match all parse node

isMatchAll

public boolean isMatchAll()
Returns:
true if all the input matched

getMatchAllParseNode

public IParseNode getMatchAllParseNode()
Returns:
match all parse node if matchAll is true, else null

resetParseNodeTreeDepth

public void resetParseNodeTreeDepth()

getParseNodeTreeDepth

public int getParseNodeTreeDepth()

compareTo

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

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.