Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on compile antlr4 javascript runtime #124

Open
yaskhan opened this issue Dec 2, 2020 · 0 comments
Open

Error on compile antlr4 javascript runtime #124

yaskhan opened this issue Dec 2, 2020 · 0 comments
Labels

Comments

@yaskhan
Copy link

yaskhan commented Dec 2, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants