net.sf.parser4j.parser.entity.parsenode
Class AbstractNonTerminalParseNode

java.lang.Object
  extended by net.sf.parser4j.parser.entity.parsenode.AbstractParseNode
      extended by net.sf.parser4j.parser.entity.parsenode.AbstractNonTerminalParseNode
All Implemented Interfaces:
IParseNode
Direct Known Subclasses:
AlternativeParseNode, ConcatParseNode, EmptyParseNode

public abstract class AbstractNonTerminalParseNode
extends AbstractParseNode

common to all non terminal parse node

Author:
luc peuvrier

Field Summary
protected  int[] notWhiteIndexes
           
protected  IParseNode[] sonParseNodes
           
 
Fields inherited from class net.sf.parser4j.parser.entity.parsenode.AbstractParseNode
_log, beginColumnNumber, beginLineNumber, computeSyntaxNode, data, dataByAlternative, endColumnNumber, endLineNumber, fileName, grammarSymbolIdentifier, intermediate, matchIdentifier, parseSession, parsingToStringUtil, syntaxNode, whiteSpace
 
Constructor Summary
AbstractNonTerminalParseNode(EnumNodeType parseNodeType, IParseNode[] parseNodes, int[] notWhiteIndexes, int grammarSymbolIdentifier, ParseSession parseSession, int parseStackId, ParsingToStringUtil parsingToStringUtil, boolean intermediate, boolean computeSyntaxNode)
          construct setting this parse node type and sons
 
Method Summary
 void accept(IParseNodeVisitor visitor)
          to visit this parse node
 void assertSonReferenced()
           
 boolean equals(java.lang.Object obj)
           
 IParseNode[] getAlternativeParseNodeArray()
           
 IParseNodeData[] getDataByAlternative()
           
 int[] getNotWhiteIndexes()
           
 int getNumberOfAlternative()
           
 IParseNode[] getSonParseNodes()
           
 SyntaxNode getSyntaxNode()
           
 IParseNodeData getUniqData()
           
 int hashCode()
           
 boolean setAlternativeParseNode(IParseNode alternativeParseNode, int maxNumberOfAlternative)
          set alternative parse node, special case for terminal ( see implementation )
 void setData()
           
protected  void setSonParseNodes(IParseNode[] array)
           
 void unreferenceSon()
          make this parse not no more reference its son
 
Methods inherited from class net.sf.parser4j.parser.entity.parsenode.AbstractParseNode
addErrorStatus, addErrorStatus, getBeginColumnNumber, getBeginLineNumber, getEndColumnNumber, getEndLineNumber, getErrorStatusList, getFileName, getGrammarSymbolIdentifier, getMyIdentifier, getName, getParseNodeType, getParseStackId, hasDataComputed, isInError, isIntermediate, isNonTerminal, isTerminal, isWhiteSpace, setData, setInTextInformation, setMatchIdentifier, setWhiteSpace, toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

sonParseNodes

protected IParseNode[] sonParseNodes

notWhiteIndexes

protected int[] notWhiteIndexes
Constructor Detail

AbstractNonTerminalParseNode

public AbstractNonTerminalParseNode(EnumNodeType parseNodeType,
                                    IParseNode[] parseNodes,
                                    int[] notWhiteIndexes,
                                    int grammarSymbolIdentifier,
                                    ParseSession parseSession,
                                    int parseStackId,
                                    ParsingToStringUtil parsingToStringUtil,
                                    boolean intermediate,
                                    boolean computeSyntaxNode)
construct setting this parse node type and sons

Parameters:
parseNodeType - this parse node type
parseNodes - this parse node sons parse node
notWhiteIndexes -
grammarSymbolIdentifier -
parseSession -
parseStackId -
Method Detail

getSonParseNodes

public IParseNode[] getSonParseNodes()

getNotWhiteIndexes

public int[] getNotWhiteIndexes()

getNumberOfAlternative

public int getNumberOfAlternative()
Returns:
number of alternative of this parse node

getAlternativeParseNodeArray

public IParseNode[] getAlternativeParseNodeArray()

unreferenceSon

public void unreferenceSon()
                    throws ParserException
Description copied from interface: IParseNode
make this parse not no more reference its son

Throws:
ParserException

assertSonReferenced

public void assertSonReferenced()
                         throws ParserException
Throws:
ParserException

setData

public void setData()
             throws ParserException
Throws:
ParserException

setAlternativeParseNode

public boolean setAlternativeParseNode(IParseNode alternativeParseNode,
                                       int maxNumberOfAlternative)
                                throws ParserException,
                                       TooMuchAlternativeParserException
Description copied from interface: IParseNode
set alternative parse node, special case for terminal ( see implementation )

Returns:
true if alternative added, false if not added when alternative parse node is same instance than this
Throws:
ParserException
TooMuchAlternativeParserException

getUniqData

public IParseNodeData getUniqData()
                           throws ParserException
Returns:
uniq data associated to this parse node
Throws:
ParserException

getDataByAlternative

public IParseNodeData[] getDataByAlternative()
                                      throws ParserException
Returns:
data associated to this parse node by alternative
Throws:
ParserException

setSonParseNodes

protected void setSonParseNodes(IParseNode[] array)

getSyntaxNode

public SyntaxNode getSyntaxNode()
                         throws ParserException
Throws:
ParserException

accept

public void accept(IParseNodeVisitor visitor)
            throws ParserException
Description copied from interface: IParseNode
to visit this parse node

Parameters:
visitor - the parse node visitor
Throws:
ParserException

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractParseNode

equals

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


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