Package dev.cel.parser
Class CelMacroExprFactory
- java.lang.Object
-
- dev.cel.common.ast.CelExprFactory
-
- dev.cel.parser.CelMacroExprFactory
-
public abstract class CelMacroExprFactory extends CelExprFactory
Assists with the expansion ofCelMacroin a manner which is consistent with the source position and expression ID generation code leveraged by both the parser and type-checker.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CelExprcopy(CelExpr expr)DuplicatesCelExprwith a brand new set of identifiers.protected abstract longcopyExprId(long id)Returns the next unique expression ID which is associated with the same metadata (i.e.protected abstract CelSourceLocationcurrentSourceLocationForMacro()Returns the current (last known) source location.abstract java.lang.StringgetAccumulatorVarName()Returns the default accumulator variable name used by macros implementing comprehensions.protected abstract CelSourceLocationgetSourceLocation(long exprId)Retrieves the source location for the givenCelExprID.CelSourceLocationgetSourceLocation(CelExpr expr)Retrieves the source location for the givenCelExprID.abstract CelExprreportError(CelIssue error)CelExprreportError(java.lang.String message)CelExprreportError(java.lang.String format, java.lang.Object... args)-
Methods inherited from class dev.cel.common.ast.CelExprFactory
fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, fold, maybeDeleteId, newBoolLiteral, newBytesLiteral, newBytesLiteral, newBytesLiteral, newBytesLiteral, newConstant, newDoubleLiteral, newGlobalCall, newGlobalCall, newIdentifier, newInstance, newIntLiteral, newList, newList, newMap, newMap, newMapEntry, newMessage, newMessage, newMessageField, newReceiverCall, newReceiverCall, newSelect, newStringLiteral, newUintLiteral, nextExprId
-
-
-
-
Method Detail
-
reportError
@FormatMethod public final CelExpr reportError(@FormatString java.lang.String format, java.lang.Object... args)
-
reportError
public final CelExpr reportError(java.lang.String message)
-
getAccumulatorVarName
public abstract java.lang.String getAccumulatorVarName()
Returns the default accumulator variable name used by macros implementing comprehensions.
-
getSourceLocation
public final CelSourceLocation getSourceLocation(CelExpr expr)
Retrieves the source location for the givenCelExprID.
-
copy
public final CelExpr copy(CelExpr expr)
DuplicatesCelExprwith a brand new set of identifiers.
-
copyExprId
protected abstract long copyExprId(long id)
Returns the next unique expression ID which is associated with the same metadata (i.e. source location, types, references, etc.) as `id`.
-
getSourceLocation
protected abstract CelSourceLocation getSourceLocation(long exprId)
Retrieves the source location for the givenCelExprID.
-
currentSourceLocationForMacro
protected abstract CelSourceLocation currentSourceLocationForMacro()
Returns the current (last known) source location. This should only be used for macros.
-
-