antlr

package
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2024 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// LoggerV3 is a logger instance twith default fields for grule
	LoggerV3 = logger.Log.WithFields(loggerV3Fields)
)

Functions

func SetLogger added in v1.11.0

func SetLogger(log interface{})

SetLogger changes default logger on external

Types

type GruleParser

type GruleParser struct {
}

GruleParser will act as a lexer and parser for Grule antlr syntax. Right now this parser is empty parsing is only for test purpose in test go file.

type GruleV3ParserListener added in v1.7.0

type GruleV3ParserListener struct {
	grulev3.Basegrulev3Listener
	PreviousNode []string

	Grl           *ast.Grl
	Stack         *stack
	StopParse     bool
	ErrorCallback *pkg.GruleErrorReporter
	KnowledgeBase *ast.KnowledgeBase
}

GruleV3ParserListener is an implementation of logic to build the execution flow or execution graph as it defined within the knowledge base.

func NewGruleV3ParserListener added in v1.7.0

func NewGruleV3ParserListener(KnowledgeBase *ast.KnowledgeBase, errorCallBack *pkg.GruleErrorReporter) *GruleV3ParserListener

NewGruleV3ParserListener create new instance of GruleV3ParserListener

func (*GruleV3ParserListener) EnterAddMinusOperators added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterAddMinusOperators(ctx *grulev3.AddMinusOperatorsContext)

EnterAddMinusOperators is called when production addMinusOperators is entered.

func (*GruleV3ParserListener) EnterAndLogicOperator added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterAndLogicOperator(ctx *grulev3.AndLogicOperatorContext)

EnterAndLogicOperator is called when production andLogicOperator is entered.

func (*GruleV3ParserListener) EnterArgumentList added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterArgumentList(ctx *grulev3.ArgumentListContext)

EnterArgumentList is called when production argumentList is entered.

func (*GruleV3ParserListener) EnterArrayMapSelector added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterArrayMapSelector(ctx *grulev3.ArrayMapSelectorContext)

EnterArrayMapSelector is called when production arrayMapSelector is entered.

func (*GruleV3ParserListener) EnterAssignment added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterAssignment(ctx *grulev3.AssignmentContext)

EnterAssignment is called when production assignment is entered.

func (*GruleV3ParserListener) EnterBooleanLiteral added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterBooleanLiteral(ctx *grulev3.BooleanLiteralContext)

EnterBooleanLiteral is called when production booleanLiteral is entered.

func (*GruleV3ParserListener) EnterComparisonOperator added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterComparisonOperator(ctx *grulev3.ComparisonOperatorContext)

EnterComparisonOperator is called when production comparisonOperator is entered.

func (*GruleV3ParserListener) EnterConstant added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterConstant(ctx *grulev3.ConstantContext)

EnterConstant is called when production constant is entered.

func (*GruleV3ParserListener) EnterEveryRule added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterEveryRule(ctx antlr.ParserRuleContext)

EnterEveryRule is called when any rule is entered.

func (*GruleV3ParserListener) EnterExpression added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterExpression(ctx *grulev3.ExpressionContext)

EnterExpression is called when production expression is entered.

func (*GruleV3ParserListener) EnterExpressionAtom added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterExpressionAtom(ctx *grulev3.ExpressionAtomContext)

EnterExpressionAtom is called when production expressionAtom is entered.

func (*GruleV3ParserListener) EnterFloatLiteral added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterFloatLiteral(ctx *grulev3.FloatLiteralContext)

EnterFloatLiteral is called when production floatLiteral is entered.

func (*GruleV3ParserListener) EnterFunctionCall added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterFunctionCall(ctx *grulev3.FunctionCallContext)

EnterFunctionCall is called when production functionCall is entered.

func (*GruleV3ParserListener) EnterGrl added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterGrl(ctx *grulev3.GrlContext)

EnterGrl is called when production grl is entered.

