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

java.lang.Object
  extended by net.sf.parser4j.parser.entity.parsenode.AbstractParseNode
      extended by net.sf.parser4j.parser.entity.parsenode.AbstractTerminalParseNode
All Implemented Interfaces:
IParseNode
Direct Known Subclasses:
CharacterParseNode, StringParseNode

public abstract class AbstractTerminalParseNode
extends AbstractParseNode

common to all terminal parse node

Author:
luc peuvrier

Field Summary
 
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
protected AbstractTerminalParseNode(EnumNodeType parseNodeType, int grammarSymbolIdentifier, ParseSession parseSession, int parseStackId, ParsingToStringUtil parsingToStringUtil, boolean intermediate, boolean computeSyntaxNode)
           
protected AbstractTerminalParseNode(EnumNodeType parseNodeType, ParseSession parseSession, int parseStackId, ParsingToStringUtil parsingToStringUtil, boolean computeSyntaxNode)
           
 
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()
           
protected abstract  java.lang.String getValue()
           
 int hashCode()
           
 boolean setAlternativeParseNode(IParseNode alternativeParseNode, int maxNumberOfAlternative)
          set alternative parse node, special case for terminal ( see implementation )
 void setData()
           
 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
 

Constructor Detail

AbstractTerminalParseNode

protected AbstractTerminalParseNode(EnumNodeType parseNodeType,
                                    int grammarSymbolIdentifier,
                                    ParseSession parseSession,
                                    int parseStackId,
                                    ParsingToStringUtil parsingToStringUtil,
                                    boolean intermediate,
                                    boolean computeSyntaxNode)

AbstractTerminalParseNode

protected AbstractTerminalParseNode(EnumNodeType parseNodeType,
                                    ParseSession parseSession,
                                    int parseStackId,
                                    ParsingToStringUtil parsingToStringUtil,
                                    boolean computeSyntaxNode)
Method Detail

unreferenceSon

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


assertSonReferenced

public void assertSonReferenced()
                         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

getNumberOfAlternative

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

setData

public void setData()
             throws ParserException
Throws:
ParserException

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

setAlternativeParseNode

public boolean setAlternativeParseNode(IParseNode alternativeParseNode,
                                       int maxNumberOfAlternative)
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

getAlternativeParseNodeArray

public IParseNode[] getAlternativeParseNodeArray()

getSonParseNodes

public IParseNode[] getSonParseNodes()

getNotWhiteIndexes

public int[] getNotWhiteIndexes()

getSyntaxNode

public SyntaxNode getSyntaxNode()
                         throws ParserException
Throws:
ParserException

getValue

protected abstract java.lang.String getValue()

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.