twagner@baobab.Berkeley.EDU (Tim Wagner) (05/26/91)
I'm involved in working on an interactive programming language
environment, and we would like to support C++. Thus, I'm looking
for a concise, technical list of "front-end challenges" in C++.
For instance: non-LALR(1)ness of some syntactical constructs,
required feedback between type-checking and lexing,
worse-than-linear type-checking problems,
known semantic ambiguities or problems, etc.
In other words, whatever would give one a headache when writing the
front-end of a compiler. Obvious C problems (like, the PP is a separate
language) may be assumed to be understood.
I would appreciate hearing from people involved in compiler or
development environment work that have come across problems that
would be relevant (and solutions!).
-------More details below here. Casual inspectors may skip.----------
The system in question has the following machinery:
(A) A lexical analyzer based on FLEX, but without the ability to
use yymore() or REJECT.
(B) An LALR(1) parser generator.
(C) A Prolog-like semantic analysis "constraint maintainance" program.
These operate in phases as listed, which is one of the biggest drawbacks
(since, e.g., type-id's require feedback from the semantic analysis
stage to the lexical one in most batch compilers for C and C++).
The system operates incrementally (thus, full lexical stream,
parse tree, and symtab are maintained at all times).
Particular problems that I know of so far include the ARM-mentioned need
for a backtracking parser to disambiguate "T(id)" definitions/expressions
and the above-mentioned feedback loop. I'm also interested in suggestions
for incorporating the preprocessor stage, while preserving its correct
semantics and allowing incremental updates to both the C++ code and
the preprocessor directives.
Repliers may assume I can read the ARM, understand the Dragon book, etc.,
but not that I have deeply analyzed every article ever posted to
this newsgroup. As always, thanx in advance.
-T. Wagner-
------------->twagner@baobab.Berkeley.EDU
------------->Computer Science Dept.
------------->U. C. Berkeley