func (*GruleV3ParserListener) EnterIntegerLiteral added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterIntegerLiteral(ctx *grulev3.IntegerLiteralContext)

EnterIntegerLiteral is called when production integerLiteral is entered.

func (*GruleV3ParserListener) EnterMemberVariable added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterMemberVariable(ctx *grulev3.MemberVariableContext)

EnterMemberVariable is called when production memberVariable is entered.

func (*GruleV3ParserListener) EnterMulDivOperators added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterMulDivOperators(ctx *grulev3.MulDivOperatorsContext)

EnterMulDivOperators is called when production mulDivOperators is entered.

func (*GruleV3ParserListener) EnterOrLogicOperator added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterOrLogicOperator(ctx *grulev3.OrLogicOperatorContext)

EnterOrLogicOperator is called when production orLogicOperator is entered.

func (*GruleV3ParserListener) EnterRuleEntry added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterRuleEntry(ctx *grulev3.RuleEntryContext)

EnterRuleEntry is called when production ruleEntry is entered.

func (*GruleV3ParserListener) EnterSalience added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterSalience(ctx *grulev3.SalienceContext)

EnterSalience is called when production salience is entered.

func (*GruleV3ParserListener) EnterStringLiteral added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterStringLiteral(ctx *grulev3.StringLiteralContext)

EnterStringLiteral is called when production stringLiteral is entered.

func (*GruleV3ParserListener) EnterThenExpression added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterThenExpression(ctx *grulev3.ThenExpressionContext)

EnterThenExpression is called when production thenExpression is entered.

func (*GruleV3ParserListener) EnterThenExpressionList added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterThenExpressionList(ctx *grulev3.ThenExpressionListContext)

EnterThenExpressionList is called when production thenExpressionList is entered.

func (*GruleV3ParserListener) EnterThenScope added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterThenScope(ctx *grulev3.ThenScopeContext)

EnterThenScope is called when production thenScope is entered.

func (*GruleV3ParserListener) EnterVariable added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterVariable(ctx *grulev3.VariableContext)

EnterVariable is called when production variable is entered.

func (*GruleV3ParserListener) EnterWhenScope added in v1.7.0

func (thisListener *GruleV3ParserListener) EnterWhenScope(ctx *grulev3.WhenScopeContext)

EnterWhenScope is called when production whenScope is entered.

func (*GruleV3ParserListener) ExitAddMinusOperators added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitAddMinusOperators(ctx *grulev3.AddMinusOperatorsContext)

ExitAddMinusOperators is called when production addMinusOperators is exited.

func (*GruleV3ParserListener) ExitAndLogicOperator added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitAndLogicOperator(ctx *grulev3.AndLogicOperatorContext)

ExitAndLogicOperator is called when production andLogicOperator is exited.

func (*GruleV3ParserListener) ExitArgumentList added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitArgumentList(ctx *grulev3.ArgumentListContext)

ExitArgumentList is called when production argumentList is exited.

func (*GruleV3ParserListener) ExitArrayMapSelector added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitArrayMapSelector(ctx *grulev3.ArrayMapSelectorContext)

ExitArrayMapSelector is called when production arrayMapSelector is exited.

func (*GruleV3ParserListener) ExitAssignment added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitAssignment(ctx *grulev3.AssignmentContext)

ExitAssignment is called when production assignment is exited.

func (*GruleV3ParserListener) ExitBooleanLiteral added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitBooleanLiteral(ctx *grulev3.BooleanLiteralContext)

ExitBooleanLiteral is called when production booleanLiteral is exited.

func (*GruleV3ParserListener) ExitComparisonOperator added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitComparisonOperator(ctx *grulev3.ComparisonOperatorContext)

ExitComparisonOperator is called when production comparisonOperator is exited.

func (*GruleV3ParserListener) ExitConstant added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitConstant(ctx *grulev3.ConstantContext)

ExitConstant is called when production constant is exited.

