net.sf.parser4j.parser.entity.parsenode
Interface IParseNode

All Known Implementing Classes:
AbstractNonTerminalParseNode, AbstractParseNode, AbstractTerminalParseNode, AlternativeParseNode, CharacterParseNode, ConcatParseNode, EmptyParseNode, StringParseNode

public interface IParseNode

all parse node interface

Author:
luc peuvrier

Method Summary
 void accept(IParseNodeVisitor visitor)
          to visit this parse node
 void addErrorStatus(IParseNode[] sonParseNodes)
           
 void addErrorStatus(IParseNodeInErrorStatus status)
          add error status
 void assertSonReferenced()
           
 IParseNode[] getAlternativeParseNodeArray()
           
 int getBeginColumnNumber()
           
 int getBeginLineNumber()
           
 IParseNodeData[] getDataByAlternative()
           
 int getEndColumnNumber()
           
 int getEndLineNumber()
           
 java.util.List<IParseNodeInErrorStatus> getErrorStatusList()
           
 java.lang.String getFileName()
           
 int getGrammarSymbolIdentifier()
           
 int getMyIdentifier()
           
 java.lang.String getName()
           
 int[] getNotWhiteIndexes()
           
 int getNumberOfAlternative()
           
 EnumNodeType getParseNodeType()
           
 int getParseStackId()
           
 IParseNode[] getSonParseNodes()
           
 SyntaxNode getSyntaxNode()
           
 IParseNodeData getUniqData()
           
 boolean hasDataComputed()
           
 boolean isInError()
           
 boolean isIntermediate()
           
 boolean isNonTerminal()
           
 boolean isTerminal()
           
 boolean isWhiteSpace()
           
 boolean setAlternativeParseNode(IParseNode alternativeParseNode, int maxNumberOfAlternative)
          set alternative parse node, special case for terminal ( see implementation )
 void setData()
           
 void setData(IParseNodeData data)
           
 void setInTextInformation(java.lang.String fileName, int beginLineNumber, int beginColumnNumber, int endLineNumber, int endColumnNumber)
          set source file name and begin/end line/column number
 void setMatchIdentifier(java.lang.String matchIdentifier)
           
 void setWhiteSpace(boolean whiteSpace)
           
 java.lang.String toString(boolean visitAgainEnabled)
           
 void unreferenceSon()
          make this parse not no more reference its son
 

Method Detail

getParseStackId

int getParseStackId()
Returns:
the parse stack identification number of this parse node

getMyIdentifier

int getMyIdentifier()
Returns:
this parse node identifier, do not confuse with grammar symbol identifier

getParseNodeType

EnumNodeType getParseNodeType()
Returns:
the parse node type

setInTextInformation

void setInTextInformation(java.lang.String fileName,
                          int beginLineNumber,
                          int beginColumnNumber,
                          int endLineNumber,
                          int endColumnNumber)
set source file name and begin/end line/column number

Parameters:
fileName -
beginLineNumber -
beginColumnNumber -
endLineNumber -
endColumnNumber -

getFileName

java.lang.String getFileName()
Returns:
file name source of this parse node

getBeginLineNumber

int getBeginLineNumber()
Returns:
begin line number

getEndLineNumber

int getEndLineNumber()
Returns:
end line number

getBeginColumnNumber

int getBeginColumnNumber()
Returns:
begin column number

getEndColumnNumber

int getEndColumnNumber()
Returns:
end column number

getNumberOfAlternative

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

getGrammarSymbolIdentifier

int getGrammarSymbolIdentifier()
Returns:
non terminal identifier of this parse node

getName

java.lang.String getName()

isIntermediate

boolean isIntermediate()

isInError

boolean isInError()
Returns:
true if parse node is in error

getErrorStatusList

java.util.List<IParseNodeInErrorStatus> getErrorStatusList()
Returns:
the error status list, null if no error

addErrorStatus

void addErrorStatus(IParseNodeInErrorStatus status)
add error status

Parameters:
status - the error status

addErrorStatus

void addErrorStatus(IParseNode[] sonParseNodes)
Parameters:
parseNodes -

isNonTerminal

boolean isNonTerminal()
Returns:
true if this parse node is a non terminal

isTerminal

boolean isTerminal()
Returns:
true if this parse node is a terminal

setWhiteSpace

void setWhiteSpace(boolean whiteSpace)
Parameters:
whiteSpace - true if the matched non terminal of this parse node is a white space

isWhiteSpace

boolean isWhiteSpace()
Returns:
true if the matched non terminal of this parse node is a white space

setAlternativeParseNode

boolean setAlternativeParseNode(IParseNode alternativeParseNode,
                                int maxNumberOfAlternative)
                                throws ParserException,
                                       TooMuchAlternativeParserException
set alternative parse node, special case for terminal ( see implementation )

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

hasDataComputed

boolean hasDataComputed()
Returns:
true if data associated to the parse node is computed or terminal parse node

setData

void setData(IParseNodeData data)
             throws ParserException
Parameters:
data - data associated to this parse node first alternative
Throws:
ParserException

setData

void setData()
             throws ParserException
Throws:
ParserException

getUniqData

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

getDataByAlternative

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

getAlternativeParseNodeArray

IParseNode[] getAlternativeParseNodeArray()

getSonParseNodes

IParseNode[] getSonParseNodes()

accept

void accept(IParseNodeVisitor visitor)
            throws ParserException
to visit this parse node

Parameters:
visitor - the parse node visitor
Throws:
ParserException

unreferenceSon

void unreferenceSon()
                    throws ParserException
make this parse not no more reference its son

Throws:
ParserException

assertSonReferenced

void assertSonReferenced()
                         throws ParserException
Throws:
ParserException

getNotWhiteIndexes

int[] getNotWhiteIndexes()

toString

java.lang.String toString(boolean visitAgainEnabled)

setMatchIdentifier

void setMatchIdentifier(java.lang.String matchIdentifier)

getSyntaxNode

SyntaxNode getSyntaxNode()
                         throws ParserException
Throws:
ParserException


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