Added lex and error methods + pseudocode