net.percederberg.grammatica.output
Class CSharpAnalyzerFile

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

public class CSharpAnalyzerFile
extends java.lang.Object

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

Version:
1.0
Author:
Per Cederberg,

Constructor Summary
CSharpAnalyzerFile(CSharpParserGenerator gen)
          Creates a new analyzer file.
 
Method Summary
 void addProduction(ProductionPattern pattern, net.percederberg.grammatica.output.CSharpConstantsFile constants)
          Adds the production analysis methods to this file.
 void addToken(TokenPattern pattern, net.percederberg.grammatica.output.CSharpConstantsFile constants)
          Adds the token analysis methods 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

CSharpAnalyzerFile

public CSharpAnalyzerFile(CSharpParserGenerator gen)
Creates a new analyzer file.

Parameters:
gen - the parser generator to use
Method Detail

addToken

public void addToken(TokenPattern pattern,
                     net.percederberg.grammatica.output.CSharpConstantsFile constants)
Adds the token analysis methods to this file.

Parameters:
pattern - the token pattern
constants - the constants file

addProduction

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

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

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