net.sf.parser4j.generator.service
Class ParserDataGenerator

java.lang.Object
  extended by net.sf.parser4j.kernelgenerator.service.grammarnode.AbstractGrammarNodeVisitor
      extended by net.sf.parser4j.generator.service.ParserDataGenerator
All Implemented Interfaces:
IGrammarNodeVisitor

public final class ParserDataGenerator
extends AbstractGrammarNodeVisitor

generate parser data file from grammar definition file

Author:
luc peuvrier

Method Summary
protected  void beginVisitImpl(IGrammarNode grammarNode)
           
protected  void endVisitImpl(IGrammarNode grammarNode)
           
 ParseResult generate(java.io.File grammarInputFile, java.io.File htmlParserDataOutputFile, java.io.File txtLexGenLogOutputFile, java.io.File parserDataOutputFile, java.lang.String matchMgrPackageName, java.io.File grammarDefTreeTextFile, java.io.File grammarTreeTextFile, IParserListener listener)
          generate parser data file from grammar definition file
 ParseResult generate(ParserData parserData4Gen, java.io.File grammarInputFile, java.io.File htmlParserDataOutputFile, java.io.File txtLexGenLogOutputFile, java.io.File parserDataOutputFile, java.lang.String matchMgrPackageName, java.io.File grammarDefTreeTextFile, java.io.File grammarTreeTextFile, IParserListener listener)
           
 Pair<ParseResult,ParserData> generate(ParserData parserData4Gen, java.io.File grammarInputFile, java.lang.String matchMgrPackageName, java.io.File grammarDefTreeTextFile, java.io.File grammarTreeTextFile, IParserListener listener)
           
 Pair<ParseResult,ParserData> generate(ParserData parserData4Gen, ParserFileReader reader, java.lang.String matchMgrPackageName, java.io.File grammarDefTreeTextFile, java.io.File grammarTreeTextFile, java.lang.String whiteSpaceNonTerminalName, IParserListener listener)
          close reader after parsing
static ParserDataGenerator getInstance()
           
protected  void visitImpl(IGrammarNode grammarNode)
           
 
Methods inherited from class net.sf.parser4j.kernelgenerator.service.grammarnode.AbstractGrammarNodeVisitor
beginVisit, close, endVisit, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ParserDataGenerator getInstance()

generate

public ParseResult generate(java.io.File grammarInputFile,
                            java.io.File htmlParserDataOutputFile,
                            java.io.File txtLexGenLogOutputFile,
                            java.io.File parserDataOutputFile,
                            java.lang.String matchMgrPackageName,
                            java.io.File grammarDefTreeTextFile,
                            java.io.File grammarTreeTextFile,
                            IParserListener listener)
                     throws GeneratorException
generate parser data file from grammar definition file

Parameters:
grammarInputFile - grammar definition UTF-8 text file
htmlParserDataOutputFile - parser data in html form file, null if no output in html form
txtLexGenLogOutputFile - log of lex data generation in text file, null if no output
parserDataOutputFile - parser data file to generate
matchMgrPackageName - name of package containing the match manager classes
grammarDefTreeTextFile - to output grammar definition tree in text file, null if no output
grammarTreeTextFile - to output grammar tree in text file, null if no output
Returns:
parsing result
Throws:
GeneratorException

generate

public ParseResult generate(ParserData parserData4Gen,
                            java.io.File grammarInputFile,
                            java.io.File htmlParserDataOutputFile,
                            java.io.File txtLexGenLogOutputFile,
                            java.io.File parserDataOutputFile,
                            java.lang.String matchMgrPackageName,
                            java.io.File grammarDefTreeTextFile,
                            java.io.File grammarTreeTextFile,
                            IParserListener listener)
                     throws GeneratorException
Throws:
GeneratorException

generate

public Pair<ParseResult,ParserData> generate(ParserData parserData4Gen,
                                             java.io.File grammarInputFile,
                                             java.lang.String matchMgrPackageName,
                                             java.io.File grammarDefTreeTextFile,
                                             java.io.File grammarTreeTextFile,
                                             IParserListener listener)
                                      throws GeneratorException
Parameters:
parserData4Gen - parser data to use to parse grammar definition
grammarInputFile - grammar definition UTF-8 text file
matchMgrPackageName - name of package containing the match manager classes
grammarDefTreeTextFile - to output grammar definition tree in text file, null if no output
grammarTreeTextFile - to output grammar tree in text file, null if no output
listener -
Returns:
parsing result
Throws:
GeneratorException

generate

public Pair<ParseResult,ParserData> generate(ParserData parserData4Gen,
                                             ParserFileReader reader,
                                             java.lang.String matchMgrPackageName,
                                             java.io.File grammarDefTreeTextFile,
                                             java.io.File grammarTreeTextFile,
                                             java.lang.String whiteSpaceNonTerminalName,
                                             IParserListener listener)
                                      throws GeneratorException
close reader after parsing

Parameters:
parserData4Gen - parser data to use to parse grammar definition
reader - reader of grammar definition UTF-8 text file
matchMgrPackageName - name of package containing the match manager classes
grammarDefTreeTextFile - to output grammar definition tree in text file, null if no output
grammarTreeTextFile - to output grammar tree in text file, null if no output
whiteSpaceNonTerminalName - name of global white space non terminal, null if none
listener -
Returns:
parsing result
Throws:
GeneratorException

beginVisitImpl

protected void beginVisitImpl(IGrammarNode grammarNode)
                       throws GrammarNodeVisitException
Specified by:
beginVisitImpl in class AbstractGrammarNodeVisitor
Throws:
GrammarNodeVisitException

endVisitImpl

protected void endVisitImpl(IGrammarNode grammarNode)
                     throws GrammarNodeVisitException
Specified by:
endVisitImpl in class AbstractGrammarNodeVisitor
Throws:
GrammarNodeVisitException

visitImpl

protected void visitImpl(IGrammarNode grammarNode)
                  throws GrammarNodeVisitException
Specified by:
visitImpl in class AbstractGrammarNodeVisitor
Throws:
GrammarNodeVisitException


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