Newbie question about example 8.4 in TDA4R book

14 views
Skip to first unread message

J Crain

unread,
Feb 9, 2017, 10:01:32 AM2/9/17
to antlr-discussion
I'm trying to learn Antlr4 and working my way thru the examples in the Definitive Reference. All was going well until section 8.4.

I can't complete the example in 8.4 (Validating Program Symbol Usage) due to missing *Scope.java and *Symbol.java files.

I'm assuming that these are not Antlr-generated files and that they should be available on the https://media.pragprog.com/titles/tpantlr2/code/ site like other sources.

Just in case they should have been generated by Antlr4, I'm running OS X 10.12.3 with java 1.8.0_74 (build 1.8.0_74-b02) and using antlr-4.6-complete.jar.

Suggestions appreciated.

Mike Lischke

unread,
Feb 9, 2017, 11:17:57 AM2/9/17
to antlr-di...@googlegroups.com

I'm trying to learn Antlr4 and working my way thru the examples in the Definitive Reference. All was going well until section 8.4.

I can't complete the example in 8.4 (Validating Program Symbol Usage) due to missing *Scope.java and *Symbol.java files.

I'm assuming that these are not Antlr-generated files and that they should be available on the https://media.pragprog.com/titles/tpantlr2/code/ site like other sources.

No, both classes are part of the symbol table implementation. I don't have the source code here to check that, but I guess Ter used his symtab lib for the book: https://github.com/antlr/symtab.


Mike Lischke

unread,
Feb 9, 2017, 11:22:58 AM2/9/17
to antlr-di...@googlegroups.com
I just read that the symbol table code is taken from Chapter 6 of "Language Implementation Patterns" (there's a footnote near the "Validator Architecture" paragraph).

J Crain

unread,
Feb 9, 2017, 11:28:08 AM2/9/17
to antlr-discussion
Thanks, Mike. I obviously over-looked that reference. 
Reply all
Reply to author
Forward
0 new messages