Skip to content

Error on compile antlr4 javascript runtime #124

@yaskhan

Description

@yaskhan

Hello. I'm compile that https://github.com/antlr/antlr4/tree/master/runtime/JavaScript
and i get error:

[warning] 'InterpreterRuleContext' is defined but never used. line 218 column 7 in file src\antlr4\ParserRuleContext.js
C:\Users\Professional\AppData\Roaming\npm\node_modules\nectarjs\node_modules\@babel\core\lib\transformation\index.js:45
    throw e;
    ^

TypeError: unknown: Cannot read property 'raw' of undefined
    at PluginPass.UnaryExpression (C:\Users\Professional\AppData\Roaming\npm\node_modules\nectarjs\compiler\native\visitor\plugin\UnaryExpression.js:56:52)
    at newFn (C:\Users\Professional\AppData\Roaming\npm\node_modules\nectarjs\node_modules\@babel\traverse\lib\visitors.js:175:21)
    at NodePath._call (C:\Users\Professional\AppData\Roaming\npm\node_modules\nectarjs\node_modules\@babel\traverse\lib\path\context.js:55:20)
    at NodePath.call (C:\Users\Professional\AppData\Roaming\npm\node_modules\nectarjs\node_modules\@babel\traverse\lib\path\context.js:42:17)
    at NodePath.visit (C:\Users\Professional\AppData\Roaming\npm\node_modules\nectarjs\node_modules\@babel\traverse\lib\path\context.js:92:31)
    at TraversalContext.visitQueue (C:\Users\Professional\AppData\Roaming\npm\node_modules\nectarjs\node_modules\@babel\traverse\lib\context.js:115:16)
    at TraversalContext.visitSingle (C:\Users\Professional\AppData\Roaming\npm\node_modules\nectarjs\node_modules\@babel\traverse\lib\context.js:84:19)
    at TraversalContext.visit (C:\Users\Professional\AppData\Roaming\npm\node_modules\nectarjs\node_modules\@babel\traverse\lib\context.js:143:19)
    at Function.traverse.node (C:\Users\Professional\AppData\Roaming\npm\node_modules\nectarjs\node_modules\@babel\traverse\lib\index.js:82:17)
    at NodePath.visit (C:\Users\Professional\AppData\Roaming\npm\node_modules\nectarjs\node_modules\@babel\traverse\lib\path\context.js:99:18) {
  code: 'BABEL_TRANSFORM_ERROR'
}

to compile i just chage this file https://github.com/antlr/antlr4/blob/master/runtime/JavaScript/src/antlr4/tree/index.js
i,m replace three dots with:

const Tree = require('./Tree');
const Trees = require('./Trees');
module.exports = {Tree,
 	RuleNode,
	ErrorNode,
	TerminalNode,
	ErrorNodeImpl,
	TerminalNodeImpl,
	ParseTreeListener,
	ParseTreeVisitor,
	ParseTreeWalker,
	INVALID_INTERVAL,
Trees}

I'm call like that: nectar --prepare src/antlr4/index.js
or
nectar --generate -o out src/antlr4/index.js

NectarJS v0.7.112
Windows 10 (x64), mingw not installed yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions