[cfe-dev] Statements that end with ;

Mohammad Adil madil90 at gmail.com
Fri Nov 16 17:09:57 PST 2012


Hi,
   I need to rewrite at the end of line. In order for the edited code to
compile, I must ensure that I write after a ";" character. I just need to
find that character. I have a ParentMap that has all the statements. How
can I figure out which type of statements have a ";" at the end and which
don't? (I just need to differentiate these two types)

Regards,
Adil


On Sat, Nov 17, 2012 at 2:09 AM, Mohammad Adil <madil90 at gmail.com> wrote:

> Hi,
>    I think I didn't state my question correctly. I meant that is there
> some way to visit statements that end with ";" and are executed in one
> execution cycle. I just want to identify whether a statement started after
> a ";" and ended with a ";". e.g.
>
> int a;
>
> a = a + 2;
>
>    I only want to visit these two lines. How can I tell these two
> statements apart from things like DeclRefExpr which need to have a parent
> statement that includes them (DeclRefExpr is not a statement type that can
> be executed)
>
> Regards,
> Adil
>
>
> On Sat, Nov 17, 2012 at 1:59 AM, Yang Chen <chenyang at cs.utah.edu> wrote:
>
>> madil90 wrote:
>>
>>> Hi,
>>>   I need to identify statements that end with ";". I mean, how does clang
>>> represent a statement that is executed independently e.g.
>>>
>>>
>>
>> You can check all statement classes here:
>>
>> http://clang.llvm.org/doxygen/**classclang_1_1Stmt.html<http://clang.llvm.org/doxygen/classclang_1_1Stmt.html>
>>
>>  int a;    // what type of statement is this?
>>>
>>>
>>
>> I assume you define ``a'' as a local variable, then ``int a;'' is a
>> DeclStmt.
>>
>>  a = a + 2;   // or this?
>>>
>>>
>>
>> It's a BinaryOperator -
>>
>> http://clang.llvm.org/doxygen/**classclang_1_1BinaryOperator.**html<http://clang.llvm.org/doxygen/classclang_1_1BinaryOperator.html>
>>
>> - Yang
>>
>>  Regards,
>>> Adil
>>>
>>>
>>>
>>> --
>>> View this message in context: http://clang-developers.42468.**
>>> n3.nabble.com/Statements-that-**end-with-tp4028311.html<http://clang-developers.42468.n3.nabble.com/Statements-that-end-with-tp4028311.html>
>>> Sent from the Clang Developers mailing list archive at Nabble.com.
>>> ______________________________**_________________
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/**mailman/listinfo/cfe-dev<http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev>
>>>
>>>
>>
>>
>
>
> --
> Mohammad Adil
> LUMS SSE
>
>


-- 
Mohammad Adil
LUMS SSE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121117/0644a8c9/attachment.html>


More information about the cfe-dev mailing list