Documentation ¶
Index ¶
- Variables
- type GruleParser
- type GruleV2ParserListener
- func (s *GruleV2ParserListener) EnterAddMinusOperators(ctx *parser2.AddMinusOperatorsContext)
- func (s *GruleV2ParserListener) EnterAndLogicOperator(ctx *parser2.AndLogicOperatorContext)
- func (s *GruleV2ParserListener) EnterArgumentList(ctx *parser2.ArgumentListContext)
- func (s *GruleV2ParserListener) EnterAssignment(ctx *parser2.AssignmentContext)
- func (s *GruleV2ParserListener) EnterBooleanLiteral(ctx *parser2.BooleanLiteralContext)
- func (s *GruleV2ParserListener) EnterComparisonOperator(ctx *parser2.ComparisonOperatorContext)
- func (s *GruleV2ParserListener) EnterConstant(ctx *parser2.ConstantContext)
- func (s *GruleV2ParserListener) EnterDecimalLiteral(ctx *parser2.DecimalLiteralContext)
- func (s *GruleV2ParserListener) EnterEveryRule(ctx antlr.ParserRuleContext)
- func (s *GruleV2ParserListener) EnterExpression(ctx *parser2.ExpressionContext)
- func (s *GruleV2ParserListener) EnterExpressionAtom(ctx *parser2.ExpressionAtomContext)
- func (s *GruleV2ParserListener) EnterFunctionCall(ctx *parser2.FunctionCallContext)
- func (s *GruleV2ParserListener) EnterMethodCall(ctx *parser2.MethodCallContext)
- func (s *GruleV2ParserListener) EnterMulDivOperators(ctx *parser2.MulDivOperatorsContext)
- func (s *GruleV2ParserListener) EnterOrLogicOperator(ctx *parser2.OrLogicOperatorContext)
- func (s *GruleV2ParserListener) EnterRealLiteral(ctx *parser2.RealLiteralContext)
- func (s *GruleV2ParserListener) EnterRoot(ctx *parser2.RootContext)
- func (s *GruleV2ParserListener) EnterRuleDescription(ctx *parser2.RuleDescriptionContext)
- func (s *GruleV2ParserListener) EnterRuleEntry(ctx *parser2.RuleEntryContext)
- func (s *GruleV2ParserListener) EnterRuleName(ctx *parser2.RuleNameContext)
- func (s *GruleV2ParserListener) EnterSalience(ctx *parser2.SalienceContext)
- func (s *GruleV2ParserListener) EnterStringLiteral(ctx *parser2.StringLiteralContext)
- func (s *GruleV2ParserListener) EnterThenExpression(ctx *parser2.ThenExpressionContext)
- func (s *GruleV2ParserListener) EnterThenExpressionList(ctx *parser2.ThenExpressionListContext)
- func (s *GruleV2ParserListener) EnterThenScope(ctx *parser2.ThenScopeContext)
- func (s *GruleV2ParserListener) EnterVariable(ctx *parser2.VariableContext)
- func (s *GruleV2ParserListener) EnterWhenScope(ctx *parser2.WhenScopeContext)
- func (s *GruleV2ParserListener) ExitAddMinusOperators(ctx *parser2.AddMinusOperatorsContext)
- func (s *GruleV2ParserListener) ExitAndLogicOperator(ctx *parser2.AndLogicOperatorContext)
- func (s *GruleV2ParserListener) ExitArgumentList(ctx *parser2.ArgumentListContext)
- func (s *GruleV2ParserListener) ExitAssignment(ctx *parser2.AssignmentContext)
- func (s *GruleV2ParserListener) ExitBooleanLiteral(ctx *parser2.BooleanLiteralContext)
- func (s *GruleV2ParserListener) ExitComparisonOperator(ctx *parser2.ComparisonOperatorContext)
- func (s *GruleV2ParserListener) ExitConstant(ctx *parser2.ConstantContext)
- func (s *GruleV2ParserListener) ExitDecimalLiteral(ctx *parser2.DecimalLiteralContext)
- func (s *GruleV2ParserListener) ExitEveryRule(ctx antlr.ParserRuleContext)
- func (s *GruleV2ParserListener) ExitExpression(ctx *parser2.ExpressionContext)
- func (s *GruleV2ParserListener) ExitExpressionAtom(ctx *parser2.ExpressionAtomContext)
- func (s *GruleV2ParserListener) ExitFunctionCall(ctx *parser2.FunctionCallContext)
- func (s *GruleV2ParserListener) ExitMethodCall(ctx *parser2.MethodCallContext)
- func (s *GruleV2ParserListener) ExitMulDivOperators(ctx *parser2.MulDivOperatorsContext)
- func (s *GruleV2ParserListener) ExitOrLogicOperator(ctx *parser2.OrLogicOperatorContext)
- func (s *GruleV2ParserListener) ExitRealLiteral(ctx *parser2.RealLiteralContext)
- func (s *GruleV2ParserListener) ExitRoot(ctx *parser2.RootContext)
- func (s *GruleV2ParserListener) ExitRuleDescription(ctx *parser2.RuleDescriptionContext)
- func (s *GruleV2ParserListener) ExitRuleEntry(ctx *parser2.RuleEntryContext)
- func (s *GruleV2ParserListener) ExitRuleName(ctx *parser2.RuleNameContext)
- func (s *GruleV2ParserListener) ExitSalience(ctx *parser2.SalienceContext)
- func (s *GruleV2ParserListener) ExitStringLiteral(ctx *parser2.StringLiteralContext)
- func (s *GruleV2ParserListener) ExitThenExpression(ctx *parser2.ThenExpressionContext)
- func (s *GruleV2ParserListener) ExitThenExpressionList(ctx *parser2.ThenExpressionListContext)
- func (s *GruleV2ParserListener) ExitThenScope(ctx *parser2.ThenScopeContext)
- func (s *GruleV2ParserListener) ExitVariable(ctx *parser2.VariableContext)
- func (s *GruleV2ParserListener) ExitWhenScope(ctx *parser2.WhenScopeContext)
- func (s *GruleV2ParserListener) VisitErrorNode(node antlr.ErrorNode)
- func (s *GruleV2ParserListener) VisitTerminal(node antlr.TerminalNode)
Constants ¶
This section is empty.
Variables ¶
var ( // LoggerV2 is a logrus instance twith default fields for grule LoggerV2 = logrus.WithFields(logrus.Fields{ "lib": "grule", "struct": "GruleParserV2Listener", }) )
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 GruleV2ParserListener ¶ added in v1.2.0
type GruleV2ParserListener struct { parser2.Basegrulev2Listener PreviousNode []string WorkingMemory *ast.WorkingMemory KnowledgeBase *ast.KnowledgeBase Stack *stack.Stack StopParse bool ErrorCallback func(e error) }
GruleV2ParserListener is an implementation of logic to build the execution flow or execution graph as it defined within the knowledge base.
func NewGruleV2ParserListener ¶ added in v1.2.0
func NewGruleV2ParserListener(knowleedgeBase *ast.KnowledgeBase, memory *ast.WorkingMemory, errorCallBack func(e error)) *GruleV2ParserListener
NewGruleV2ParserListener create new instance of GruleV2ParserListener
func (*GruleV2ParserListener) EnterAddMinusOperators ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterAddMinusOperators(ctx *parser2.AddMinusOperatorsContext)
EnterAddMinusOperators is called when production addMinusOperators is entered.
func (*GruleV2ParserListener) EnterAndLogicOperator ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterAndLogicOperator(ctx *parser2.AndLogicOperatorContext)
EnterAndLogicOperator is called when production andLogicOperator is entered.
func (*GruleV2ParserListener) EnterArgumentList ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterArgumentList(ctx *parser2.ArgumentListContext)
EnterArgumentList is called when production argumentList is entered.
func (*GruleV2ParserListener) EnterAssignment ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterAssignment(ctx *parser2.AssignmentContext)
EnterAssignment is called when production assignment is entered.
func (*GruleV2ParserListener) EnterBooleanLiteral ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterBooleanLiteral(ctx *parser2.BooleanLiteralContext)
EnterBooleanLiteral is called when production booleanLiteral is entered.
func (*GruleV2ParserListener) EnterComparisonOperator ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterComparisonOperator(ctx *parser2.ComparisonOperatorContext)
EnterComparisonOperator is called when production comparisonOperator is entered.
func (*GruleV2ParserListener) EnterConstant ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterConstant(ctx *parser2.ConstantContext)
EnterConstant is called when production constant is entered.
func (*GruleV2ParserListener) EnterDecimalLiteral ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterDecimalLiteral(ctx *parser2.DecimalLiteralContext)
EnterDecimalLiteral is called when production decimalLiteral is entered.
func (*GruleV2ParserListener) EnterEveryRule ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterEveryRule(ctx antlr.ParserRuleContext)
EnterEveryRule is called when any rule is entered.
func (*GruleV2ParserListener) EnterExpression ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterExpression(ctx *parser2.ExpressionContext)
EnterExpression is called when production expression is entered.
func (*GruleV2ParserListener) EnterExpressionAtom ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterExpressionAtom(ctx *parser2.ExpressionAtomContext)
EnterExpressionAtom is called when production expressionAtom is entered.
func (*GruleV2ParserListener) EnterFunctionCall ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterFunctionCall(ctx *parser2.FunctionCallContext)
EnterFunctionCall is called when production functionCall is entered.
func (*GruleV2ParserListener) EnterMethodCall ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterMethodCall(ctx *parser2.MethodCallContext)
EnterMethodCall is called when production methodCall is entered.
func (*GruleV2ParserListener) EnterMulDivOperators ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterMulDivOperators(ctx *parser2.MulDivOperatorsContext)
EnterMulDivOperators is called when production mulDivOperators is entered.
func (*GruleV2ParserListener) EnterOrLogicOperator ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterOrLogicOperator(ctx *parser2.OrLogicOperatorContext)
EnterOrLogicOperator is called when production orLogicOperator is entered.
func (*GruleV2ParserListener) EnterRealLiteral ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterRealLiteral(ctx *parser2.RealLiteralContext)
EnterRealLiteral is called when production realLiteral is entered.
func (*GruleV2ParserListener) EnterRoot ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterRoot(ctx *parser2.RootContext)
EnterRoot is called when production root is entered.
func (*GruleV2ParserListener) EnterRuleDescription ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterRuleDescription(ctx *parser2.RuleDescriptionContext)
EnterRuleDescription is called when production ruleDescription is entered.
func (*GruleV2ParserListener) EnterRuleEntry ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterRuleEntry(ctx *parser2.RuleEntryContext)
EnterRuleEntry is called when production ruleEntry is entered.
func (*GruleV2ParserListener) EnterRuleName ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterRuleName(ctx *parser2.RuleNameContext)
EnterRuleName is called when production ruleName is entered.
func (*GruleV2ParserListener) EnterSalience ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterSalience(ctx *parser2.SalienceContext)
EnterSalience is called when production salience is entered.
func (*GruleV2ParserListener) EnterStringLiteral ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterStringLiteral(ctx *parser2.StringLiteralContext)
EnterStringLiteral is called when production stringLiteral is entered.
func (*GruleV2ParserListener) EnterThenExpression ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterThenExpression(ctx *parser2.ThenExpressionContext)
EnterThenExpression is called when production thenExpression is entered.
func (*GruleV2ParserListener) EnterThenExpressionList ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterThenExpressionList(ctx *parser2.ThenExpressionListContext)
EnterThenExpressionList is called when production thenExpressionList is entered.
func (*GruleV2ParserListener) EnterThenScope ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterThenScope(ctx *parser2.ThenScopeContext)
EnterThenScope is called when production thenScope is entered.
func (*GruleV2ParserListener) EnterVariable ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterVariable(ctx *parser2.VariableContext)
EnterVariable is called when production variable is entered.
func (*GruleV2ParserListener) EnterWhenScope ¶ added in v1.2.0
func (s *GruleV2ParserListener) EnterWhenScope(ctx *parser2.WhenScopeContext)
EnterWhenScope is called when production whenScope is entered.
func (*GruleV2ParserListener) ExitAddMinusOperators ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitAddMinusOperators(ctx *parser2.AddMinusOperatorsContext)
ExitAddMinusOperators is called when production addMinusOperators is exited.
func (*GruleV2ParserListener) ExitAndLogicOperator ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitAndLogicOperator(ctx *parser2.AndLogicOperatorContext)
ExitAndLogicOperator is called when production andLogicOperator is exited.
func (*GruleV2ParserListener) ExitArgumentList ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitArgumentList(ctx *parser2.ArgumentListContext)
ExitArgumentList is called when production argumentList is exited.
func (*GruleV2ParserListener) ExitAssignment ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitAssignment(ctx *parser2.AssignmentContext)
ExitAssignment is called when production assignment is exited.
func (*GruleV2ParserListener) ExitBooleanLiteral ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitBooleanLiteral(ctx *parser2.BooleanLiteralContext)
ExitBooleanLiteral is called when production booleanLiteral is exited.
func (*GruleV2ParserListener) ExitComparisonOperator ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitComparisonOperator(ctx *parser2.ComparisonOperatorContext)
ExitComparisonOperator is called when production comparisonOperator is exited.
func (*GruleV2ParserListener) ExitConstant ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitConstant(ctx *parser2.ConstantContext)
ExitConstant is called when production constant is exited.
func (*GruleV2ParserListener) ExitDecimalLiteral ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitDecimalLiteral(ctx *parser2.DecimalLiteralContext)
ExitDecimalLiteral is called when production decimalLiteral is exited.
func (*GruleV2ParserListener) ExitEveryRule ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitEveryRule(ctx antlr.ParserRuleContext)
ExitEveryRule is called when any rule is exited.
func (*GruleV2ParserListener) ExitExpression ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitExpression(ctx *parser2.ExpressionContext)
ExitExpression is called when production expression is exited.
func (*GruleV2ParserListener) ExitExpressionAtom ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitExpressionAtom(ctx *parser2.ExpressionAtomContext)
ExitExpressionAtom is called when production expressionAtom is exited.
func (*GruleV2ParserListener) ExitFunctionCall ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitFunctionCall(ctx *parser2.FunctionCallContext)
ExitFunctionCall is called when production functionCall is exited.
func (*GruleV2ParserListener) ExitMethodCall ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitMethodCall(ctx *parser2.MethodCallContext)
ExitMethodCall is called when production methodCall is exited.
func (*GruleV2ParserListener) ExitMulDivOperators ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitMulDivOperators(ctx *parser2.MulDivOperatorsContext)
ExitMulDivOperators is called when production mulDivOperators is exited.
func (*GruleV2ParserListener) ExitOrLogicOperator ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitOrLogicOperator(ctx *parser2.OrLogicOperatorContext)
ExitOrLogicOperator is called when production orLogicOperator is exited.
func (*GruleV2ParserListener) ExitRealLiteral ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitRealLiteral(ctx *parser2.RealLiteralContext)
ExitRealLiteral is called when production realLiteral is exited.
func (*GruleV2ParserListener) ExitRoot ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitRoot(ctx *parser2.RootContext)
ExitRoot is called when production root is exited.
func (*GruleV2ParserListener) ExitRuleDescription ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitRuleDescription(ctx *parser2.RuleDescriptionContext)
ExitRuleDescription is called when production ruleDescription is exited.
func (*GruleV2ParserListener) ExitRuleEntry ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitRuleEntry(ctx *parser2.RuleEntryContext)
ExitRuleEntry is called when production ruleEntry is exited.
func (*GruleV2ParserListener) ExitRuleName ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitRuleName(ctx *parser2.RuleNameContext)
ExitRuleName is called when production ruleName is exited.
func (*GruleV2ParserListener) ExitSalience ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitSalience(ctx *parser2.SalienceContext)
ExitSalience is called when production salience is exited.
func (*GruleV2ParserListener) ExitStringLiteral ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitStringLiteral(ctx *parser2.StringLiteralContext)
ExitStringLiteral is called when production stringLiteral is exited.
func (*GruleV2ParserListener) ExitThenExpression ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitThenExpression(ctx *parser2.ThenExpressionContext)
ExitThenExpression is called when production thenExpression is exited.
func (*GruleV2ParserListener) ExitThenExpressionList ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitThenExpressionList(ctx *parser2.ThenExpressionListContext)
ExitThenExpressionList is called when production thenExpressionList is exited.
func (*GruleV2ParserListener) ExitThenScope ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitThenScope(ctx *parser2.ThenScopeContext)
ExitThenScope is called when production thenScope is exited.
func (*GruleV2ParserListener) ExitVariable ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitVariable(ctx *parser2.VariableContext)
ExitVariable is called when production variable is exited.
func (*GruleV2ParserListener) ExitWhenScope ¶ added in v1.2.0
func (s *GruleV2ParserListener) ExitWhenScope(ctx *parser2.WhenScopeContext)
ExitWhenScope is called when production whenScope is exited.
func (*GruleV2ParserListener) VisitErrorNode ¶ added in v1.2.0
func (s *GruleV2ParserListener) VisitErrorNode(node antlr.ErrorNode)
VisitErrorNode is called when an error node is visited.
func (*GruleV2ParserListener) VisitTerminal ¶ added in v1.2.0
func (s *GruleV2ParserListener) VisitTerminal(node antlr.TerminalNode)
VisitTerminal is called when a terminal node is visited.