net.percederberg.grammatica.output
Class ParserGenerator

java.lang.Object
  |
  +--net.percederberg.grammatica.output.ParserGenerator
Direct Known Subclasses:
CSharpParserGenerator, JavaParserGenerator

public abstract class ParserGenerator
extends java.lang.Object

The grammar parser generator base class.


Field Summary
protected static java.lang.String FILE_COMMENT
          The default file comment string.
 
Constructor Summary
protected ParserGenerator(Grammar grammar)
          Creates a new parser generator.
 
Method Summary
 java.io.File getBaseDir()
          Returns the base directory where files will be created.
 java.lang.String getFileComment()
          Returns the file comment.
 Grammar getGrammar()
          Returns the grammar that this parser generator works on.
 void setBaseDir(java.io.File dir)
          Sets the base directory where files will be created.
abstract  void write()
          Writes the source code files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_COMMENT

protected static final java.lang.String FILE_COMMENT
The default file comment string.

See Also:
Constant Field Values
Constructor Detail

ParserGenerator

protected ParserGenerator(Grammar grammar)
Creates a new parser generator.

Parameters:
grammar - the grammar to use
Method Detail

getGrammar

public Grammar getGrammar()
Returns the grammar that this parser generator works on.

Returns:
the parser generator grammar

getBaseDir

public java.io.File getBaseDir()
Returns the base directory where files will be created.

Returns:
the base directory

setBaseDir

public void setBaseDir(java.io.File dir)
Sets the base directory where files will be created.

Parameters:
dir - the base directory

getFileComment

public java.lang.String getFileComment()
Returns the file comment.

Returns:
the file comment

write

public abstract void write()
                    throws java.io.IOException
Writes the source code files.

Throws:
java.io.IOException - if the files couldn't be written correctly