Simplified lexer rules and added some BNF.