Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/melvin0008/buildingaparser
BuildingAParser
https://github.com/melvin0008/buildingaparser
Last synced: 7 days ago
JSON representation
BuildingAParser
- Host: GitHub
- URL: https://github.com/melvin0008/buildingaparser
- Owner: melvin0008
- License: apache-2.0
- Created: 2015-09-24T02:25:18.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-28T03:21:30.000Z (over 9 years ago)
- Last Synced: 2024-11-14T05:36:50.194Z (2 months ago)
- Language: Java
- Size: 278 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BuildingAParser
Parser will generate java bytecode for the following grammar
```
program -> decls stmts end
decls -> int idlist ';'
idlist -> id [',' idlist ]
stmts -> stmt [ stmts ]
stmt -> assign ';'| cmpd | cond | loop
assign -> id '=' expr
cmpd -> '{' stmts '}'
cond -> if '(' rexp ')' stmt [ else stmt ]
loop -> for '(' [assign] ';' [rexp] ';' [assign] ')' stmt
rexp -> expr('<'|'>'|'=='|'!=')expr
expr -> term [ ('+' | '-') expr ]
term -> factor [ ('*' | '/') term ]
factor -> int_lit | id | '(' expr ')'
```