tunnelvisionlabs / antlr4

The highly-optimized fork of ANTLR 4 (see README)
Other
73 stars 12 forks source link

"TypeError: Class constructor Lexer cannot be invoked without 'new'" #75

Open queenlixiaoman opened 3 years ago

queenlixiaoman commented 3 years ago

$antlr4 -Dlanguage=JavaScript SplParser.g4

Generate file:SplParserLexer.js.

In SplParserLexer.js codes:

function SplParserLexer(input) { antlr4.Lexer.call(this, input); this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache()); return this; }

Browser error:"TypeError: Class constructor Lexer cannot be invoked without 'new'"

How to solve it,please?