net.sf.parser4j.parser.service
Class MatchMgrInvoker

java.lang.Object
  extended by net.sf.parser4j.parser.service.MatchMgrInvoker
All Implemented Interfaces:
IMatchMgrInvoker, IParseNodeDataAccess, IParseNodeVisitor

public final class MatchMgrInvoker
extends java.lang.Object
implements IParseNodeVisitor, IParseNodeDataAccess, IMatchMgrInvoker

Author:
luc peuvrier

Constructor Summary
MatchMgrInvoker(java.lang.String[] matchClassNameTable, ParsingToStringUtil parsingToStringUtil, boolean matchClassOptional, boolean useMatchClass)
          set match manager by identifier
 
Method Summary
 void beginAlternativeVisit(IParseNode node, int alternativeNumber)
           
 boolean beginVisit(IParseNode node)
          begin node visit
 void checkDataComputed(IParseSessionForMatchMgr parseSession, IParseNode parseNode)
           
 void computeParseNodeData(IParseSessionForMatchMgr parseSession, IParseState parseState)
           
 boolean confirmReduction(int matchedNonterminalIdentifier, IParseNode[] parseNodes, int[] notWhiteIndexes, ParseSession parseSession)
           
 void endAlternativeVisit(IParseNode node, int alternativeNumber)
           
 void endVisit(IParseNode node)
          end node visit, not invoke if IParseNodeVisitor.beginVisit(IParseNode) returned false
 IParseNodeData[] getDataByAlternative(IParseSessionForMatchMgr parseSession, IParseNode parseNode)
           
 IParseNodeData getUniqData(IParseSessionForMatchMgr parseSession, IParseNode parseNode)
           
 boolean immediateReduction(int nonterminalIdentifier)
           
 boolean isPreserveParseNode()
           
 void reduceAction(int matchedNonterminalIdentifier, IMatchMgr matchMgr, IParseNode fatherParseNode, IParseNode[] parseNodes, int[] notWhiteIndexes, IParseSessionForMatchMgr parseSession)
          for reduction action invoke match manager for matched non terminal
 void reduceAction(int matchedNonterminalIdentifier, IParseNode fatherParseNode, IParseNode[] parseNodes, int[] notWhiteIndexes, ParseSession parseSession)
           
 void setPreserveParseNode(boolean preserveParseNode)
           
 boolean visitFirstAlternativeOnly()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchMgrInvoker

public MatchMgrInvoker(java.lang.String[] matchClassNameTable,
                       ParsingToStringUtil parsingToStringUtil,
                       boolean matchClassOptional,
                       boolean useMatchClass)
                throws ParserException
set match manager by identifier

Parameters:
matchClassNameTable - match management class name for non terminal
parsingToStringUtil -
useMatchClass -
nonTerminalByIdentifierMap -
Throws:
ParserException
Method Detail

setPreserveParseNode

public void setPreserveParseNode(boolean preserveParseNode)
Specified by:
setPreserveParseNode in interface IMatchMgrInvoker

isPreserveParseNode

public boolean isPreserveParseNode()
Specified by:
isPreserveParseNode in interface IMatchMgrInvoker

confirmReduction

public boolean confirmReduction(int matchedNonterminalIdentifier,
                                IParseNode[] parseNodes,
                                int[] notWhiteIndexes,
                                ParseSession parseSession)
                         throws ParserException
Specified by:
confirmReduction in interface IMatchMgrInvoker
Returns:
true if reduction confirmed
Throws:
ParserException

immediateReduction

public boolean immediateReduction(int nonterminalIdentifier)
Specified by:
immediateReduction in interface IMatchMgrInvoker
Returns:
true if must do immediate reduction

reduceAction

public void reduceAction(int matchedNonterminalIdentifier,
                         IParseNode fatherParseNode,
                         IParseNode[] parseNodes,
                         int[] notWhiteIndexes,
                         ParseSession parseSession)
                  throws ParserException
Specified by:
reduceAction in interface IMatchMgrInvoker
Throws:
ParserException

reduceAction

public void reduceAction(int matchedNonterminalIdentifier,
                         IMatchMgr matchMgr,
                         IParseNode fatherParseNode,
                         IParseNode[] parseNodes,
                         int[] notWhiteIndexes,
                         IParseSessionForMatchMgr parseSession)
                  throws ParserException
for reduction action invoke match manager for matched non terminal

Parameters:
matchedNonterminalIdentifier -
matchMgr -
fatherParseNode -
parseNodes - parse nodes subject to reduction
notWhiteIndexes -
Throws:
ParserException

getUniqData

public IParseNodeData getUniqData(IParseSessionForMatchMgr parseSession,
                                  IParseNode parseNode)
                           throws ParserException
Specified by:
getUniqData in interface IParseNodeDataAccess
Returns:
uniq data associated to the parse node
Throws:
ParserException

getDataByAlternative

public IParseNodeData[] getDataByAlternative(IParseSessionForMatchMgr parseSession,
                                             IParseNode parseNode)
                                      throws ParserException
Specified by:
getDataByAlternative in interface IParseNodeDataAccess
Returns:
data associated to the parse node by alternative
Throws:
ParserException

computeParseNodeData

public void computeParseNodeData(IParseSessionForMatchMgr parseSession,
                                 IParseState parseState)
                          throws ParserException
Specified by:
computeParseNodeData in interface IMatchMgrInvoker
Throws:
ParserException

checkDataComputed

public void checkDataComputed(IParseSessionForMatchMgr parseSession,
                              IParseNode parseNode)
                       throws ParserException
Specified by:
checkDataComputed in interface IMatchMgrInvoker
Throws:
ParserException

beginVisit

public boolean beginVisit(IParseNode node)
                   throws ParserException
Description copied from interface: IParseNodeVisitor
begin node visit

Specified by:
beginVisit in interface IParseNodeVisitor
Returns:
true if must do the son visit
Throws:
ParserException

endVisit

public void endVisit(IParseNode node)
              throws ParserException
Description copied from interface: IParseNodeVisitor
end node visit, not invoke if IParseNodeVisitor.beginVisit(IParseNode) returned false

Specified by:
endVisit in interface IParseNodeVisitor
Throws:
ParserException

beginAlternativeVisit

public void beginAlternativeVisit(IParseNode node,
                                  int alternativeNumber)
Specified by:
beginAlternativeVisit in interface IParseNodeVisitor

endAlternativeVisit

public void endAlternativeVisit(IParseNode node,
                                int alternativeNumber)
Specified by:
endAlternativeVisit in interface IParseNodeVisitor

visitFirstAlternativeOnly

public boolean visitFirstAlternativeOnly()
Specified by:
visitFirstAlternativeOnly in interface IParseNodeVisitor
Returns:
true if visit first alternative only


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