|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object orc.OrcCompiler
public class OrcCompiler
Provides Orc's compilation functions.
To use, construct with an Orc config, then invoke call()
Constructor Summary | |
---|---|
OrcCompiler(Config config)
Constructs an object of class OrcCompiler. |
Method Summary | |
---|---|
Expression |
call()
Run the compiler, using the configuration supplied to the constructor. |
Expression |
compileAstToOil(ASTNode astRoot)
Translate an Orc extended AST into an OIL AST |
Expression |
loadOil(java.io.Reader oilReader)
Read an OIL file into an OIL AST and resolve the sites. |
ASTNode |
parse(java.io.Reader sourceReader)
Parse the Orc program text supplied by the reader into an Orc extended AST. |
protected Expression |
refineOilAfterCompileBeforeSave(Expression oilAst)
Subclass hook for modifying the OIL AST before it is saved to an OIL XML file and before the OIL AST is run. |
protected Expression |
refineOilAfterLoadSaveBeforeDag(Expression oilAst)
Subclass hook for modifying the OIL AST after it is loaded from an OIL XML file (or generated from source code) and before the OIL AST is run. |
void |
saveOil(Expression oilAst,
java.io.Writer oilWriter)
Write an OIL AST into an OIL file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OrcCompiler(Config config)
config
- The Orc configuration to use for compilationMethod Detail |
---|
public Expression call() throws java.io.IOException
call
in interface java.util.concurrent.Callable<Expression>
java.io.IOException
Callable.call()
public ASTNode parse(java.io.Reader sourceReader) throws ParsingException, java.io.IOException
sourceReader
- Reader that supplies the Orc source program text
ParsingException
- If the text could not be successfully parsed
java.io.IOException
- If an include file could not be readpublic Expression compileAstToOil(ASTNode astRoot) throws CompilationException
astRoot
- Root node of the Orc extended AST
CompilationException
- If the AST contains compilation errorspublic Expression loadOil(java.io.Reader oilReader) throws java.io.IOException, CompilationException
oilReader
- Reader supplying the OIL file to be loaded
java.io.IOException
- If the file could not be read
CompilationException
- If the sites on the OIL could not be resolvedpublic void saveOil(Expression oilAst, java.io.Writer oilWriter) throws CompilationException
oilAst
- OIL AST to be savedoilWriter
- Destination for OIL file
CompilationException
- If the OIL AST could not be marshaled for savingprotected Expression refineOilAfterCompileBeforeSave(Expression oilAst)
oilAst
- OIL AST generated from Orc source text
protected Expression refineOilAfterLoadSaveBeforeDag(Expression oilAst)
oilAst
- OIL AST read from file or compiled from text
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |