net.percederberg.grammatica.output
Class CSharpParserFile

java.lang.Object
  |
  +--net.percederberg.grammatica.output.CSharpParserFile

public class CSharpParserFile
extends java.lang.Object

The C# parser file generator. This class encapsulates all the C# code necessary for creating a parser.

Version:
1.0
Author:
Per Cederberg,

Constructor Summary
CSharpParserFile(CSharpParserGenerator gen, CSharpTokenizerFile tokenizer)
          Creates a new parser file.
 
Method Summary
 void addProduction(ProductionPattern pattern, net.percederberg.grammatica.output.CSharpConstantsFile constants)
          Adds a production pattern definition to this file.
 void addProductionConstant(ProductionPattern pattern)
          Adds a production constant definition to this file.
 void writeCode()
          Writes the file source code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSharpParserFile

public CSharpParserFile(CSharpParserGenerator gen,
                        CSharpTokenizerFile tokenizer)
Creates a new parser file.

Parameters:
gen - the parser generator to use
tokenizer - the tokenizer file generator
Method Detail

addProductionConstant

public void addProductionConstant(ProductionPattern pattern)
Adds a production constant definition to this file.

Parameters:
pattern - the production pattern

addProduction

public void addProduction(ProductionPattern pattern,
                          net.percederberg.grammatica.output.CSharpConstantsFile constants)
Adds a production pattern definition to this file.

Parameters:
pattern - the production pattern
constants - the constants file generator

writeCode

public void writeCode()
               throws java.io.IOException
Writes the file source code.

Throws:
java.io.IOException - if the output file couldn't be created correctly