antlr

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LoggerV3 is a logrus instance twith default fields for grule
	LoggerV3 = logger.Log.WithFields(logrus.Fields{
		"lib":    "grule",
		"struct": "GruleParserV3Listener",
	})
)

Functions

This section is empty.

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

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

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

NewGruleV3ParserListener create new instance of GruleV3ParserListener

func (*GruleV3ParserListener) EnterAddMinusOperators

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

EnterAddMinusOperators is called when production addMinusOperators is entered.

func (*GruleV3ParserListener) EnterAndLogicOperator

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

EnterAndLogicOperator is called when production andLogicOperator is entered.

func (*GruleV3ParserListener) EnterArgumentList

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

EnterArgumentList is called when production argumentList is entered.

func (*GruleV3ParserListener) EnterArrayMapSelector

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

EnterArrayMapSelector is called when production arrayMapSelector is entered.

func (*GruleV3ParserListener) EnterAssignment

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

EnterAssignment is called when production assignment is entered.

func (*GruleV3ParserListener) EnterBooleanLiteral

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

EnterBooleanLiteral is called when production booleanLiteral is entered.

func (*GruleV3ParserListener) EnterComparisonOperator

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

EnterComparisonOperator is called when production comparisonOperator is entered.

func (*GruleV3ParserListener) EnterConstant

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

EnterConstant is called when production constant is entered.

func (*GruleV3ParserListener) EnterEveryRule

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

EnterEveryRule is called when any rule is entered.

func (*GruleV3ParserListener) EnterExpression

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

EnterExpression is called when production expression is entered.

func (*GruleV3ParserListener) EnterExpressionAtom

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

EnterExpressionAtom is called when production expressionAtom is entered.

func (*GruleV3ParserListener) EnterFloatLiteral

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

EnterFloatLiteral is called when production floatLiteral is entered.

func (*GruleV3ParserListener) EnterFunctionCall

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

EnterFunctionCall is called when production functionCall is entered.

func (*GruleV3ParserListener) EnterGrl

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

EnterGrl is called when production grl is entered.

func (*GruleV3ParserListener) EnterIntegerLiteral

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

EnterIntegerLiteral is called when production integerLiteral is entered.

func (*GruleV3ParserListener) EnterMemberVariable

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

EnterMemberVariable is called when production memberVariable is entered.

func (*GruleV3ParserListener) EnterMulDivOperators

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

EnterMulDivOperators is called when production mulDivOperators is entered.

func (*GruleV3ParserListener) EnterOrLogicOperator

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

EnterOrLogicOperator is called when production orLogicOperator is entered.

func (*GruleV3ParserListener) EnterRuleEntry

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

EnterRuleEntry is called when production ruleEntry is entered.

func (*GruleV3ParserListener) EnterSalience

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

EnterSalience is called when production salience is entered.

func (*GruleV3ParserListener) EnterStringLiteral

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

EnterStringLiteral is called when production stringLiteral is entered.

func (*GruleV3ParserListener) EnterThenExpression

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

EnterThenExpression is called when production thenExpression is entered.

func (*GruleV3ParserListener) EnterThenExpressionList

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

EnterThenExpressionList is called when production thenExpressionList is entered.

func (*GruleV3ParserListener) EnterThenScope

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

EnterThenScope is called when production thenScope is entered.

func (*GruleV3ParserListener) EnterVariable

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

EnterVariable is called when production variable is entered.

func (*GruleV3ParserListener) EnterWhenScope

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

EnterWhenScope is called when production whenScope is entered.

func (*GruleV3ParserListener) ExitAddMinusOperators

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

ExitAddMinusOperators is called when production addMinusOperators is exited.

func (*GruleV3ParserListener) ExitAndLogicOperator

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

ExitAndLogicOperator is called when production andLogicOperator is exited.

func (*GruleV3ParserListener) ExitArgumentList

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

ExitArgumentList is called when production argumentList is exited.

func (*GruleV3ParserListener) ExitArrayMapSelector

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

ExitArrayMapSelector is called when production arrayMapSelector is exited.

func (*GruleV3ParserListener) ExitAssignment

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

ExitAssignment is called when production assignment is exited.

func (*GruleV3ParserListener) ExitBooleanLiteral

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

ExitBooleanLiteral is called when production booleanLiteral is exited.

func (*GruleV3ParserListener) ExitComparisonOperator

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

ExitComparisonOperator is called when production comparisonOperator is exited.

func (*GruleV3ParserListener) ExitConstant

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

ExitConstant is called when production constant is exited.

func (*GruleV3ParserListener) ExitEveryRule

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

ExitEveryRule is called when any rule is exited.

func (*GruleV3ParserListener) ExitExpression

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

ExitExpression is called when production expression is exited.

func (*GruleV3ParserListener) ExitExpressionAtom

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

ExitExpressionAtom is called when production expressionAtom is exited.

func (*GruleV3ParserListener) ExitFloatLiteral

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

ExitFloatLiteral is called when production floatLiteral is exited.

func (*GruleV3ParserListener) ExitFunctionCall

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

ExitFunctionCall is called when production functionCall is exited.

func (*GruleV3ParserListener) ExitGrl

func (s *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

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

ExitIntegerLiteral is called when production integerLiteral is exited.

func (*GruleV3ParserListener) ExitMemberVariable

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

ExitMemberVariable is called when production memberVariable is exited.

func (*GruleV3ParserListener) ExitMulDivOperators

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

ExitMulDivOperators is called when production mulDivOperators is exited.

func (*GruleV3ParserListener) ExitOrLogicOperator

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

ExitOrLogicOperator is called when production orLogicOperator is exited.

func (*GruleV3ParserListener) ExitRuleEntry

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

ExitRuleEntry is called when production ruleEntry is exited.

func (*GruleV3ParserListener) ExitSalience

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

ExitSalience is called when production salience is exited.

func (*GruleV3ParserListener) ExitStringLiteral

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

ExitStringLiteral is called when production stringLiteral is exited.

func (*GruleV3ParserListener) ExitThenExpression

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

ExitThenExpression is called when production thenExpression is exited.

func (*GruleV3ParserListener) ExitThenExpressionList

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

ExitThenExpressionList is called when production thenExpressionList is exited.

func (*GruleV3ParserListener) ExitThenScope

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

ExitThenScope is called when production thenScope is exited.

func (*GruleV3ParserListener) ExitVariable

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

ExitVariable is called when production variable is exited.

func (*GruleV3ParserListener) ExitWhenScope

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

ExitWhenScope is called when production whenScope is exited.

func (*GruleV3ParserListener) VisitErrorNode

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

VisitErrorNode is called when an error node is visited.

func (*GruleV3ParserListener) VisitTerminal

func (s *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