C++ template disambiguation with Transformers Attribute Grammars


Revision as of 17:07, 9 January 2018 by Bot (talk | contribs) (Created page with "{{CSIReport | authors = Warren Seine | title = C++ template disambiguation with Transformers Attribute Grammars | year = 2008 | number = 0811 | abstract = C++ is a context-sen...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


C++ is a context-sensitive language that can be parsed using a context-free but ambiguous grammar. Disambiguation is then required to select the unique semantically-valid parse tree. Transformers, a framework for C++ program transformation, uses attribute grammars to achieve that stage. One of the hardest ambiguity in the language is related to metaprogramming. In so far as code is generated when templates are instanciated, types are not fully known at the declaration site. Therefore, type-checking is needed to perfectly handle templates, and it poses a real challenge. This report focuses on template disambiguationdetailing the problems and how to resolve it, in order to provide a better platform for source manipulation.