Site Contents
Wikispaces topics
Wikispaces topics
- Principles for Addons
- Documentation for Addons
- Addon components on this site
- Utility functions
- SiteTOC
- Remove Addon BRs
- Customizations & Fixes
- Notes about Wikispaces
- Tests
- WS features Test
- CSS
- Javascript
- Misc
- Collaboration/CMSs
- Notes on features
- Drupal investigations
- Drupal docs study
- Software development
- Fonts
- Java
- JavaScript/CSS
- Trees and TreeGrids
- JavaScript frameworks
- PHP
- Python
- Organization for common modules
- Packaging and deployment examined
- Packaging and deployment notes
- Distutils, setuptools, pip sleuthing
- Environment and Launcher
- Python features and libraries
- Miscellaneous
- Arduino and AVR
- Delphi
- Matlab
- ANTLR
- Process management
- Microsoft Access
- Linux
- Visio
- Economics
- "Making"
- Laser cutter notes
- Motor notes
- DIY Bio
- Includes
- For pages
- zhtml_pageinfo
- util_authordate (deprec)
- Test
- For pages
- Admin
- Addon Components, V.old
- Left-overs
Table of Contents
Revised by: gwideman, May 31, 2012 1:40 am (9 revisions)
Chapter 5 Building Language Applications
Section 5.1, Decoupling Application Code
Ex 05.01a, PropertyFilePrinter
Ex 05.01b, PropertyFileLoader
This is basically the same code, except using a different descendant of PropertyFileParserEx 05.01c Implementing Applications with Parse Tree Listeners
Ex 05.01d Labeling Rule Alternatives
Section 5.2 Sharing Information among Listener Methods
Ex 05.02a
- p105
- Commands: p107
- Copy
- LExpr.g shows rules with labels
- TestLExpr.java
- Expr-input --> out contains: 1+2*3
- Build
- Failed for same reason as previous example.
- Comment out EvalVisitor class in TestLExpr (for later example?), and also launchvisitor and launchprop code in main()
- I commented out all that, and build succeeded
- Run
- Using rig, produces parse tree. Running TestLExpr produces representation of tree, and "stackresult = 7", the correct answer
- BUT, we need to get the outputs from the parts commented out, so we need to get ANTLR to produce the LExprBaseVisitor class.
- Not explained in this section? Ah, see subsequent section on p107. Run ANTLR with -visitor option.
- OK, builds without error
- Runs and produces output as in PDF
This example includes both the evalVisitor and evalProp code. I guess that exhibits all the code, but it ends up muddling together the two approaches, I think. (I'll probably end up splitting these apart for clarity.)Section 5.3 Loading CSV Data
Ex 05.03
Ex 05.04 Translating JSON to XML
Ex 05.05 Generating a Call Graph (Cymbol)
Ex 05.06 Validating Program Symbol Usage
Chapter 6 Error Reporting and Recovery
Examples based on E.g4 and TestE.java
6.1 A Parade of Errors
6.2 Altering and redirecting ANTLR Error Messages
Ex 06.03 Automatic Error Recovery Strategy: F.g4
Ex 06.03b Recovery from Mismatched Tokens: Back to E.g4
Detour to "install Ghostscript"
... back to the regularly scheduled exercises...
Ex 06.03c Catching failed semantic predicates: Vec.g4
Ex 06.03d Example using Pred.g4
Error Recovery Failsafe: Reuse Ex 06.01
Ex 06.04 Error Alternatives: Call.g4
Ex 06.05 Altering ANTLR's Error Handling Strategy
End of Chapter 6