注册
登录
智慧物流
>>
create-LR-parser
>>
返回
项目作者:
ahmedibrahimq
项目描述 :
Generating LR parser for a given grammar.
高级语言:
Python
项目主页:
项目地址:
git://github.com/ahmedibrahimq/create-LR-parser.git
创建时间:
2019-05-14T12:48:26Z
项目社区:
https://github.com/ahmedibrahimq/create-LR-parser
开源协议:
MIT License
下载
create-LR-parser
Features
Construct the parsing table
Trace the parse stack of input string
Draw the DFA
Form of grammar
Put each rule in a single line
Rules must be in form
LHS => RHS
NON-TERMINALS
must start with (`)
be UPPERCASE
use only
[A-Z]
and (
_
) for NONTERMINALS
Terminals must be lower case
If there are many rhs of a lhs
put all in the same line
separate them with (|)
e.g.:
X => Y | Z | !εpslon
Use the form (
!εpslon
) for writing epslons
Example grammar:
`E => `T `E_
`E
=> + `T `E
| !εpslon
`T => `F `T_
`T
=> * `F `T
| !εpslon
`F => ( `E ) | id
Requirements
python 3
numpy
Pandas
Matplotlib
Networkx
pygraphviz (optional)
Results