net.sf.parser4j.parser.service
Class Parser

java.lang.Object
  extended by net.sf.parser4j.parser.service.Parser

public class Parser
extends java.lang.Object

The parser framework !

Author:
luc peuvrier

Field Summary
static ToStateAndWhiteSpaceFlag ENDING_STATE
           
static int ENDING_STATE_NUMBER
          special ending state number: 0 by Start to -1 when match all input
 
Constructor Summary
Parser(ParserData parserData, boolean matchClassOptional, IParserListener listener)
           
Parser(ParserData parserData, IParserListener listener)
           
 
Method Summary
 ParseSession getParseSession()
           
 boolean hasAlternativeForAmbiguity()
           
 boolean isPreserveParseNode()
           
 ParseResult parse(ParserFileReader parserFileReader, boolean syntaxAcceptAmbiguity, boolean lexAcceptAmbiguity)
          do parsing close reader after parsing
 void setComputeSyntaxNode(boolean computeSyntaxNode)
           
 void setMaxNumberOfAlternative(int maxNumberOfAlternative)
           
 void setPreserveParseNode(boolean preserveParseNode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENDING_STATE_NUMBER

public static final int ENDING_STATE_NUMBER
special ending state number: 0 by Start to -1 when match all input

See Also:
Constant Field Values

ENDING_STATE

public static final ToStateAndWhiteSpaceFlag ENDING_STATE
Constructor Detail

Parser

public Parser(ParserData parserData,
              IParserListener listener)
       throws ParserException
Throws:
ParserException

Parser

public Parser(ParserData parserData,
              boolean matchClassOptional,
              IParserListener listener)
       throws ParserException
Throws:
ParserException
Method Detail

setMaxNumberOfAlternative

public void setMaxNumberOfAlternative(int maxNumberOfAlternative)
Parameters:
maxNumberOfAlternative - the maxNumberOfAlternative to set

setPreserveParseNode

public void setPreserveParseNode(boolean preserveParseNode)

setComputeSyntaxNode

public void setComputeSyntaxNode(boolean computeSyntaxNode)

isPreserveParseNode

public boolean isPreserveParseNode()

getParseSession

public ParseSession getParseSession()
Returns:
the parseSession

parse

public ParseResult parse(ParserFileReader parserFileReader,
                         boolean syntaxAcceptAmbiguity,
                         boolean lexAcceptAmbiguity)
                  throws ParserException,
                         HasAmbiguityParserException
do parsing close reader after parsing

Parameters:
parserFileReader - reader of input to parse
syntaxAcceptAmbiguity - true if accept ambiguity in syntax analysis
lexAcceptAmbiguity - true if accept ambiguity in lexical analysis
Returns:
parsing result
Throws:
ParserException - for errors
HasAmbiguityParserException - reject ambiguity

hasAlternativeForAmbiguity

public boolean hasAlternativeForAmbiguity()


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