The syntax of many programming languages are defined by grammars that can be parsed with an LALR ( 1 ) parser, and for this reason LALR parsers are often used by compilers to perform syntax analysis of source code.
12.
With the syntax analysis adrift in a fog of superposed states, should an error be encountered ( that is, a token is found that cannot be fitted into any valid syntactic frame ) the production of a helpful message can be difficult.
13.
Syntax analysis can be, depending on the language-you generally express the syntax formally in Backus Naur Form, and then construct a parser ( very often a LALR parser ) to turn the token stream into an abstract syntax tree; as the LALR article notes, generating that parser from the BNF can be a bit scary ( which is why so many people use a LALR parser generator like yacc to do it ).