antlr4 icon indicating copy to clipboard operation
antlr4 copied to clipboard

[go target] Build errors with PartiQL parser

Open h3n4l opened this issue 9 months ago • 8 comments

The ANTLR4 version I used is 4.13.1. Use the PartiQL grammar in PartiQL site, https://partiql.org/syntax/antlr.html. And generate go target with command antlr -Dlanguage=Go -package parser -long-messages -listener *.g4, the target has build errors, for examples:

cannot use ctx (variable of type *ExprOrBaseContext) as antlr.RuleNode value in argument to v.VisitChildren: *ExprOrBaseContext does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IExprAndContext
		want GetParent() antlr.Tree
cannot use ctx (variable of type *ExprAndBaseContext) as antlr.RuleNode value in argument to v.VisitChildren: *ExprAndBaseContext does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IExprNotContext
		want GetParent() antlr.Tree
cannot use ctx (variable of type *ExprNotBaseContext) as antlr.RuleNode value in argument to v.VisitChildren: *ExprNotBaseContext does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IExprPredicateContext
		want GetParent() antlr.Tree
cannot use ctx (variable of type *PredicateBaseContext) as antlr.RuleNode value in argument to v.VisitChildren: *PredicateBaseContext does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IMathOp00Context
		want GetParent() antlr.Tree
cannot use ctx (variable of type *MathOp00Context) as antlr.RuleNode value in argument to v.VisitChildren: *MathOp00Context does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IMathOp01Context
		want GetParent() antlr.Tree
cannot use ctx (variable of type *MathOp01Context) as antlr.RuleNode value in argument to v.VisitChildren: *MathOp01Context does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IMathOp02Context
		want GetParent() antlr.Tree
cannot use ctx (variable of type *MathOp02Context) as antlr.RuleNode value in argument to v.VisitChildren: *MathOp02Context does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IValueExprContext
		want GetParent() antlr.Tree
cannot use ctx (variable of type *ValueExprContext) as antlr.RuleNode value in argument to v.VisitChildren: *ValueExprContext does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IExprPrimaryContext
		want GetParent() antlr.Tree
cannot use s (variable of type *ExprOrBaseContext) as antlr.RuleContext value in return statement: *ExprOrBaseContext does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IExprAndContext
		want GetParent() antlr.Tree
cannot use s (variable of type *ExprOrBaseContext) as antlr.RuleNode value in argument to t.VisitChildren: *ExprOrBaseContext does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IExprAndContext
		want GetParent() antlr.Tree
cannot use NewExprOrBaseContext(p, localctx) (value of type *ExprOrBaseContext) as IExprOrContext value in assignment: *ExprOrBaseContext does not implement IExprOrContext (wrong type for method GetParent)
		have GetParent() IExprAndContext
		want GetParent() antlr.Tree
impossible type assertion: localctx.(*ExprOrBaseContext)
	*ExprOrBaseContext does not implement IExprOrContext (wrong type for method GetParent)
		have GetParent() IExprAndContext
		want GetParent() antlr.Tree
cannot use s (variable of type *ExprAndBaseContext) as antlr.RuleContext value in return statement: *ExprAndBaseContext does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IExprNotContext
		want GetParent() antlr.Tree
cannot use s (variable of type *ExprAndBaseContext) as antlr.RuleNode value in argument to t.VisitChildren: *ExprAndBaseContext does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IExprNotContext
		want GetParent() antlr.Tree
cannot use NewExprAndBaseContext(p, localctx) (value of type *ExprAndBaseContext) as IExprAndContext value in assignment: *ExprAndBaseContext does not implement IExprAndContext (wrong type for method GetParent)
		have GetParent() IExprNotContext
		want GetParent() antlr.Tree
impossible type assertion: localctx.(*ExprAndBaseContext)
	*ExprAndBaseContext does not implement IExprAndContext (wrong type for method GetParent)
		have GetParent() IExprNotContext
		want GetParent() antlr.Tree
cannot use s (variable of type *ExprNotBaseContext) as antlr.RuleContext value in return statement: *ExprNotBaseContext does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IExprPredicateContext
		want GetParent() antlr.Tree
cannot use s (variable of type *ExprNotBaseContext) as antlr.RuleNode value in argument to t.VisitChildren: *ExprNotBaseContext does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IExprPredicateContext
		want GetParent() antlr.Tree
