rapid-lang/rapid — pull request #63 by natebrennand (2014-11-30 08:27:29+00:00)
Title: Variables everywhere!

This pull request adds a symbol table to the semantic checker. It guarantees that:

- no variables are redeclared
- variable assignments are to the proper type
- all variables referenced were defined prior to that line

Also, support for `printf` was added.

#### Semantics Workflow

Located in `semantic_check.ml`.

1. An intermediate SAST is generated.
- This SAST is then passed into `var_analysis`.
- `var_analysis` builds a symbol table and rewrites the SAST as it iterates
- re-written parts are currently changing `SId` (untyped variable reference) to a typed variable reference (`SIntVar` or `SStringVar`).
- [see SAST](https://github.com/rapid-lang/rapid/blob/7d09d2b697dd83a3fc37e6301be1fdbc9dd22c52/compiler/sast.mli)

---

works on #60
closes #38