From: Baptiste L. <gai...@fr...> - 2004-08-16 21:10:27
|
Well, one of the purpose behind dumpast was to be able to carefully review the output of the c++ parser on some 'real' life sources. I managed to find some (unplanned) parsing issue due to the fuzzy nature of the parser (it doesn't know about types): --- 1) CTag* newtag = new CTag(searchresult->taglist[i]->tag); Is not parsed as a declaration, but an expression were CTag and newtag are variable (a*b) 2) CBarShader CPartFile::s_LoadBar(PROGRESS_HEIGHT); Is parsed as a declaration of a function pointer instead of a declaration with a constructor (assumes that PROGRESS_HEIGHT is a type). --- The first issue is particularly annoying. None of thoses issues have simple fixes (would require to make the parser knowing about type in some way). While the parser is great for prototyping, I would trust production work on it. That being said, it still usefull for prototyping and did provide interesting input on how to mix preprocessing, c++ parsing and refactoring. I started looking into ANTLR to implement a serious parser with type handling last week. I'm currently toying with the tinyc grammar to get features similar to our framework for ast manipulations and ast to source conversion. Baptiste. |