Coccinelle hosts its code at git://github.com/coccinelle/coccinelle.git.

You can learn more at the project's web page.

Launchpad imports the master branch and you can create branches from it.

You can browse the source code for the development focus branch or get a copy of the branch using the command:
bzr branch lp:coccinelle

Coccinelle has 1 active branch owned by 1 person. There were 1 commit by 1 person in the last month.

Bazaar branches

Name Status Last Modified Last Commit
lp:coccinelle
Series: trunk
1 Development 2021-04-03 14:00:06 UTC 2021-04-03
4993. parsing_cocci: ast0: Add support for ...

Author: Keisuke Nishimura
Revision Date: 2021-04-03 14:00:06 UTC

parsing_cocci: ast0: Add support for __attribute__ with one argument

This series adds support for __attribute__ with one argument.

Current Coccinelle is having a problem with attrs and endattrs in C
parser.
Here is an example of AST for C.
 #1
struct { int i;} __attr;

attrs = []
endattrs = [ __attr]

 #2
struct { int i;} __attribute__((pack));

attrs = [__attribute__((pack))]
endattrs = []

__attribute__((pack)) in #2 should be interpreted as attrs.

This problem results from the implementation of parsing_c/parser_c.mly
and parsing_c/parsing_hacks.ml.

The current implementation in parsing_hacks.ml only checks the next
couple of tokens and whether it can match some regular expressions to
replace a specific token type for another token type. (e.g. regarding
endattrs, Coccinelle will check "^__.*$" and whether the next token is
";" or "=" etc..., and replace TIdent for TMacroEndAttr).
And parser_c.mly attempt to create AST based on the token processed
by parsing_hacks.ml.

To solve this problem, the algorithm used in current parsing_hacks.ml
needs to be revised totally. Maybe we can also solve it by changing
parser_c.mly. But it requires more complex works and a lot of time.

Signed-off-by: Keisuke Nishimura <mumumu0722@gmail.com>

11 of 1 result
You can't create new branches for Coccinelle.