implemented stack-parsing and lexical analysis