Package gorsat.parser

Class CalcCompiler

java.lang.Object
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor<T>
org.gorpipe.gor.GorScriptBaseVisitor<gorsat.parser.TypedCalcLambda>
gorsat.parser.CalcCompiler
All Implemented Interfaces:
org.antlr.v4.runtime.tree.ParseTreeVisitor<gorsat.parser.TypedCalcLambda>, GorScriptVisitor<gorsat.parser.TypedCalcLambda>

public class CalcCompiler
extends GorScriptBaseVisitor<gorsat.parser.TypedCalcLambda>
CalcCompiler implements an Antlr parse tree visitor, starting on an expression node. It builds up a TypedCalcLambda along the way, collapsing constant expressions into constants, otherwise a lambda taking a ColumnValueProvider as an argument. To use the CalcCompiler, construct a parse tree with GorScriptParser - this is also done by SyntaxChecker. Then call setColumnNamesAndTypes to inform the compiler of available variables before passing the compiler to the accept method of the parse tree node.