Package codeanalysis

Class Compilation

java.lang.Object
codeanalysis.Compilation

public class Compilation extends Object
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 Details

    • Compilation

      public Compilation(SyntaxTree syntaxTree)
      Constructs a Compilation object with the specified syntax tree.
      Parameters:
      syntaxTree - The syntax tree representing the code to be compiled.
  • Method Details

    • getSyntaxTree

      public SyntaxTree getSyntaxTree()
      Gets the syntax tree associated with this compilation.
      Returns:
      The syntax tree.
    • evaluate

      public EvaluationResult evaluate(Map<VariableSymbol,Object> variables) throws Exception
      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.