aspoev.vejal.generator
Class VejalCompiler

java.lang.Object
  extended byaspoev.vejal.generator.VejalCompiler

public class VejalCompiler
extends java.lang.Object

This class creates a Java and Jasmine representation for Vejal types. Vejal types must be compiled prior to instantiation. However, purely procedural code does not need to be compiled, as long as it has no heap storage requirements.


Field Summary
protected static java.lang.String directory
           
 
Constructor Summary
VejalCompiler()
           
 
Method Summary
protected static void buildGeneratedObjects(java.lang.String dir)
          To be called after all dependent objects are generated from meta-data.
static void buildODQL(java.lang.String dir, java.lang.String name)
          Register the ODQL file with the Jasmine ODQL interpreter.
static void compileList(java.io.File listFile)
          Compile a list of Vejal files.
static java.lang.String compileObjectSlice(TypeReferenceElement one, TypeReferenceElement two)
          Creates an object slice for the two types, i.e.
static ClassDeclarationElement createSliceClass(TypeComparator comparator)
           
static void main(java.lang.String[] args)
          Runs the compiler.
protected static ClassDeclarationElement parseFile(java.io.File file)
           
protected static void populateSchema(ClassDeclarationElement classDecl)
           
protected static void printHelp()
          Prints compiler instructions.
static void processClassDeclaration(ClassDeclarationElement classDecl)
          Compile the argument class declaration.
protected static boolean processJavaObject(java.lang.String outputDirectory, java.lang.String files)
           
protected static void registerClass(ClassDeclarationElement decl)
           
static java.lang.String renderClass(ClassDeclarationElement decl)
          Renders the Vejal class declaration in Java.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

directory

protected static java.lang.String directory
Constructor Detail

VejalCompiler

public VejalCompiler()
Method Detail

main

public static void main(java.lang.String[] args)
Runs the compiler.


buildGeneratedObjects

protected static void buildGeneratedObjects(java.lang.String dir)
To be called after all dependent objects are generated from meta-data.


buildODQL

public static void buildODQL(java.lang.String dir,
                             java.lang.String name)
Register the ODQL file with the Jasmine ODQL interpreter.


compileList

public static void compileList(java.io.File listFile)
                        throws java.lang.Exception
Compile a list of Vejal files.

Throws:
java.lang.Exception

compileObjectSlice

public static java.lang.String compileObjectSlice(TypeReferenceElement one,
                                                  TypeReferenceElement two)
Creates an object slice for the two types, i.e. to store the fields which are present in the second type but not in the first. A slice has no defining ClassDeclarationElement. At the moment, it is derived from the field differences between the two supplied types. If slice does not exist, generate it. If it does exist, exit.


createSliceClass

public static ClassDeclarationElement createSliceClass(TypeComparator comparator)

parseFile

protected static ClassDeclarationElement parseFile(java.io.File file)

populateSchema

protected static void populateSchema(ClassDeclarationElement classDecl)

processClassDeclaration

public static void processClassDeclaration(ClassDeclarationElement classDecl)
Compile the argument class declaration.


processJavaObject

protected static boolean processJavaObject(java.lang.String outputDirectory,
                                           java.lang.String files)

registerClass

protected static void registerClass(ClassDeclarationElement decl)

renderClass

public static java.lang.String renderClass(ClassDeclarationElement decl)
Renders the Vejal class declaration in Java. Returns the names of the Java classes it creates (class*es* because it might need to create the base class for all versions of the type.)


printHelp

protected static void printHelp()
Prints compiler instructions.