Package codeanalysis
Class Compilation
java.lang.Object
codeanalysis.Compilation
The Compilation class represents a compilation unit in the code analysis process.
It encapsulates a syntax tree and provides methods for evaluating the syntax tree and obtaining the result.
- Version:
- 1.0
- Author:
- Siyabend Urun
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCompilation(SyntaxTree syntaxTree) Constructs a Compilation object with the specified syntax tree. -
Method Summary
Modifier and TypeMethodDescriptionevaluate(Map<VariableSymbol, Object> variables) Evaluates the syntax tree and returns the evaluation result.Gets the syntax tree associated with this compilation.
-
Constructor Details
-
Compilation
Constructs a Compilation object with the specified syntax tree.- Parameters:
syntaxTree- The syntax tree representing the code to be compiled.
-
-
Method Details
-
getSyntaxTree
Gets the syntax tree associated with this compilation.- Returns:
- The syntax tree.
-
evaluate
Evaluates the syntax tree and returns the evaluation result.- Parameters:
variables- The variables to be used during the evaluation process.- Returns:
- The evaluation result.
- Throws:
Exception- if an error occurs during the evaluation process.
-