Attribute grammar-style analysis in ANTLR
- View SourceHello there,
I am working on a project to implement the semantic analysis
phase of a compiler using ANTLR. I have working parsers and "blank"
(no-action) tree parsers for each compilation unit.
AFAIK, semantics involves
(1) tree node attribute (a) definition and (b) evaluation
(2) error/warning (a) detection and (b) reporting
1. Can anyone recommend a good book on object-oriented compiler
construction, besides the PCCTS book?
2. Has anyone implemented an "attribute-grammar" style system for ANTLR?
(allowing one to specify on-a per-node-type basis a set of attributes and
actions to calculate their values?)
3. Do I have an advantage by inheriting the blank tree-parsers
and adding actions to only those rules for which I am interested in?
Dr Steven Atkinson, Research Associate
Department of Computer Science and Electrical Engineering
P.O. Box 6109, West Virginia University, Morgantown WV 26506