[#74] netmap/parser: Update antlr4 generator

Also, add -no-listener option, as we use visitor only.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
pull/74/head
Evgenii Stratonikov 2023-05-19 12:30:49 +03:00
parent 70f23dd1ea
commit f5b23eb225
9 changed files with 95 additions and 377 deletions

View File

@ -64,4 +64,4 @@ identWC
atn:
[4, 1, 21, 130, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 4, 0, 30, 8, 0, 11, 0, 12, 0, 31, 1, 0, 3, 0, 35, 8, 0, 1, 0, 5, 0, 38, 8, 0, 10, 0, 12, 0, 41, 9, 0, 1, 0, 5, 0, 44, 8, 0, 10, 0, 12, 0, 47, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 55, 8, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 64, 8, 3, 1, 3, 3, 3, 67, 8, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 73, 8, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 83, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 91, 8, 5, 10, 5, 12, 5, 94, 9, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 107, 8, 7, 1, 8, 1, 8, 3, 8, 111, 8, 8, 1, 9, 1, 9, 1, 9, 3, 9, 116, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 124, 8, 12, 1, 13, 1, 13, 3, 13, 128, 8, 13, 1, 13, 0, 1, 10, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 12, 13, 1, 0, 18, 19, 2, 0, 4, 6, 8, 10, 132, 0, 29, 1, 0, 0, 0, 2, 50, 1, 0, 0, 0, 4, 56, 1, 0, 0, 0, 6, 59, 1, 0, 0, 0, 8, 74, 1, 0, 0, 0, 10, 82, 1, 0, 0, 0, 12, 95, 1, 0, 0, 0, 14, 106, 1, 0, 0, 0, 16, 110, 1, 0, 0, 0, 18, 115, 1, 0, 0, 0, 20, 117, 1, 0, 0, 0, 22, 119, 1, 0, 0, 0, 24, 123, 1, 0, 0, 0, 26, 127, 1, 0, 0, 0, 28, 30, 3, 2, 1, 0, 29, 28, 1, 0, 0, 0, 30, 31, 1, 0, 0, 0, 31, 29, 1, 0, 0, 0, 31, 32, 1, 0, 0, 0, 32, 34, 1, 0, 0, 0, 33, 35, 3, 4, 2, 0, 34, 33, 1, 0, 0, 0, 34, 35, 1, 0, 0, 0, 35, 39, 1, 0, 0, 0, 36, 38, 3, 6, 3, 0, 37, 36, 1, 0, 0, 0, 38, 41, 1, 0, 0, 0, 39, 37, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 45, 1, 0, 0, 0, 41, 39, 1, 0, 0, 0, 42, 44, 3, 12, 6, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 51, 5, 4, 0, 0, 51, 54, 5, 18, 0, 0, 52, 53, 5, 5, 0, 0, 53, 55, 3, 24, 12, 0, 54, 52, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 57, 5, 7, 0, 0, 57, 58, 5, 18, 0, 0, 58, 5, 1, 0, 0, 0, 59, 60, 5, 8, 0, 0, 60, 66, 5, 18, 0, 0, 61, 63, 5, 5, 0, 0, 62, 64, 3, 8, 4, 0, 63, 62, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 67, 3, 24, 12, 0, 66, 61, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 69, 5, 9, 0, 0, 69, 72, 3, 26, 13, 0, 70, 71, 5, 6, 0, 0, 71, 73, 3, 24, 12, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 7, 1, 0, 0, 0, 74, 75, 7, 0, 0, 0, 75, 9, 1, 0, 0, 0, 76, 77, 6, 5, -1, 0, 77, 78, 5, 14, 0, 0, 78, 79, 3, 10, 5, 0, 79, 80, 5, 15, 0, 0, 80, 83, 1, 0, 0, 0, 81, 83, 3, 14, 7, 0, 82, 76, 1, 0, 0, 0, 82, 81, 1, 0, 0, 0, 83, 92, 1, 0, 0, 0, 84, 85, 10, 4, 0, 0, 85, 86, 5, 1, 0, 0, 86, 91, 3, 10, 5, 5, 87, 88, 10, 3, 0, 0, 88, 89, 5, 2, 0, 0, 89, 91, 3, 10, 5, 4, 90, 84, 1, 0, 0, 0, 90, 87, 1, 0, 0, 0, 91, 94, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 11, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 95, 96, 5, 10, 0, 0, 96, 97, 3, 10, 5, 0, 97, 98, 5, 6, 0, 0, 98, 99, 3, 24, 12, 0, 99, 13, 1, 0, 0, 0, 100, 101, 5, 16, 0, 0, 101, 107, 3, 24, 12, 0, 102, 103, 3, 16, 8, 0, 103, 104, 5, 3, 0, 0, 104, 105, 3, 18, 9, 0, 105, 107, 1, 0, 0, 0, 106, 100, 1, 0, 0, 0, 106, 102, 1, 0, 0, 0, 107, 15, 1, 0, 0, 0, 108, 111, 3, 24, 12, 0, 109, 111, 5, 20, 0, 0, 110, 108, 1, 0, 0, 0, 110, 109, 1, 0, 0, 0, 111, 17, 1, 0, 0, 0, 112, 116, 3, 24, 12, 0, 113, 116, 3, 20, 10, 0, 114, 116, 5, 20, 0, 0, 115, 112, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, 0, 0, 116, 19, 1, 0, 0, 0, 117, 118, 7, 1, 0, 0, 118, 21, 1, 0, 0, 0, 119, 120, 7, 2, 0, 0, 120, 23, 1, 0, 0, 0, 121, 124, 3, 22, 11, 0, 122, 124, 5, 17, 0, 0, 123, 121, 1, 0, 0, 0, 123, 122, 1, 0, 0, 0, 124, 25, 1, 0, 0, 0, 125, 128, 3, 24, 12, 0, 126, 128, 5, 11, 0, 0, 127, 125, 1, 0, 0, 0, 127, 126, 1, 0, 0, 0, 128, 27, 1, 0, 0, 0, 16, 31, 34, 39, 45, 54, 63, 66, 72, 82, 90, 92, 106, 110, 115, 123, 127]
[4, 1, 21, 130, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 4, 0, 30, 8, 0, 11, 0, 12, 0, 31, 1, 0, 3, 0, 35, 8, 0, 1, 0, 5, 0, 38, 8, 0, 10, 0, 12, 0, 41, 9, 0, 1, 0, 5, 0, 44, 8, 0, 10, 0, 12, 0, 47, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 55, 8, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 64, 8, 3, 1, 3, 3, 3, 67, 8, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 73, 8, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 83, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 91, 8, 5, 10, 5, 12, 5, 94, 9, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 107, 8, 7, 1, 8, 1, 8, 3, 8, 111, 8, 8, 1, 9, 1, 9, 1, 9, 3, 9, 116, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 124, 8, 12, 1, 13, 1, 13, 3, 13, 128, 8, 13, 1, 13, 0, 1, 10, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 12, 13, 1, 0, 18, 19, 2, 0, 4, 6, 8, 10, 132, 0, 29, 1, 0, 0, 0, 2, 50, 1, 0, 0, 0, 4, 56, 1, 0, 0, 0, 6, 59, 1, 0, 0, 0, 8, 74, 1, 0, 0, 0, 10, 82, 1, 0, 0, 0, 12, 95, 1, 0, 0, 0, 14, 106, 1, 0, 0, 0, 16, 110, 1, 0, 0, 0, 18, 115, 1, 0, 0, 0, 20, 117, 1, 0, 0, 0, 22, 119, 1, 0, 0, 0, 24, 123, 1, 0, 0, 0, 26, 127, 1, 0, 0, 0, 28, 30, 3, 2, 1, 0, 29, 28, 1, 0, 0, 0, 30, 31, 1, 0, 0, 0, 31, 29, 1, 0, 0, 0, 31, 32, 1, 0, 0, 0, 32, 34, 1, 0, 0, 0, 33, 35, 3, 4, 2, 0, 34, 33, 1, 0, 0, 0, 34, 35, 1, 0, 0, 0, 35, 39, 1, 0, 0, 0, 36, 38, 3, 6, 3, 0, 37, 36, 1, 0, 0, 0, 38, 41, 1, 0, 0, 0, 39, 37, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 45, 1, 0, 0, 0, 41, 39, 1, 0, 0, 0, 42, 44, 3, 12, 6, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 51, 5, 4, 0, 0, 51, 54, 5, 18, 0, 0, 52, 53, 5, 5, 0, 0, 53, 55, 3, 24, 12, 0, 54, 52, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 57, 5, 7, 0, 0, 57, 58, 5, 18, 0, 0, 58, 5, 1, 0, 0, 0, 59, 60, 5, 8, 0, 0, 60, 66, 5, 18, 0, 0, 61, 63, 5, 5, 0, 0, 62, 64, 3, 8, 4, 0, 63, 62, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 67, 3, 24, 12, 0, 66, 61, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 69, 5, 9, 0, 0, 69, 72, 3, 26, 13, 0, 70, 71, 5, 6, 0, 0, 71, 73, 3, 24, 12, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 7, 1, 0, 0, 0, 74, 75, 7, 0, 0, 0, 75, 9, 1, 0, 0, 0, 76, 77, 6, 5, -1, 0, 77, 78, 5, 14, 0, 0, 78, 79, 3, 10, 5, 0, 79, 80, 5, 15, 0, 0, 80, 83, 1, 0, 0, 0, 81, 83, 3, 14, 7, 0, 82, 76, 1, 0, 0, 0, 82, 81, 1, 0, 0, 0, 83, 92, 1, 0, 0, 0, 84, 85, 10, 4, 0, 0, 85, 86, 5, 1, 0, 0, 86, 91, 3, 10, 5, 5, 87, 88, 10, 3, 0, 0, 88, 89, 5, 2, 0, 0, 89, 91, 3, 10, 5, 4, 90, 84, 1, 0, 0, 0, 90, 87, 1, 0, 0, 0, 91, 94, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 11, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 95, 96, 5, 10, 0, 0, 96, 97, 3, 10, 5, 0, 97, 98, 5, 6, 0, 0, 98, 99, 3, 24, 12, 0, 99, 13, 1, 0, 0, 0, 100, 101, 5, 16, 0, 0, 101, 107, 3, 24, 12, 0, 102, 103, 3, 16, 8, 0, 103, 104, 5, 3, 0, 0, 104, 105, 3, 18, 9, 0, 105, 107, 1, 0, 0, 0, 106, 100, 1, 0, 0, 0, 106, 102, 1, 0, 0, 0, 107, 15, 1, 0, 0, 0, 108, 111, 3, 24, 12, 0, 109, 111, 5, 20, 0, 0, 110, 108, 1, 0, 0, 0, 110, 109, 1, 0, 0, 0, 111, 17, 1, 0, 0, 0, 112, 116, 3, 24, 12, 0, 113, 116, 3, 20, 10, 0, 114, 116, 5, 20, 0, 0, 115, 112, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, 0, 0, 116, 19, 1, 0, 0, 0, 117, 118, 7, 1, 0, 0, 118, 21, 1, 0, 0, 0, 119, 120, 7, 2, 0, 0, 120, 23, 1, 0, 0, 0, 121, 124, 3, 22, 11, 0, 122, 124, 5, 17, 0, 0, 123, 121, 1, 0, 0, 0, 123, 122, 1, 0, 0, 0, 124, 25, 1, 0, 0, 0, 125, 128, 3, 24, 12, 0, 126, 128, 5, 11, 0, 0, 127, 125, 1, 0, 0, 0, 127, 126, 1, 0, 0, 0, 128, 27, 1, 0, 0, 0, 16, 31, 34, 39, 45, 54, 63, 66, 72, 82, 90, 92, 106, 110, 115, 123, 127]

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
package parser
// ANTLR can be downloaded from https://www.antlr.org/download/antlr-4.11.1-complete.jar
//go:generate java -Xmx500M -cp "./antlr-4.11.1-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Go -visitor QueryLexer.g4 Query.g4
// ANTLR can be downloaded from https://www.antlr.org/download/antlr-4.12.0-complete.jar
//go:generate java -Xmx500M -cp "./antlr-4.12.0-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Go -no-listener -visitor QueryLexer.g4 Query.g4

View File

@ -1,106 +0,0 @@
// Code generated from java-escape by ANTLR 4.11.1. DO NOT EDIT.
package parser // Query
import "github.com/antlr/antlr4/runtime/Go/antlr/v4"
// BaseQueryListener is a complete listener for a parse tree produced by Query.
type BaseQueryListener struct{}
var _ QueryListener = &BaseQueryListener{}
// VisitTerminal is called when a terminal node is visited.
func (s *BaseQueryListener) VisitTerminal(node antlr.TerminalNode) {}
// VisitErrorNode is called when an error node is visited.
func (s *BaseQueryListener) VisitErrorNode(node antlr.ErrorNode) {}
// EnterEveryRule is called when any rule is entered.
func (s *BaseQueryListener) EnterEveryRule(ctx antlr.ParserRuleContext) {}
// ExitEveryRule is called when any rule is exited.
func (s *BaseQueryListener) ExitEveryRule(ctx antlr.ParserRuleContext) {}
// EnterPolicy is called when production policy is entered.
func (s *BaseQueryListener) EnterPolicy(ctx *PolicyContext) {}
// ExitPolicy is called when production policy is exited.
func (s *BaseQueryListener) ExitPolicy(ctx *PolicyContext) {}
// EnterRepStmt is called when production repStmt is entered.
func (s *BaseQueryListener) EnterRepStmt(ctx *RepStmtContext) {}
// ExitRepStmt is called when production repStmt is exited.
func (s *BaseQueryListener) ExitRepStmt(ctx *RepStmtContext) {}
// EnterCbfStmt is called when production cbfStmt is entered.
func (s *BaseQueryListener) EnterCbfStmt(ctx *CbfStmtContext) {}
// ExitCbfStmt is called when production cbfStmt is exited.
func (s *BaseQueryListener) ExitCbfStmt(ctx *CbfStmtContext) {}
// EnterSelectStmt is called when production selectStmt is entered.
func (s *BaseQueryListener) EnterSelectStmt(ctx *SelectStmtContext) {}
// ExitSelectStmt is called when production selectStmt is exited.
func (s *BaseQueryListener) ExitSelectStmt(ctx *SelectStmtContext) {}
// EnterClause is called when production clause is entered.
func (s *BaseQueryListener) EnterClause(ctx *ClauseContext) {}
// ExitClause is called when production clause is exited.
func (s *BaseQueryListener) ExitClause(ctx *ClauseContext) {}
// EnterFilterExpr is called when production filterExpr is entered.
func (s *BaseQueryListener) EnterFilterExpr(ctx *FilterExprContext) {}
// ExitFilterExpr is called when production filterExpr is exited.
func (s *BaseQueryListener) ExitFilterExpr(ctx *FilterExprContext) {}
// EnterFilterStmt is called when production filterStmt is entered.
func (s *BaseQueryListener) EnterFilterStmt(ctx *FilterStmtContext) {}
// ExitFilterStmt is called when production filterStmt is exited.
func (s *BaseQueryListener) ExitFilterStmt(ctx *FilterStmtContext) {}
// EnterExpr is called when production expr is entered.
func (s *BaseQueryListener) EnterExpr(ctx *ExprContext) {}
// ExitExpr is called when production expr is exited.
func (s *BaseQueryListener) ExitExpr(ctx *ExprContext) {}
// EnterFilterKey is called when production filterKey is entered.
func (s *BaseQueryListener) EnterFilterKey(ctx *FilterKeyContext) {}
// ExitFilterKey is called when production filterKey is exited.
func (s *BaseQueryListener) ExitFilterKey(ctx *FilterKeyContext) {}
// EnterFilterValue is called when production filterValue is entered.
func (s *BaseQueryListener) EnterFilterValue(ctx *FilterValueContext) {}
// ExitFilterValue is called when production filterValue is exited.
func (s *BaseQueryListener) ExitFilterValue(ctx *FilterValueContext) {}
// EnterNumber is called when production number is entered.
func (s *BaseQueryListener) EnterNumber(ctx *NumberContext) {}
// ExitNumber is called when production number is exited.
func (s *BaseQueryListener) ExitNumber(ctx *NumberContext) {}
// EnterKeyword is called when production keyword is entered.
func (s *BaseQueryListener) EnterKeyword(ctx *KeywordContext) {}
// ExitKeyword is called when production keyword is exited.
func (s *BaseQueryListener) ExitKeyword(ctx *KeywordContext) {}
// EnterIdent is called when production ident is entered.
func (s *BaseQueryListener) EnterIdent(ctx *IdentContext) {}
// ExitIdent is called when production ident is exited.
func (s *BaseQueryListener) ExitIdent(ctx *IdentContext) {}
// EnterIdentWC is called when production identWC is entered.
func (s *BaseQueryListener) EnterIdentWC(ctx *IdentWCContext) {}
// ExitIdentWC is called when production identWC is exited.
func (s *BaseQueryListener) ExitIdentWC(ctx *IdentWCContext) {}

View File

@ -1,4 +1,4 @@
// Code generated from java-escape by ANTLR 4.11.1. DO NOT EDIT.
// Code generated from Query.g4 by ANTLR 4.12.0. DO NOT EDIT.
package parser // Query

View File

@ -1,4 +1,4 @@
// Code generated from java-escape by ANTLR 4.11.1. DO NOT EDIT.
// Code generated from QueryLexer.g4 by ANTLR 4.12.0. DO NOT EDIT.
package parser

View File

@ -1,94 +0,0 @@
// Code generated from java-escape by ANTLR 4.11.1. DO NOT EDIT.
package parser // Query
import "github.com/antlr/antlr4/runtime/Go/antlr/v4"
// QueryListener is a complete listener for a parse tree produced by Query.
type QueryListener interface {
antlr.ParseTreeListener
// EnterPolicy is called when entering the policy production.
EnterPolicy(c *PolicyContext)
// EnterRepStmt is called when entering the repStmt production.
EnterRepStmt(c *RepStmtContext)
// EnterCbfStmt is called when entering the cbfStmt production.
EnterCbfStmt(c *CbfStmtContext)
// EnterSelectStmt is called when entering the selectStmt production.
EnterSelectStmt(c *SelectStmtContext)
// EnterClause is called when entering the clause production.
EnterClause(c *ClauseContext)
// EnterFilterExpr is called when entering the filterExpr production.
EnterFilterExpr(c *FilterExprContext)
// EnterFilterStmt is called when entering the filterStmt production.
EnterFilterStmt(c *FilterStmtContext)
// EnterExpr is called when entering the expr production.
EnterExpr(c *ExprContext)
// EnterFilterKey is called when entering the filterKey production.
EnterFilterKey(c *FilterKeyContext)
// EnterFilterValue is called when entering the filterValue production.
EnterFilterValue(c *FilterValueContext)
// EnterNumber is called when entering the number production.
EnterNumber(c *NumberContext)
// EnterKeyword is called when entering the keyword production.
EnterKeyword(c *KeywordContext)
// EnterIdent is called when entering the ident production.
EnterIdent(c *IdentContext)
// EnterIdentWC is called when entering the identWC production.
EnterIdentWC(c *IdentWCContext)
// ExitPolicy is called when exiting the policy production.
ExitPolicy(c *PolicyContext)
// ExitRepStmt is called when exiting the repStmt production.
ExitRepStmt(c *RepStmtContext)
// ExitCbfStmt is called when exiting the cbfStmt production.
ExitCbfStmt(c *CbfStmtContext)
// ExitSelectStmt is called when exiting the selectStmt production.
ExitSelectStmt(c *SelectStmtContext)
// ExitClause is called when exiting the clause production.
ExitClause(c *ClauseContext)
// ExitFilterExpr is called when exiting the filterExpr production.
ExitFilterExpr(c *FilterExprContext)
// ExitFilterStmt is called when exiting the filterStmt production.
ExitFilterStmt(c *FilterStmtContext)
// ExitExpr is called when exiting the expr production.
ExitExpr(c *ExprContext)
// ExitFilterKey is called when exiting the filterKey production.
ExitFilterKey(c *FilterKeyContext)
// ExitFilterValue is called when exiting the filterValue production.
ExitFilterValue(c *FilterValueContext)
// ExitNumber is called when exiting the number production.
ExitNumber(c *NumberContext)
// ExitKeyword is called when exiting the keyword production.
ExitKeyword(c *KeywordContext)
// ExitIdent is called when exiting the ident production.
ExitIdent(c *IdentContext)
// ExitIdentWC is called when exiting the identWC production.
ExitIdentWC(c *IdentWCContext)
}

View File

@ -1,4 +1,4 @@
// Code generated from java-escape by ANTLR 4.11.1. DO NOT EDIT.
// Code generated from Query.g4 by ANTLR 4.12.0. DO NOT EDIT.
package parser // Query
@ -133,7 +133,7 @@ func NewQuery(input antlr.TokenStream) *Query {
this.RuleNames = staticData.ruleNames
this.LiteralNames = staticData.literalNames
this.SymbolicNames = staticData.symbolicNames
this.GrammarFileName = "java-escape"
this.GrammarFileName = "Query.g4"
return this
}
@ -189,6 +189,16 @@ type IPolicyContext interface {
// GetParser returns the parser.
GetParser() antlr.Parser
// Getter signatures
EOF() antlr.TerminalNode
AllRepStmt() []IRepStmtContext
RepStmt(i int) IRepStmtContext
CbfStmt() ICbfStmtContext
AllSelectStmt() []ISelectStmtContext
SelectStmt(i int) ISelectStmtContext
AllFilterStmt() []IFilterStmtContext
FilterStmt(i int) IFilterStmtContext
// IsPolicyContext differentiates from other interfaces.
IsPolicyContext()
}
@ -371,18 +381,6 @@ func (s *PolicyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *PolicyContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterPolicy(s)
}
}
func (s *PolicyContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitPolicy(s)
}
}
func (s *PolicyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:
@ -498,6 +496,12 @@ type IRepStmtContext interface {
// SetSelector sets the Selector rule contexts.
SetSelector(IIdentContext)
// Getter signatures
REP() antlr.TerminalNode
NUMBER1() antlr.TerminalNode
IN() antlr.TerminalNode
Ident() IIdentContext
// IsRepStmtContext differentiates from other interfaces.
IsRepStmtContext()
}
@ -575,18 +579,6 @@ func (s *RepStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *RepStmtContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterRepStmt(s)
}
}
func (s *RepStmtContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitRepStmt(s)
}
}
func (s *RepStmtContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:
@ -668,6 +660,10 @@ type ICbfStmtContext interface {
// SetBackupFactor sets the BackupFactor token.
SetBackupFactor(antlr.Token)
// Getter signatures
CBF() antlr.TerminalNode
NUMBER1() antlr.TerminalNode
// IsCbfStmtContext differentiates from other interfaces.
IsCbfStmtContext()
}
@ -720,18 +716,6 @@ func (s *CbfStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *CbfStmtContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterCbfStmt(s)
}
}
func (s *CbfStmtContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitCbfStmt(s)
}
}
func (s *CbfStmtContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:
@ -812,6 +796,17 @@ type ISelectStmtContext interface {
// SetName sets the Name rule contexts.
SetName(IIdentContext)
// Getter signatures
SELECT() antlr.TerminalNode
FROM() antlr.TerminalNode
NUMBER1() antlr.TerminalNode
IdentWC() IIdentWCContext
IN() antlr.TerminalNode
AS() antlr.TerminalNode
AllIdent() []IIdentContext
Ident(i int) IIdentContext
Clause() IClauseContext
// IsSelectStmtContext differentiates from other interfaces.
IsSelectStmtContext()
}
@ -964,18 +959,6 @@ func (s *SelectStmtContext) ToStringTree(ruleNames []string, recog antlr.Recogni
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *SelectStmtContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterSelectStmt(s)
}
}
func (s *SelectStmtContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitSelectStmt(s)
}
}
func (s *SelectStmtContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:
@ -1091,6 +1074,10 @@ type IClauseContext interface {
// GetParser returns the parser.
GetParser() antlr.Parser
// Getter signatures
CLAUSE_SAME() antlr.TerminalNode
CLAUSE_DISTINCT() antlr.TerminalNode
// IsClauseContext differentiates from other interfaces.
IsClauseContext()
}
@ -1138,18 +1125,6 @@ func (s *ClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *ClauseContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterClause(s)
}
}
func (s *ClauseContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitClause(s)
}
}
func (s *ClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:
@ -1231,6 +1206,15 @@ type IFilterExprContext interface {
// SetF2 sets the F2 rule contexts.
SetF2(IFilterExprContext)
// Getter signatures
L_PAREN() antlr.TerminalNode
R_PAREN() antlr.TerminalNode
AllFilterExpr() []IFilterExprContext
FilterExpr(i int) IFilterExprContext
Expr() IExprContext
AND_OP() antlr.TerminalNode
OR_OP() antlr.TerminalNode
// IsFilterExprContext differentiates from other interfaces.
IsFilterExprContext()
}
@ -1363,18 +1347,6 @@ func (s *FilterExprContext) ToStringTree(ruleNames []string, recog antlr.Recogni
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *FilterExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterFilterExpr(s)
}
}
func (s *FilterExprContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitFilterExpr(s)
}
}
func (s *FilterExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:
@ -1542,6 +1514,12 @@ type IFilterStmtContext interface {
// SetName sets the Name rule contexts.
SetName(IIdentContext)
// Getter signatures
FILTER() antlr.TerminalNode
AS() antlr.TerminalNode
FilterExpr() IFilterExprContext
Ident() IIdentContext
// IsFilterStmtContext differentiates from other interfaces.
IsFilterStmtContext()
}
@ -1631,18 +1609,6 @@ func (s *FilterStmtContext) ToStringTree(ruleNames []string, recog antlr.Recogni
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *FilterStmtContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterFilterStmt(s)
}
}
func (s *FilterStmtContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitFilterStmt(s)
}
}
func (s *FilterStmtContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:
@ -1728,6 +1694,13 @@ type IExprContext interface {
// SetValue sets the Value rule contexts.
SetValue(IFilterValueContext)
// Getter signatures
AT() antlr.TerminalNode
Ident() IIdentContext
SIMPLE_OP() antlr.TerminalNode
FilterKey() IFilterKeyContext
FilterValue() IFilterValueContext
// IsExprContext differentiates from other interfaces.
IsExprContext()
}
@ -1838,18 +1811,6 @@ func (s *ExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *ExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterExpr(s)
}
}
func (s *ExprContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitExpr(s)
}
}
func (s *ExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:
@ -1936,6 +1897,10 @@ type IFilterKeyContext interface {
// GetParser returns the parser.
GetParser() antlr.Parser
// Getter signatures
Ident() IIdentContext
STRING() antlr.TerminalNode
// IsFilterKeyContext differentiates from other interfaces.
IsFilterKeyContext()
}
@ -1995,18 +1960,6 @@ func (s *FilterKeyContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *FilterKeyContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterFilterKey(s)
}
}
func (s *FilterKeyContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitFilterKey(s)
}
}
func (s *FilterKeyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:
@ -2072,6 +2025,11 @@ type IFilterValueContext interface {
// GetParser returns the parser.
GetParser() antlr.Parser
// Getter signatures
Ident() IIdentContext
Number() INumberContext
STRING() antlr.TerminalNode
// IsFilterValueContext differentiates from other interfaces.
IsFilterValueContext()
}
@ -2147,18 +2105,6 @@ func (s *FilterValueContext) ToStringTree(ruleNames []string, recog antlr.Recogn
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *FilterValueContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterFilterValue(s)
}
}
func (s *FilterValueContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitFilterValue(s)
}
}
func (s *FilterValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:
@ -2231,6 +2177,10 @@ type INumberContext interface {
// GetParser returns the parser.
GetParser() antlr.Parser
// Getter signatures
ZERO() antlr.TerminalNode
NUMBER1() antlr.TerminalNode
// IsNumberContext differentiates from other interfaces.
IsNumberContext()
}
@ -2278,18 +2228,6 @@ func (s *NumberContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *NumberContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterNumber(s)
}
}
func (s *NumberContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitNumber(s)
}
}
func (s *NumberContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:
@ -2347,6 +2285,14 @@ type IKeywordContext interface {
// GetParser returns the parser.
GetParser() antlr.Parser
// Getter signatures
REP() antlr.TerminalNode
IN() antlr.TerminalNode
AS() antlr.TerminalNode
SELECT() antlr.TerminalNode
FROM() antlr.TerminalNode
FILTER() antlr.TerminalNode
// IsKeywordContext differentiates from other interfaces.
IsKeywordContext()
}
@ -2410,18 +2356,6 @@ func (s *KeywordContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *KeywordContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterKeyword(s)
}
}
func (s *KeywordContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitKeyword(s)
}
}
func (s *KeywordContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:
@ -2479,6 +2413,10 @@ type IIdentContext interface {
// GetParser returns the parser.
GetParser() antlr.Parser
// Getter signatures
Keyword() IKeywordContext
IDENT() antlr.TerminalNode
// IsIdentContext differentiates from other interfaces.
IsIdentContext()
}
@ -2538,18 +2476,6 @@ func (s *IdentContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *IdentContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterIdent(s)
}
}
func (s *IdentContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitIdent(s)
}
}
func (s *IdentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:
@ -2615,6 +2541,10 @@ type IIdentWCContext interface {
// GetParser returns the parser.
GetParser() antlr.Parser
// Getter signatures
Ident() IIdentContext
WILDCARD() antlr.TerminalNode
// IsIdentWCContext differentiates from other interfaces.
IsIdentWCContext()
}
@ -2674,18 +2604,6 @@ func (s *IdentWCContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog)
}
func (s *IdentWCContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.EnterIdentWC(s)
}
}
func (s *IdentWCContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(QueryListener); ok {
listenerT.ExitIdentWC(s)
}
}
func (s *IdentWCContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case QueryVisitor:

View File

@ -1,4 +1,4 @@
// Code generated from java-escape by ANTLR 4.11.1. DO NOT EDIT.
// Code generated from Query.g4 by ANTLR 4.12.0. DO NOT EDIT.
package parser // Query