public class Compiler extends Object
Compiles AST into execution plan, performing type checks.
| Constructor and Description |
|---|
Compiler(ClassDescriberRepository classRepository,
ClassResolver classResolver,
Scope scope) |
| Modifier and Type | Method and Description |
|---|---|
TypedPlan |
compile(Expr expr)
Compiles AST of expression into execution plan.
|
TypedPlan |
compile(Expr expr,
ValueType type)
Compiles AST of expression to execution plan.
|
TypedPlan |
compileLambda(Expr expr,
GenericClass cls) |
List<Diagnostic> |
getDiagnostics() |
boolean |
wasSuccessful() |
public Compiler(ClassDescriberRepository classRepository, ClassResolver classResolver, Scope scope)
public TypedPlan compile(Expr expr)
Compiles AST of expression into execution plan. Equivalent to compile(expr, null).
expr - expression AST to compile.public TypedPlan compile(Expr expr, ValueType type)
Compiles AST of expression to execution plan. If during compilation there were type errors,
wasSuccessful() method will return false and getDiagnostics() will
return the full list of found errors. Tries to implicitly cast expression result to the given type,
if specified. If this cast is unsuccessful, compiler reports type error.
expr - expression AST to compile.type - if not null, compiler will try to cast expression result to this type.public TypedPlan compileLambda(Expr expr, GenericClass cls)
public List<Diagnostic> getDiagnostics()
public boolean wasSuccessful()
Copyright © 2019. All rights reserved.