cannot use NewExprNotBaseContext(p, localctx) (value of type *ExprNotBaseContext) as IExprNotContext value in assignment: *ExprNotBaseContext does not implement IExprNotContext (wrong type for method GetParent)
		have GetParent() IExprPredicateContext
		want GetParent() antlr.Tree
impossible type assertion: localctx.(*ExprNotBaseContext)
	*ExprNotBaseContext does not implement IExprNotContext (wrong type for method GetParent)
		have GetParent() IExprPredicateContext
		want GetParent() antlr.Tree
cannot use s (variable of type *PredicateBaseContext) as antlr.RuleContext value in return statement: *PredicateBaseContext does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IMathOp00Context
		want GetParent() antlr.Tree
cannot use s (variable of type *PredicateBaseContext) as antlr.RuleNode value in argument to t.VisitChildren: *PredicateBaseContext does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IMathOp00Context
		want GetParent() antlr.Tree
cannot use NewPredicateBaseContext(p, localctx) (value of type *PredicateBaseContext) as IExprPredicateContext value in assignment: *PredicateBaseContext does not implement IExprPredicateContext (wrong type for method GetParent)
		have GetParent() IMathOp00Context
		want GetParent() antlr.Tree
impossible type assertion: localctx.(*PredicateBaseContext)
	*PredicateBaseContext does not implement IExprPredicateContext (wrong type for method GetParent)
		have GetParent() IMathOp00Context
		want GetParent() antlr.Tree
duplicate method GetParent
duplicate method SetParent
duplicate method GetParent (see details)
duplicate method SetParent (see details)
cannot use s (variable of type *MathOp00Context) as antlr.RuleContext value in return statement: *MathOp00Context does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IMathOp01Context
		want GetParent() antlr.Tree
cannot use s (variable of type *MathOp00Context) as antlr.Tree value in argument to antlr.TreesStringTree: *MathOp00Context does not implement antlr.Tree (wrong type for method GetParent)
		have GetParent() IMathOp01Context
		want GetParent() antlr.Tree
cannot use s (variable of type *MathOp00Context) as antlr.RuleNode value in argument to t.VisitChildren: *MathOp00Context does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IMathOp01Context
		want GetParent() antlr.Tree
cannot use _prevctx (variable of type IMathOp00Context) as antlr.ParserRuleContext value in variable declaration: IMathOp00Context does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IMathOp01Context
		want GetParent() antlr.Tree
cannot use localctx (variable of type IMathOp00Context) as antlr.ParserRuleContext value in argument to p.EnterRecursionRule: IMathOp00Context does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IMathOp01Context
		want GetParent() antlr.Tree
cannot use localctx (variable of type IMathOp00Context) as antlr.ParserRuleContext value in argument to p.EnterOuterAlt: IMathOp00Context does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IMathOp01Context
		want GetParent() antlr.Tree
cannot use localctx (variable of type IMathOp00Context) as antlr.ParserRuleContext value in argument to p.PushNewRecursionContext: IMathOp00Context does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IMathOp01Context
		want GetParent() antlr.Tree
duplicate method GetParent
duplicate method SetParent
duplicate method GetParent (see details)
duplicate method SetParent (see details)
cannot use s (variable of type *MathOp01Context) as antlr.RuleContext value in return statement: *MathOp01Context does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IMathOp02Context
		want GetParent() antlr.Tree
cannot use s (variable of type *MathOp01Context) as antlr.Tree value in argument to antlr.TreesStringTree: *MathOp01Context does not implement antlr.Tree (wrong type for method GetParent)
		have GetParent() IMathOp02Context
		want GetParent() antlr.Tree
cannot use s (variable of type *MathOp01Context) as antlr.RuleNode value in argument to t.VisitChildren: *MathOp01Context does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IMathOp02Context
		want GetParent() antlr.Tree
cannot use _prevctx (variable of type IMathOp01Context) as antlr.ParserRuleContext value in variable declaration: IMathOp01Context does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IMathOp02Context
		want GetParent() antlr.Tree
cannot use localctx (variable of type IMathOp01Context) as antlr.ParserRuleContext value in argument to p.EnterRecursionRule: IMathOp01Context does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IMathOp02Context
		want GetParent() antlr.Tree
cannot use localctx (variable of type IMathOp01Context) as antlr.ParserRuleContext value in argument to p.EnterOuterAlt: IMathOp01Context does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IMathOp02Context
		want GetParent() antlr.Tree
cannot use localctx (variable of type IMathOp01Context) as antlr.ParserRuleContext value in argument to p.PushNewRecursionContext: IMathOp01Context does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IMathOp02Context
		want GetParent() antlr.Tree
