net.percederberg.grammatica.output
Class CSharpParserGenerator

java.lang.Object
  |
  +--net.percederberg.grammatica.output.ParserGenerator
        |
        +--net.percederberg.grammatica.output.CSharpParserGenerator

public class CSharpParserGenerator
extends ParserGenerator

A C# parser generator. This class generates the source code files needed for a C# parser.

Version:
1.0
Author:
Per Cederberg,

Field Summary
 
Fields inherited from class net.percederberg.grammatica.output.ParserGenerator
FILE_COMMENT
 
Constructor Summary
CSharpParserGenerator(Grammar grammar)
          Creates a new parser generator.
 
Method Summary
 java.lang.String getBaseName()
          Returns the class name prefix.
 CodeStyle getCodeStyle()
          Returns the code style to use.
 java.lang.String getNamespace()
          Returns the namespace used for the classes.
 void setBaseName(java.lang.String name)
          Sets the class name prefix.
 void setNamespace(java.lang.String namespace)
          Sets the namespace to use for the classes.
 void write()
          Writes the source code files.
 
Methods inherited from class net.percederberg.grammatica.output.ParserGenerator
getBaseDir, getFileComment, getGrammar, setBaseDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSharpParserGenerator

public CSharpParserGenerator(Grammar grammar)
Creates a new parser generator.

Parameters:
grammar - the grammar to use
Method Detail

getNamespace

public java.lang.String getNamespace()
Returns the namespace used for the classes.

Returns:
the fully qualified namespace, or null for none

setNamespace

public void setNamespace(java.lang.String namespace)
Sets the namespace to use for the classes.

Parameters:
namespace - the fully qualified namespace

getBaseName

public java.lang.String getBaseName()
Returns the class name prefix.

Returns:
the class name prefix

setBaseName

public void setBaseName(java.lang.String name)
Sets the class name prefix.

Parameters:
name - the class name prefix

getCodeStyle

public CodeStyle getCodeStyle()
Returns the code style to use.

Returns:
the code style to use

write

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

Specified by:
write in class ParserGenerator
Throws:
java.io.IOException - if the files couldn't be written correctly