Hi,<br><br>This is regarding the usage of the Puma library. <br><br>The goal I intended to achieve is to find the starting and ending nodes/tokens on the AST for a specific scope. <br><br>So, here are the steps I've taken:
<br>1. produce the parse tree<br> Puma::CCParser parser;<br> Puma::CTranslationUnit* tu = parser.parse(*unit, project);<br>2. conduct further semantic analysis<br> Puma::CCSemVisitor semantics(err);<br> semantics.run
(tu->tree());<br>3. I am interested in "attributes", so I use an "attribute" (generally a variable) for instance. I tried to get the info I expected. <br>3.1 I obtained a pointer to the attribute info from the class database thru
<br> "Puma::CAttributeInfo *pAttrInfo" <br>3.2 I obtained a pointer to the scope info of this attribute thru<br> "Puma::CScopeInfo * pScopeInfo = pAttrInfo->ObjectInfo()->Scope()"<br>3.3 I obtained a pointer to source info for the above scope thru
<br> "Puma::CSourceInfo * pSrcInfo = pScopeInfo->SourceInfo()"<br>3.4 (where the problem lies) I tried to get the start token of this scope thru <br> "Puma::CT_Token * pCTToken = pSrcInfo->StartToken()",
<br> YET I kept receiving a null pointer for pCTToken.<br><br>If anyone knows how to address problem, please show me the right steps. Thanks a lot!<br><br>Terry Yang<br>Computer Security Laboratory<br>Concordia Institute for Information Systems Security
<br> <br>