Error: Module parse failed: Identifier '_alt' has already been declared

311 views
Skip to first unread message

Nino

unread,
Aug 20, 2021, 7:09:30 AM8/20/21
to antlr-discussion
Hi,
I'm trying to create a JavaScript parser for T-SQL using this grammar:
https://github.com/antlr/grammars-v4/tree/master/sql/tsql

Generation of the JS files works fine.
Nevertheless when trying to use them I always get:

ERROR in ./build/TSQLParser.js 9997:17
Module parse failed: Identifier '_alt' has already been declared (9997:17)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|                   this.state = 1106;
|                   this._errHandler.sync(this);
>                   let _alt = this._interp.adaptivePredict(this._input,7,this._ctx)
|                   while(_alt!=2 && _alt!=antlr4.atn.ATN.INVALID_ALT_NUMBER) {
|                       if(_alt===1) {

I get the same error without using webpack as well (i.e. node with "type": "module").

Anybody seen something like this before?
Reply all
Reply to author
Forward
0 new messages