net.percederberg.grammatica.output
Class CSharpTokenizerFile

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

public class CSharpTokenizerFile
extends java.lang.Object

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

Version:
1.0
Author:
Per Cederberg,

Constructor Summary
CSharpTokenizerFile(CSharpParserGenerator gen)
          Creates a new tokenizer file.
 
Method Summary
 void addToken(TokenPattern pattern, net.percederberg.grammatica.output.CSharpConstantsFile constants)
          Adds a token pattern definition to this file.
protected  java.lang.String getConstructorCall(java.lang.String param)
          Creates source code performing a call to the constructor for the tokenizer.
 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

CSharpTokenizerFile

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

Parameters:
gen - the parser generator to use
Method Detail

addToken

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

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

getConstructorCall

protected java.lang.String getConstructorCall(java.lang.String param)
Creates source code performing a call to the constructor for the tokenizer.

Parameters:
param - the input parameters
Returns:
the source code for the call

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