coccinelle/coccinelle — Issue #6: Support for alternative display format of selection results
Author: elfring
Created: 2011-12-25 03:00:48+00:00
State: open

The semantic patch language has got the capability that [interesting details can be displayed from source code by the corresponding tool "spatch" when a selection is marked with an asterisk to specify a semantic match](http://coccinelle.lip6.fr/docs/main_grammar004.html "Specification of a semantic match"). The output is [a kind of difference display](http://en.wikipedia.org/wiki/Diff#Unified_format "selected source code lines") which shows selected lines as if they would be deleted. The minus character is used at the beginning of each affected line for this purpose while it is also used in diff headers as "---". I find that this technical detail results in the need to apply context-dependent processing with the shown data format. The corresponding peculiarities are handled by a tool like "[patch](http://en.wikipedia.org/wiki/Patch_%28Unix%29 "Application of patches")". I would like to avoid such software challenges for automatic and safe processing.

I suggest to offer an alternative display which will contain the following fields from [source location information](http://cocci.ekstranet.diku.dk/wiki/doku.php?id=source_location_information "source code position") in a format that is similar to [comma-separated values files](http://en.wikipedia.org/wiki/Comma-separated_values#Lack_of_a_Standard "").
- name for a selected source file
- line number
- source code fragment from the match

Would you like to support the [export of such tabular data](http://en.wikipedia.org/wiki/Table_%28information%29 "Clarification for data exports formats") in an easy way?