On Fri, 30 Dec 2011, SF Markus Elfring wrote:

Hello!

I have looked once more at the terse descriptions about source code location
information.
http://cocci.ekstranet.diku.dk/wiki/doku.php?id=coccinelle_api_for_ocaml
http://cocci.ekstranet.diku.dk/wiki/doku.php?id=source_location_information

Six attributes are provided in a single data structure which can be mapped to
metavariables with the type "position" in the semantic patch language so far.
All of them are forwarded to script execution environments even when only a few
will be needed for further processing in script rules.

I suggest to introduce a little more grouping there so that a corresponding data
hierarchy could be reused.

File context
\
+- File name of the current source file
|
+- Current function
|
+- Coordinates
   \
    +- Start position
       \
        +- line
        |
        +- column
    |
    +- Start position
       \
        +- line
        |
        +- column


I propose that these groups can be mapped to separate/additional types of SmPL
metavariables so that amount of data that need to be forwarded can be eventually
reduced. I would also prefer that the file name is passed only once instead of
with every access to the position variable.

I imagine that a fine-tuned data exchange will improve the execution speed and
memory allocation requirements of source code analysis processes.

It will not.  It is a constant overhead.  It has no impact.

julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to