org.ourgrid.common.spec
Class CommonCModulesFactory

java.lang.Object
  extended by org.ourgrid.common.spec.CommonCModulesFactory
All Implemented Interfaces:
CompilerModulesFactory

public class CommonCModulesFactory
extends java.lang.Object
implements CompilerModulesFactory

See Also:
CompilerModulesFactory

Constructor Summary
CommonCModulesFactory()
          The constructor.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonCModulesFactory

public CommonCModulesFactory()
The constructor.

Method Detail

createLexicalAnalyzer

public LexicalAnalyzer createLexicalAnalyzer(java.lang.String sourceFile)
                                      throws LexicalException
Description copied from interface: CompilerModulesFactory
Makes an instance of the Lexical Module.

Specified by:
createLexicalAnalyzer in interface CompilerModulesFactory
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.
See Also:
CompilerModulesFactory.createLexicalAnalyzer(String)

createSyntacticalAnalyzer

public SyntacticalAnalyzer createSyntacticalAnalyzer(LexicalAnalyzer lexicalAnalyzer,
                                                     Grammar languageGrammar,
                                                     SemanticAnalyzer semantic)
                                              throws SyntacticalException
Description copied from interface: CompilerModulesFactory
Makes an instance of the Syntactical Module.

Specified by:
createSyntacticalAnalyzer in interface CompilerModulesFactory
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.
See Also:
CompilerModulesFactory.createSyntacticalAnalyzer(org.ourgrid.common.spec.lexical.LexicalAnalyzer, org.ourgrid.common.spec.grammar.Grammar, org.ourgrid.common.spec.semantic.SemanticAnalyzer)

createSemanticAnalyzer

public SemanticAnalyzer createSemanticAnalyzer(SemanticActions actionsContainer)
                                        throws SemanticException
Description copied from interface: CompilerModulesFactory
Makes an instance of the Syntactical Module.

Specified by:
createSemanticAnalyzer in interface CompilerModulesFactory
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.
See Also:
CompilerModulesFactory.createSemanticAnalyzer(org.ourgrid.common.spec.semantic.SemanticActions)