jszheng / py3antlr4book Goto Github PK
View Code? Open in Web Editor NEWCovert ANTLR4 book source code to Python3 version.
Covert ANTLR4 book source code to Python3 version.
It seems that the GUI Version of the tree with pygrun cannot be displayed, at least I could not run it. It seems that also the -t option is necessary to even have a chance to view the GUI Version. I have little experience with Qt but i would be happy to help in testing.
Otherwise I suggest to remove the -g option completely.
Last char missing after beautifying lisp-like code in pygrun.
for i in range(1, len(in_string) - 1):
should be
for i in range(1, len(in_string)):
Is a minor issue but, should the title of this project be Covert ANTLR4 book source code to Py4 version.
maybe Py4 is a typo (?)
For this example.
What is bat-file mentioned in README and what is alias for pygrun?
Would be great to have a PyQt5 version, I'm having 23483 problems installing pyqt4 on Mojave
when i run pygrun Hello r --tokens input.txt
Traceback (most recent call last):
File "/home/hehongbin/桌面/py3antlr4book-master/bin/pygrun", line 178, in
module_lexer = import(lexerName, globals(), locals(), lexerName)
File "/home/hehongbin/.local/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "/home/hehongbin/桌面/py3antlr4book-master/01-Hello/./HelloLexer.py", line 25, in
class HelloLexer(Lexer):
File "/home/hehongbin/桌面/py3antlr4book-master/01-Hello/./HelloLexer.py", line 27, in HelloLexer
atn = ATNDeserializer().deserialize(serializedATN())
File "/usr/local/lib/python3.8/dist-packages/antlr4/atn/ATNDeserializer.py", line 28, in deserialize
self.checkVersion()
File "/usr/local/lib/python3.8/dist-packages/antlr4/atn/ATNDeserializer.py", line 50, in checkVersion
raise Exception("Could not deserialize ATN with version " + str(version) + " (expected " + str(SERIALIZED_VERSION) + ").")
Exception: Could not deserialize ATN with version (expected 4).
this question arises, how can i solve this question?thanks
I know
Hi,
I tried to use the same python API as Java. For example,
parser.removeErrorListeners()
parser.addErrorListener(VerboseListener())
But, it does not work, and it still uses ConsoleErrorListener with outputs like:
line 1:7 token recognition error at: '('
BTW, I use python3 and antlr4 v4.5.3.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.