fr.umlv.tatoo.cc.common.generator
Class Generator

java.lang.Object
  extended by fr.umlv.tatoo.cc.common.generator.Generator
Direct Known Subclasses:
ASTGenerator, LexerGenerator, ParserGenerator, ToolsGenerator

public class Generator
extends Object

Generate enums that represents at runtimn productions, terminals, non-terminals, rules and parser tables using respectively an array of ProductionDecl, TerminalDecl, NonTerminalDecl, RuleDecl, ParserTableDecl.

Author:
remi

Constructor Summary
Generator(File sourceDir, Class<?> clazz)
           
 
Method Summary
 void generate(Map<String,?> root, Map<AliasPrototype,? extends Alias> aliasMap, AliasPrototype prototype)
           
protected  void generate(Map<String,?> map, String templateName, Type type)
          Generates the source code of a type using a template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Generator

public Generator(File sourceDir,
                 Class<?> clazz)
Method Detail

generate

public void generate(Map<String,?> root,
                     Map<AliasPrototype,? extends Alias> aliasMap,
                     AliasPrototype prototype)
              throws GeneratorException
Throws:
GeneratorException

generate

protected void generate(Map<String,?> map,
                        String templateName,
                        Type type)
                 throws GeneratorException
Generates the source code of a type using a template.

Parameters:
map - a map containg properties.
templateName - the name of the velocity template.
type - the generated type.
Throws:
GeneratorException