jszheng/py3antlr4book
소개
ANTLR4 책의 소스 코드를 Python3 버전으로 변환합니다.
기타 프로젝트측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalpy3antlr4book
Covert ANTLR4 book source code to Python 3 version.
How to use
Windows
- Install Python
- Install antlr4 python3 runtime
pip install antlr4-python3-runtime
- open command and run bin/antlr4.bat
You may need to compile the latest ANTLR4 and put it into bin, modify the bat file
You may also need to use the latest runtime, just copy the source to [PythonDir]\Lib\site-packages\antlr4
Ubuntu
sudo apt install environment-modules
sudo -H pip3 install antlr4-python3-runtime
git clone https://github.com/jszheng/py3antlr4book.git
cd py3antlr4book
# goto https://www.antlr.org/download.html
# download the latest ver
wget https://www.antlr.org/download/antlr-4.7.2-complete.jar
ln -s antlr-4.7.2-complete.jar antlr.jar
module load ./antlr4module
run first example
% antlr4py3 Hello.g4
% pygrun Hello r --tokens input.txt
[@0,0:4='hello',<1>,1:0]
[@1,6:10='world',<2>,1:6]
[@2,11:10='<EOF>',<-1>,1:11]
% pygrun Hello r --tree input.txt
(r hello world)
% python test_hello.py input.txt
(r hello world)
IDE
You can install the best python IDE in the world (no 'one of') from www.jetbrains.com. They provide two community version free of charge and just enough for the experiment here.
The only problem is the tool take a large amount of memory just like all JAVA based IDE, you may not want to open IDEA and PyCharm at the same time. I only install IDEA and install the python community plug-in and also ANTLR4 plug-in to debug the .g4 file.

관련 프로젝트 살펴보기
불러오는 중…