RE: refining the Synopsis APIs
Stefan Seefeld <[email protected]>
| Newsgroups | gmane.comp.documentation.synopsis |
|---|---|
| Message-ID | <20DCDD8F0FCED411AC4D001083CF504501AA9816@MTL-EXCHANGE> |
> From: Vladimir Prus [mailto:[email protected]] > Probably. I'm only trying to avoid creating extra layers > without pressing > need. Do you think there's such need at the moment? no, and I didn't mean to suggest we should add the 'AST' layer right now. > > My feeling is that for clarity it would be best to keep the > APIs separate > > (yes, I can see use cases where users want to access the > lowest level, such > > as when running tools that control / enforce coding conventions, or > > compute any form of low level metric). > > But that does not require unsafe access. Does any tool need > to replace opening > brace with class declaration, for example? certainly not. However, OpenCxx had been designed to support metaprogramming in terms of language extensions. So the generated parse tree didn't need to conform to standard C++ in every aspect. See for example http://www.csg.is.titech.ac.jp/~chiba/opencxx/html/base.html > Maybe, each node in syntax tree should just be able to > provide "raw" iterator > over all tokens? These would require to be highly intelligent iterators if they had to enforce any syntax-level invariants. Unless you make them const_iterators, which wouldn't cover all the use cases... Regards, Stefan