Generating Parsers with JavaCC, Second Edition
Table of Contents
- Chapter 1. Introduction to JavaCC
- What is JavaCC?
- Installing JavaCC
- Running JavaCC (command line, Ant, Maven, IDEs)
- JavaCC and ANTLR
- Chapter 2. Tokenizing
- The Tokenizing Process
- Generated Files
- Tokens and Regular Expressions
- The SKIP Regular Expression Production
- The MORE Regular Expression Production
- The SPECIAL_TOKEN Regular Expression Production
- Lexical Actions
- Lexical States
- Tokenizer Options
- Chapter 3. Parsing
- Parsing Overview
- Grammar Construction
- Lookahead
- Change Tracking
- Parser Options
- Chapter 4. JJTree
- Why JJTree?
- A Simple Calculator
- A Simple Abstract Syntax Tree
- Visitors and Visiting
- Customizing the AST
- JJTree Internals
- An Alternative: Java Tree Builder (JTB)
- JJTree Options
- Chapter 5. JJDoc
- Documenting Your Grammar
- Running JJDoc
- Passing JavaDoc Through a Grammar
- JJDoc Options
- Chapter 6. JavaCC and Unicode
- What's Unicode?
- Escaping Unicode Characters
- Unicode Characters and Encodings
- Skipping Unicode Characters
- Cleaner Error Messages
- Avoid UNICODE_INPUT
- Beyond the BMP
- Chapter 7. Error Handling
- Parsing Problem Data
- Tokenizing Errors
- Parsing Errors
- Tree Building Errors
- Chapter 8. Case Study: The JavaCC Grammar
- Examining the JavaCC Grammar
- Options and Headers
- Lexical Specification
- Syntactic Specification
- Chapter 9. Testing JavaCC Parsers
- Benefits of Automated Testing
- Introduction to JUnit
- Testing a Tokenizer
- Testing a Parser
- Testing the AST
- Testing the AST with XPath
- Chapter 10. JavaCC and Eclipse
- Why Use an Integrated Development Environment?
- Installation
- Basic Operation
- Chapter 11. Little Grammars
- Some Small Examples
- Web Server Log Files
- Temperatures
- A Little Logo
- Postfix Expressions
- Appendix A. JavaCC Directory Layout and Building JavaCC
- Appendix B. JavaCC Options