Skip to content

Latest commit

 

History

History
34 lines (33 loc) · 685 Bytes

README.md

File metadata and controls

34 lines (33 loc) · 685 Bytes

How to build the toy

mkdir build
cd build
cmake ../
make -j 4
cd ..
./build/scc example/main.scc

the output will be an abstract syntax tree like following.

BinaryExpression
*  [x]: Variable
*  [=]: Assignment
*  BinaryExpression
*  *  UnaryExpression
*  *  *  [-]: Negative
*  *  *  [y]: Variable
*  *  [+]: Plus
*  *  BinaryExpression
*  *  *  BinaryExpression
*  *  *  *  BinaryExpression
*  *  *  *  *  [2]: Constant
*  *  *  *  *  [*]: Star
*  *  *  *  *  [3]: Constant
*  *  *  *  [/]: Slash
*  *  *  *  BinaryExpression
*  *  *  *  *  [2]: Constant
*  *  *  *  *  [+]: Plus
*  *  *  *  *  [4]: Constant
*  *  *  [*]: Star
*  *  *  [1]: Constant