Refactored grammar analysis code

Like an idiot, I put some semantic analysis code direclty mixed in with the parsing code. This moves it out of there and allows greater "modularity" of parsers.

Signed-off-by: Collin Baker <chbaker0@gmail.com>
Merge branch 'master' of git@github.com:chbaker0/parser-generator.git