Package dev.cel.common
Class CelProtoAbstractSyntaxTree
- java.lang.Object
-
- dev.cel.common.CelProtoAbstractSyntaxTree
-
public final class CelProtoAbstractSyntaxTree extends java.lang.ObjectAn Adapter forCelAbstractSyntaxTreeconstructed from Canonical Protos ofCheckedExprorParsedExprexpressions.Note: Keep this file in sync with
CelProtoV1Alpha1AbstractSyntaxTree
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CelProtoAbstractSyntaxTreefromCelAst(CelAbstractSyntaxTree ast)Constructs CelProtoAbstractSyntaxTree fromCelAbstractSyntaxTree.static CelProtoAbstractSyntaxTreefromCheckedExpr(CheckedExpr checkedExpr)Construct an abstract syntax tree from aCheckedExpr.static CelProtoAbstractSyntaxTreefromParsedExpr(ParsedExpr parsedExpr)Construct an abstract syntax tree from aParsedExpr.CelAbstractSyntaxTreegetAst()Returns the native representation of the abstract syntax tree:CelAbstractSyntaxTree.ExprgetExpr()Returns the underlyingExprrepresentation of the abstract syntax tree.TypegetProtoResultType()For a type checked abstract syntax tree the resulting type is returned in proto format described in checked.proto.SourceInfogetSourceInfo()Returns the underlyingSourceInforepresentation of the abstract syntax tree.booleanisChecked()Tests whether the underlying abstract syntax tree has been type checked or not.CheckedExprtoCheckedExpr()Returns the underlyingCheckedExprrepresentation of the abstract syntax tree.ParsedExprtoParsedExpr()Returns the underlyingParsedExprrepresentation of the abstract syntax tree.
-
-
-
Method Detail
-
fromCheckedExpr
public static CelProtoAbstractSyntaxTree fromCheckedExpr(CheckedExpr checkedExpr)
Construct an abstract syntax tree from aCheckedExpr.
-
fromParsedExpr
public static CelProtoAbstractSyntaxTree fromParsedExpr(ParsedExpr parsedExpr)
Construct an abstract syntax tree from aParsedExpr.
-
fromCelAst
public static CelProtoAbstractSyntaxTree fromCelAst(CelAbstractSyntaxTree ast)
Constructs CelProtoAbstractSyntaxTree fromCelAbstractSyntaxTree.
-
isChecked
public boolean isChecked()
Tests whether the underlying abstract syntax tree has been type checked or not.
-
getAst
@CheckReturnValue public CelAbstractSyntaxTree getAst()
Returns the native representation of the abstract syntax tree:CelAbstractSyntaxTree.
-
getExpr
@CheckReturnValue public Expr getExpr()
Returns the underlyingExprrepresentation of the abstract syntax tree.
-
toCheckedExpr
@CheckReturnValue public CheckedExpr toCheckedExpr()
Returns the underlyingCheckedExprrepresentation of the abstract syntax tree. ThrowsIllegalStateExceptionifCelAbstractSyntaxTree.isChecked()is false.
-
getSourceInfo
@CheckReturnValue public SourceInfo getSourceInfo()
Returns the underlyingSourceInforepresentation of the abstract syntax tree.
-
toParsedExpr
@CheckReturnValue public ParsedExpr toParsedExpr()
Returns the underlyingParsedExprrepresentation of the abstract syntax tree.
-
getProtoResultType
@CheckReturnValue public Type getProtoResultType()
For a type checked abstract syntax tree the resulting type is returned in proto format described in checked.proto. Otherwise, the dynamic type is returned.
-
-