Hi Alan,

Here is how we are doing it. Courtesy: Vaibhav Goel from our group.
"
Traverse the AST and create CFG nodes and edges, taking special care for 
branching and looping constructs. For example, on
reaching an 'if' statement, create two separate routes for 'then' and 'else' 
blocks. Similarly, on reaching a 'for' statement,
create a back edge to account for looping.

Surely, this ab initio approach is lengthy and might also get a bit messy once
function calls are in place (which I have not considered for now).

However, I did not come across any alternative way of doing it for ANTLR on the 
net.
"
Thanks,

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Developer.Net
Sent: Thursday, December 02, 2010 12:26 PM
To: [email protected]
Subject: [antlr-interest] Get a Control flow graph(CFG) from the AST

Hello Everyone!

 What I want to do is to get a control flow graph(CFG) from an AST, where each
statement or expression is a unique Node. I was wondering what you would suggest
as the best option to do that. Thanks!

-Alan




List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

::DISCLAIMER::
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to