duplicate method GetParent
duplicate method SetParent
duplicate method GetParent (see details)
duplicate method SetParent (see details)
cannot use s (variable of type *MathOp02Context) as antlr.RuleContext value in return statement: *MathOp02Context does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IValueExprContext
		want GetParent() antlr.Tree
cannot use s (variable of type *MathOp02Context) as antlr.Tree value in argument to antlr.TreesStringTree: *MathOp02Context does not implement antlr.Tree (wrong type for method GetParent)
		have GetParent() IValueExprContext
		want GetParent() antlr.Tree
cannot use s (variable of type *MathOp02Context) as antlr.RuleNode value in argument to t.VisitChildren: *MathOp02Context does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IValueExprContext
		want GetParent() antlr.Tree
cannot use _prevctx (variable of type IMathOp02Context) as antlr.ParserRuleContext value in variable declaration: IMathOp02Context does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IValueExprContext
		want GetParent() antlr.Tree
cannot use localctx (variable of type IMathOp02Context) as antlr.ParserRuleContext value in argument to p.EnterRecursionRule: IMathOp02Context does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IValueExprContext
		want GetParent() antlr.Tree
cannot use localctx (variable of type IMathOp02Context) as antlr.ParserRuleContext value in argument to p.EnterOuterAlt: IMathOp02Context does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IValueExprContext
		want GetParent() antlr.Tree
cannot use localctx (variable of type IMathOp02Context) as antlr.ParserRuleContext value in argument to p.PushNewRecursionContext: IMathOp02Context does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IValueExprContext
		want GetParent() antlr.Tree
duplicate method GetParent
duplicate method SetParent
duplicate method GetParent (see details)
duplicate method SetParent (see details)
cannot use s (variable of type *ValueExprContext) as antlr.RuleContext value in return statement: *ValueExprContext does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IExprPrimaryContext
		want GetParent() antlr.Tree
cannot use s (variable of type *ValueExprContext) as antlr.Tree value in argument to antlr.TreesStringTree: *ValueExprContext does not implement antlr.Tree (wrong type for method GetParent)
		have GetParent() IExprPrimaryContext
		want GetParent() antlr.Tree
cannot use s (variable of type *ValueExprContext) as antlr.RuleNode value in argument to t.VisitChildren: *ValueExprContext does not implement antlr.RuleNode (wrong type for method GetParent)
		have GetParent() IExprPrimaryContext
		want GetParent() antlr.Tree
cannot use localctx (variable of type IValueExprContext) as antlr.ParserRuleContext value in argument to p.EnterRule: IValueExprContext does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IExprPrimaryContext
		want GetParent() antlr.Tree
cannot use localctx (variable of type IValueExprContext) as antlr.ParserRuleContext value in argument to p.EnterOuterAlt: IValueExprContext does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IExprPrimaryContext
		want GetParent() antlr.Tree
cannot use localctx (variable of type IValueExprContext) as antlr.ParserRuleContext value in argument to p.EnterOuterAlt: IValueExprContext does not implement antlr.ParserRuleContext (wrong type for method GetParent)
		have GetParent() IExprPrimaryContext
		want GetParent() antlr.Tree
impossible type assertion: localctx.(*MathOp00Context)
	*MathOp00Context does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IMathOp01Context
		want GetParent() antlr.Tree
cannot use t (variable of type *MathOp00Context) as antlr.RuleContext value in argument to p.MathOp00_Sempred: *MathOp00Context does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IMathOp01Context
		want GetParent() antlr.Tree
impossible type assertion: localctx.(*MathOp01Context)
	*MathOp01Context does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IMathOp02Context
		want GetParent() antlr.Tree
cannot use t (variable of type *MathOp01Context) as antlr.RuleContext value in argument to p.MathOp01_Sempred: *MathOp01Context does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IMathOp02Context
		want GetParent() antlr.Tree
impossible type assertion: localctx.(*MathOp02Context)
	*MathOp02Context does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IValueExprContext
		want GetParent() antlr.Tree
cannot use t (variable of type *MathOp02Context) as antlr.RuleContext value in argument to p.MathOp02_Sempred: *MathOp02Context does not implement antlr.RuleContext (wrong type for method GetParent)
		have GetParent() IValueExprContext
		want GetParent() antlr.Tree
unreachable code
...

h3n4l avatar May 27 '24 09:05 h3n4l