This project implements a simple attribute grammar, which converts floating point binary number into a decimal one.
The project is written in Reason.
-
S -> N1 . N2
- S.v := N1.v + N2.v
- N1.r := 0
- N2.r := -N2.l
-
N -> N'B
- N.v := N'.v + B.v
- N.l := N'.l + 1
- N'.r := N.r + 1 (N1 case)
- N.r := -N.l (N2 case)
- B.r := N.r
-
N -> Lambda
- N.v := 0
- N.l := 0
-
B -> One
- B.v := 2 B.r
-
B -> Zero
- B.v := 0
The project is sandboxed which means that it has a lot of dependecies, so the installed project size is around 3.2 GB.
I recommend using yarn for the project, but it can be used with npm as well(see Readme-npm).
git clone https://github.com/StrykerKKD/attribute-grammar-example.git
cd attribute-grammar-example
yarn cache clean
yarn install
yarn build
yarn start
I mostly used visual studio code with the Reason extension, but you can use other editors(see Readme-Yarn).