Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] IStructure from name

Hi Gerhard,

the method body is part of the AST only.
The C model does not provide this level of detail.

HTH,
Toni

> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of 
> gerhard@xxxxxxxxxxxxxxxxxxx
> Sent: Wednesday, January 07, 2009 10:30 AM
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] IStructure from name
> 
> Hi!
> 
> I'm trying to parse a C++ method body in order to get some 
> information.
> The following code snippet shows my situation:
> 
> class AllTests {
> public:
> 	static CPPUNIT_NS::Test * suite() {
> 		std::auto_ptr<CPPUNIT_NS::TestSuite> suite(new
> CPPUNIT_NS::TestSuite("AllTests") );
> 
> 		// $ECUT-begin-tests$
> 			suite->addTest( SimpleTest::suite() );
> 		// $ECUT-end-tests$
> 
> 		return suite.release();
> 	}
> };
> 
> I have the IStructure of "AllTests" and I want to get all IStructure
> objects that are added within the "suite()" body.
> 
> I tried the following:
> IStructure testSuiteClass = ...
> String testSuiteSource = testSuiteClass.getSource();
> String name = parseNextStructureName(testSuiteSource);
> 
> My question is where can I get the IStructure object when I have the
> "String" name? Or must I use AST parsing here?
> 
> Thanx in advance.
> Gerhard
> 
> 
> 
> 
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 


Back to the top