org.ourgrid.common.spec
Interface CompilerModulesFactory

All Known Implementing Classes:
CommonCModulesFactory

public interface CompilerModulesFactory

Is a central factory for the compiler modules.


Method Summary
 LexicalAnalyzer createLexicalAnalyzer(java.lang.String sourceFile)
          Makes an instance of the Lexical Module.
 SemanticAnalyzer createSemanticAnalyzer(SemanticActions actionsContainer)
          Makes an instance of the Syntactical Module.
 SyntacticalAnalyzer createSyntacticalAnalyzer(LexicalAnalyzer lexicalAnalyzer, Grammar languageGrammar, SemanticAnalyzer semantic)
          Makes an instance of the Syntactical Module.
 

Method Detail

createLexicalAnalyzer

LexicalAnalyzer createLexicalAnalyzer(java.lang.String sourceFile)
                                      throws LexicalException
Makes an instance of the Lexical Module.

Parameters:
sourceFile - The file constaining the source to be compiled.
Returns:
A instance of the LexicalAnalyzer entity.
Throws:
LexicalException - If happens some problem at the creations process, for example, the file could not be found.

createSyntacticalAnalyzer

SyntacticalAnalyzer createSyntacticalAnalyzer(LexicalAnalyzer lexicalAnalyzer,
                                              Grammar languageGrammar,
                                              SemanticAnalyzer semantic)
                                              throws SyntacticalException
Makes an instance of the Syntactical Module.

Parameters:
lexicalAnalyzer - The lexical module that will give tokens to this module.
languageGrammar - The grammar entity that knows how is the language.
semantic - The semanic module that will execute with the compilation. Can be null if there is no intention of run it.
Returns:
A instance of the SyntacticalAnalyzer entity.
Throws:
SyntacticalException - If happens some problem at the creations process.

createSemanticAnalyzer

SemanticAnalyzer createSemanticAnalyzer(SemanticActions actionsContainer)
                                        throws SemanticException
Makes an instance of the Syntactical Module.

Parameters:
actionsContainer - The class that has the actions to be executed by introspection.
Returns:
A instance of the SemanticalAnalyzer entity.
Throws:
SemanticException - If happens some problem at the creations process.