lp:coccinelle
- Get this branch:
- bzr branch lp:coccinelle
Branch information
Import details
This branch is an import of the HEAD branch of the Git repository at git://github.com/coccinelle/coccinelle.git.
Last successful import was 3 hours ago.
Recent revisions
- 4993. By Keisuke Nishimura <email address hidden> on 2021-04-03
-
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 <email address hidden>
- 4992. By Keisuke Nishimura <email address hidden> on 2021-03-18
-
parsing_cocci: ast0: Make Attibute in SmPL's AST more general
This patch changes the structure of 'Attribute'. In order to
support __attribute__ later, the current Attribute needs to be
refactored into a more general structure.SmPL's ast structure(current):
__foo => Attribute( __foo) or MetaAttribute (__foo)SmPL's ast structure(
proposed) :
__foo => Attribute( AttrName (__foo) ) or Attribute( MetaAttr (__foo) )C's ast structure(current):
foo => Attribute( foo )C's ast structure(
proposed) :
foo => Attribute( AttrName(foo) )Signed-off-by: Keisuke Nishimura <email address hidden>
- 4991. By Julia Lawall <email address hidden> on 2021-03-06
-
fix typo
Reported-by: Markus Elfring <email address hidden>
- 4986. By Julia Lawall <email address hidden> on 2021-02-19
-
test cases for the fix allowing a dot in a function name
- 4985. By Jaskaran Singh <email address hidden> on 2021-02-19
-
parsing_cocci: parse_cocci: Add TDot to is_permissible_
proto Add TDot to the match ladder in is_permissible_
proto. Fixes GitHub
issue #254.Reported by Luca Weiss
Signed-off-by: Jaskaran Singh <email address hidden>
- 4984. By Julia Lawall on 2021-02-01
-
Simplify constraints on dots that end with an expression
There was originally an idea that a sequence of statements should not
end with an expression. But this is often useful to do, which then
required putting ... when any after the expression. This is probably
undexpected for users, so just drop the constraint.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)