-
Notifications
You must be signed in to change notification settings - Fork 58
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
ATN graph cannot be drawn even after code generation. #28
Comments
What happens when you change something and save the grammar. Does it show the little busy animation in the status bar? Does the ATN graph show something useful afterwards? |
Yes, it shows a little busy animation in the status bar after I modify and save the grammar. And I can see new parser files generated. But still cannot see ATN graph. The error is as the screenshot. But I can see rail road diagram. |
Are there any error messages in the Developer Tools console (see help menu)? |
I tried below: What I see: Now I am trying to reinstall the VS Code and the ANTLR plugin. |
Does the call graph show up? Does debugging work? The message you see about no ATN data found means the *.interp files couldn't be loaded. The question is: why? Are they generated and reachable? |
I tried the C# target and Java target with I haven't tried the debugging. But I will try it. Below are my user settings:
|
I just tried the debug feature. There seems to be some issue. My 1st debug settings:
I got this error: My 2nd debug settings:
I guess the But the *.interp file did get generated. See below. |
I just tried reinstall Visual Studio Code and the ANTLR extension. Still the same error. |
That's not a vscode issue. There are several problems at work here. For debugging:
Also for the debugger you need the ATN data. You found the *.interp files in the target folder, right? But for ATN + debugging they must be in the internal |
There was an error in the interpreter file name construction, which is fixed now. Until the next release you can split your combined grammar into individual lexer and parser grammars. This should work. |
Thanks for the quick fix. Looking forward to the new release. |
BTW, I just tried splitting my grammar into individual parser and lexer grammars. Unfortunately, still the same error. It seems the split parser grammar My split grammars: And the 3 interp files: |
Now, that's a situation I hadn't on the radar. You get 3 files because you still have lexer rules in your parser grammar (all the text literals) which cause ANTLR4 to generate that CParserRuleLexer. However, that shouldn't affect the load of the interpreter data. Though, I just found another bug and fixed it. The previous change went a little too far. Can you clone the repo, transpile the TS code and manually copy the SourceContext.js file the extension folder (the one in your home dir, as given in the error screenshot above)? This way you should finally get what you want without waiting for the next release of the extension. |
I am not familiar with TS project. Here is what I tried:
Then I got many errors. Such as:
Then I tried to open it in VS code as workspace. Then run Ctrl+Shift+B. VS Code complains that :
I installed tsc and node, maybe I missed something.
I am learning the TS related knowledge now. |
Mikes-iMac:vscode-antlr4 mike$ npm update
+ vscode@1.1.14
+ @types/node@8.10.0
updated 11 packages in 7.924s
Mikes-iMac:vscode-antlr4 mike$ npm install
> vscode-antlr4@2.0.0 postinstall /Volumes/Extern/Work/projects/vscode-antlr4
> node ./node_modules/vscode/bin/install
Detected VS Code engine version: ^1.17.0
Found minimal version that qualifies engine range: 1.17.0
Fetching vscode.d.ts from: https://raw.githubusercontent.com/Microsoft/vscode/be377c0faf7574a59f84940f593a6849f12e4de7/src/vs/vscode.d.ts
vscode.d.ts successfully installed!
up to date in 2.685s
Mikes-iMac:vscode-antlr4 mike$ npm run compile
> vscode-antlr4@2.0.0 compile /Volumes/Extern/Work/projects/vscode-antlr4
> tsc --outDir ./out/src
Mikes-iMac:vscode-antlr4 mike$ Then in out/src/frontend you can find the transpiled SourceContext.js. |
Below are my try. Bold part are my command inputs. C:\D\Sources.2\github\vscode-antlr4>npm update
C:\D\Sources.2\github\vscode-antlr4>npm install
Detected VS Code engine version: ^1.17.0 C:\D\Sources.2\github\vscode-antlr4>npm run compile
src/backend/ContextSymbolTable.ts(255,38): error TS2554: Expected 0 arguments, but got 1. npm ERR! A complete log of this run can be found in: |
Try all that again. I had some changes not yet published in my antlr4-c3 node module. |
If you like rate the extension on the vscode Marketplace. |
Sure I will rate it 5.😀 |
After I right click a rule and select "Show ATN graph for rule", I only got this:
The text was updated successfully, but these errors were encountered: