As we've seen, a typical task of system programming is processing formal languages. Several kinds of operations are customarily performed in such formal languages. The most typical ones are listed here:
- To check the syntax validity of a line or of a file
- To format a file according to formatting rules
- To execute a command written in a command language
- To interpret a file written in a programming language—that is, execute it immediately
- To compile a file written in a programming language—that is, translate it into another programming language, such as an assembly language or a machine language
- To translate a markup file into another markup language
- To render a markup file in a browser
All these operations have in common the first step of the procedure—parsing. The process of examining a string to extract its structure according to the grammar is called parsing. There are at least three kinds of possible parsing...