func (*GruleV3ParserListener) ExitEveryRule added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitEveryRule(ctx antlr.ParserRuleContext)

ExitEveryRule is called when any rule is exited.

func (*GruleV3ParserListener) ExitExpression added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitExpression(ctx *grulev3.ExpressionContext)

ExitExpression is called when production expression is exited.

func (*GruleV3ParserListener) ExitExpressionAtom added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitExpressionAtom(ctx *grulev3.ExpressionAtomContext)

ExitExpressionAtom is called when production expressionAtom is exited.

func (*GruleV3ParserListener) ExitFloatLiteral added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitFloatLiteral(ctx *grulev3.FloatLiteralContext)

ExitFloatLiteral is called when production floatLiteral is exited.

func (*GruleV3ParserListener) ExitFunctionCall added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitFunctionCall(ctx *grulev3.FunctionCallContext)

ExitFunctionCall is called when production functionCall is exited.

func (*GruleV3ParserListener) ExitGrl added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitGrl(ctx *grulev3.GrlContext)

ExitGrl is called when production root is exited. The listener will instruct working memory re-index here.

func (*GruleV3ParserListener) ExitIntegerLiteral added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitIntegerLiteral(ctx *grulev3.IntegerLiteralContext)

ExitIntegerLiteral is called when production integerLiteral is exited.

func (*GruleV3ParserListener) ExitMemberVariable added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitMemberVariable(ctx *grulev3.MemberVariableContext)

ExitMemberVariable is called when production memberVariable is exited.

func (*GruleV3ParserListener) ExitMulDivOperators added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitMulDivOperators(ctx *grulev3.MulDivOperatorsContext)

ExitMulDivOperators is called when production mulDivOperators is exited.

func (*GruleV3ParserListener) ExitOrLogicOperator added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitOrLogicOperator(ctx *grulev3.OrLogicOperatorContext)

ExitOrLogicOperator is called when production orLogicOperator is exited.

func (*GruleV3ParserListener) ExitRuleEntry added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitRuleEntry(ctx *grulev3.RuleEntryContext)

ExitRuleEntry is called when production ruleEntry is exited.

func (*GruleV3ParserListener) ExitSalience added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitSalience(ctx *grulev3.SalienceContext)

ExitSalience is called when production salience is exited.

func (*GruleV3ParserListener) ExitStringLiteral added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitStringLiteral(ctx *grulev3.StringLiteralContext)

ExitStringLiteral is called when production stringLiteral is exited.

func (*GruleV3ParserListener) ExitThenExpression added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitThenExpression(ctx *grulev3.ThenExpressionContext)

ExitThenExpression is called when production thenExpression is exited.

func (*GruleV3ParserListener) ExitThenExpressionList added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitThenExpressionList(ctx *grulev3.ThenExpressionListContext)

ExitThenExpressionList is called when production thenExpressionList is exited.

func (*GruleV3ParserListener) ExitThenScope added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitThenScope(ctx *grulev3.ThenScopeContext)

ExitThenScope is called when production thenScope is exited.

func (*GruleV3ParserListener) ExitVariable added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitVariable(ctx *grulev3.VariableContext)

ExitVariable is called when production variable is exited.

func (*GruleV3ParserListener) ExitWhenScope added in v1.7.0

func (thisListener *GruleV3ParserListener) ExitWhenScope(ctx *grulev3.WhenScopeContext)

ExitWhenScope is called when production whenScope is exited.

func (*GruleV3ParserListener) VisitErrorNode added in v1.7.0

func (thisListener *GruleV3ParserListener) VisitErrorNode(node antlr.ErrorNode)

VisitErrorNode is called when an error node is visited.

func (*GruleV3ParserListener) VisitTerminal added in v1.7.0

func (thisListener *GruleV3ParserListener) VisitTerminal(node antlr.TerminalNode)

VisitTerminal is called when a terminal node is visited.

Directories

Path Synopsis
parser

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL