[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop
Subject:    Re: Usages split into read/write?
From:       Gunther Piez <gpiez () web ! de>
Date:       2010-06-26 9:00:03
Message-ID: 201006261100.03694.gpiez () web ! de
[Download RAW message or body]

On Saturday 26 June 2010 00:01:53 Nicolas Alvarez wrote:

> I think it would be somewhat hard to make the parser to split usages into
> those categories...

Yes, probably. But not harder than writing a C++ parser at the first hand ;-) 
Just look at it from the view of the processor.

> int foo=0; // declaration of foo
And initialization. This falls in the "write" category, maybe subcategory 
"init".

> foo++;     // write? arguably it's reading too
Both read and write. Usually this translates into a read-modify-write 
instruction.

> aaa(foo);  // what is this?
Depends of course from aaa(). If it is a function taking a reference, this is 
neither read or write. A function taking a value parameter is a read. Similiar 
if it is a initialization with a copy constructor.
 
> int* bar = &foo; // or this?
A write/init to bar.
 
> MyClass obj; // declaration of obj
> obj.method(); // what is this doing with obj?
Depends on method. Where is the relation to the question the OP asked? Anyway, 
this is neither a read or write. If there are any read/writes happening in 
method through implictly accessing the *this object, they can be categorized 
there.

- Gunther

_______________________________________________
kdevelop mailing list
kdevelop@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic