fix phpdoc for environment, lexer and parser

First commit fixes several phpdocs and also an instanceof check.
The second commit changes an exception from Runtime to Syntax because it doesn't make sense to throw runtime exception during compilation. It also makes it consistent with all the rest (lexer, parser, compiler classes).