This repo is still under development.
Implementing main components of a simple compiler for robotics language.
Grammar of the language is very simple (const, let, while, if, obstacle, move)
Which transform source code into tokens (words, numbers, literals).
Write top-down recursive descent parser for your grammar, which accepts or rejects input.
program -> block
block -> { stmts }
stmts -> stmts1 stmt | ϵ
stmt -> expr; | if(expr) stmts1 | while(expr) stmts1 | block
expr -> rel = expr1 | rel
rel -> rel1 < term | rel1 <= factor | term
term -> (expr) | num
Add syntax tree generation into your parser.
Write machine code generator from the syntax tree.
Dependencies installation
npm installThen prepare by building the project
npm run buildNow start
npm startThe sample source code is located at src/sample.robot.