Class CelMacroExprFactory


  • public abstract class CelMacroExprFactory
    extends CelExprFactory
    Assists with the expansion of CelMacro in a manner which is consistent with the source position and expression ID generation code leveraged by both the parser and type-checker.
    • Method Detail

      • reportError

        @FormatMethod
        public final dev.cel.common.ast.CelExpr reportError​(@FormatString
                                                            java.lang.String format,
                                                            java.lang.Object... args)
        Creates a CelIssue and reports it, returning a sentinel CelExpr that indicates an error.
      • reportError

        public final dev.cel.common.ast.CelExpr reportError​(java.lang.String message)
        Creates a CelIssue and reports it, returning a sentinel CelExpr that indicates an error.
      • reportError

        public abstract dev.cel.common.ast.CelExpr reportError​(CelIssue error)
        Reports a CelIssue and returns a sentinel CelExpr that indicates an error.
      • getAccumulatorVarName

        public abstract java.lang.String getAccumulatorVarName()
        Returns the default accumulator variable name used by macros implementing comprehensions.
      • getSourceLocation

        public final dev.cel.common.CelSourceLocation getSourceLocation​(dev.cel.common.ast.CelExpr expr)
        Retrieves the source location for the given CelExpr ID.
      • copy

        public final dev.cel.common.ast.CelExpr copy​(dev.cel.common.ast.CelExpr expr)
        Duplicates CelExpr with 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 dev.cel.common.CelSourceLocation getSourceLocation​(long exprId)
        Retrieves the source location for the given CelExpr ID.
      • currentSourceLocationForMacro

        protected abstract dev.cel.common.CelSourceLocation currentSourceLocationForMacro()
        Returns the current (last known) source location. This should only be used for macros.