Comments (10)
It should start debugging the grammar you have specified in the launch config. Maybe it tries to start with the current grammar instead? You probably still have the launch config active. Try switching to a grammar tab and start again. If that works, there might be a bug in the debugger session creation.
from vscode-antlr4.
Hello Mike,
I tried debugging both from 'mmmTable.g4' and from 'mmm_Table.txt'.
getting the same result.
What do you mean by "You probably still have the launch config active", as the debugger is active on the background ? restarted vscode and tried again...
OUTPUT: _[debug] No lexer interpreter data found at _
from vscode-antlr4.
If you see that "no interpreter data found" message it means that you should trigger a re-creation of that, by changing your grammar and saving it. You can also try to remove .antlr
folder beside your grammar and then do the re-creation.
By "having the config active" I meant that this was your active editor tab. My suggestion was to switch to your grammar tab and try again to start debugging. This shouldn't be necessary as you have given a grammar (double check the path is correct!), but at least is worth a try.
from vscode-antlr4.
I renamed both lexer and grammar files, deleted .antlr
, restart VSCode, and it suddenly started working. Next I got an error along the lines of cannot read properties of undefined (reading inputStream)
, but this was also fixed by restarting VSCode. Now I get an error saying the grammar contains issues
, which I assume means that the problem is on my end now.
After typing this, I tabbed back into VSCode and pressed F5, and I got hit with the same debugger creation failed
message again. Restarting VSCode fixes it until I open the parser file. After the parser file has been opened once, the error repeats, until VSCode is restarted and parser file is kept unopened.
(By parser and lexer files, I'm referring to files that have parser grammer myp;
and lexer grammar myt;
, one of each).
Heres my launch.json:
{
"version": "2.0.0",
"configurations": [
{
"name": "Debug ANTLR4 grammar",
"type": "antlr-debug",
"request": "launch",
"input": "input.txt",
"grammar": "myp.g4",
"startRule": "file",
"printParseTree": true,
"visualParseTree": true
}
]
}
VSCode settings:
{
"antlr4.generation": {
"mode": "internal",
"language": "Java",
"listeners": true,
"visitors": false
}
}
For the record I'm very new to ANTLR
from vscode-antlr4.
Hi,
same settings is working on Windows 10.
On windows 11 same settings, got to a point where I trigger the debug and nothing happens, no Error no output. Tried all the above.
from vscode-antlr4.
I also got no output no error, when I pressed F5 in a non-.g4 file. Though this didn't happen always, I dont remember the exact circumstances.
I'm on Windows 11 with WSL2 Ubuntu.
from vscode-antlr4.
@mike-lischke any insights on differences for win 10 and win 11 ? any clue for what it might be ?
from vscode-antlr4.
I also got problems on Windows 11, specifically the error "Could not launch debug session: the grammar contains issues.", I've tried deleting the directory and restarting in a lot of ways vscode but the same error kept appearing, and I know my grammar file and settings for the setup for debugging are fine because they are the literal same in another computer I have which has WInodws 10, and the extension works fine in there, it seems Windows 11 somehow gives problem to this extension
from vscode-antlr4.
Ok I've found the solution to it that may work for someone that is struggling with this
Basically the error I got previously was actually happening in my Windows 10 pc too, the thing is that in the launch.json, the "grammar" value had a really long path in my case, but if I copy and pasted the same exact grammar to another file, BUT placed the file in a simpler location like 'C:/Desktop', and specified that location to the launch.json, then the antlr extension started working and printing the parse tree
And now this extension works both in Windows 10 and 11, also the "input" value did not need to relocate the file
I don't know the exact problem, but that is the solution I found
from vscode-antlr4.
Sounds like either a too long path or some special chars in it, that are not visible (e.g. zero width characters, which got removed when you copy/pasted the path around).
from vscode-antlr4.
Related Issues (20)
- No rule selected HOT 4
- Navigation not working HOT 6
- Update to 2.4.2 broke project HOT 7
- Split grammar not generating properly, and can't debug HOT 3
- Cannot build .vsix HOT 2
- Extension does not work on Windows HOT 2
- TypeError: Cannot read properties of undefined (reading 'toString') HOT 1
- Formatting HOT 2
- railroad diagram: empty route and repeating routes are ambigious HOT 3
- Tokens not found if there's no lexer file, but only a .tokens file
- Bug: Generate valid input for rule ignores negation
- How can I have my parser tree graphical visualizations with my antlr grammar file and input for parse? HOT 3
- Visual parse tree not showing for version 2.4.5 HOT 5
- A Bottom part of big digram can be hidden. HOT 15
- [Internal Error] Unhandled error message (code 50, message: syntax error: mismatched character '<EOF>' expecting ''' Please file a bug report at https://github.com/mike-lischke/vscode-antlr4/issues) HOT 5
- [Feature Request] live tester HOT 4
- implicit token command not found HOT 1
- Feature/Bug: Disable cache for Parse Tree HOT 8
- Changing token.type is invalid HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-antlr4.