Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 92d2bfb5a363004a8a399eefe5c79f14 > files > 130

coccinelle-examples-1.0.0-0.rc4.2.fc16.i686.rpm

@anyid@
type t;
identifier id;
@@

t id () {
...
}

@script:python@
x << anyid.id;
@@

print "Identifier: %s" % x

@contains@
type t;
identifier foo ~= ".*foo";
@@

t foo () {
...
}

@script:python@
x << contains.foo;
@@

print "Contains foo: %s" % x

@nocontain@
type t;
identifier foo !~= ".*foo";
@@

t foo () {
...
}

@script:python@
x << nocontain.foo;
@@

print "Does not contain foo: %s" % x

@endsby@
type t;
identifier foo ~= ".*foo$";
@@

t foo () {
...
}

@script:python@
x << endsby.foo;
@@

print "Ends by foo: %s" % x

@beginsby@
type t;
identifier foo ~= "^foo";
@@

t foo () {
...
}

@script:python@
x << beginsby.foo;
@@

print "Begins by foo: %s" % x