Parsing
In this chapter, you will learn how to take individual words and punctuation, lexemes, and group them into larger programming constructs, such as expressions, statements, functions, classes, and packages. This task is called parsing. The code module is called a parser. You will make a parser by specifying syntax rules using grammars, and then using a parser generator tool that takes your language grammar and generates a parser for you. We will also look at writing useful syntax error messages.
This chapter covers the following main topics:
- Syntax analysis
- Context-free grammars
- Using iyacc and BYACC/J
- Writing a parser for Jzero
- Improving syntax error messages
We will review the technical requirements for this chapter, and then it will be time to refine your ideas of syntax and syntax analysis.