Class CelParser
java.lang.Object
com.google.mu.cel.CelParser
Parser for Common Expression Language (CEL) syntax, producing
CelExpr AST records.
Use this parser if pattern matching over records (as opposed to protos) is desirable to your use case. It's also about 2x faster than ANTLR-based cel-java parser (as benchmarks show).
- Since:
- 10.7
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionParses the given CEL expression.com.google.api.expr.v1alpha1.ParsedExprparseToProto(String input) Parses the CEL expression and converts it to aParsedExprproto.
-
Constructor Details
-
CelParser
public CelParser()
-
-
Method Details
-
parse
-
parseToProto
Parses the CEL expression and converts it to aParsedExprproto.The returned
ParsedExpr.getSourceInfo()will havepositions,line_offsetsandmacro_callspopulated. The caller can also populate the other fields likelocationandsyntax_versionif such information is available.
-