fe11x / python-ply-mini-java

Mini java parser, built with python ply

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

python-ply-mini-java

The goal for this project is to build a mini java compiler, using python's PLY (Python Lex-Yacc) tool, built by David Beazley. The grammar for the mini java language, can be seen here Mini Java Grammar. This project is it's initial stage, so there's a lot more to cover. Will keep this README updated.

There are three phases to this:

  • Lexer: Already built.
  • Parser: Almost complete, it has a few bugs, that have to do with the way the language grammer is implemented.
  • Abstract Syntax Tree: Under construction, no significant work done.

Directory structure:

├── ply/
│   ├── __init__.py
│   ├── lex.py
│   ├── yacc.py
│   ├── ygen.py
├── tests/
├── .gitignore 
├── ast.py
├── lexer.py
├── parser.py

Lexer

  • The lexer identifies the accepted tokens for the grammar, and builds the lex object.

Parser

  • The parser checks the sintax of the code thats passed to it, notifying of any syntax errors encountered.

About

Mini java parser, built with python ply


Languages

Language:Python 100.0%