Commit | Line | Data |
---|---|---|
34e49164 C |
1 | // This file illustrates the various items that can be used at the beginning |
2 | // of a semantic patch, or at the beginning of a rule | |
3 | ||
4 | // The following illustrates how to include a file of isomorphisms located | |
5 | // in the default path, as indicated by config. Uncommenting the following | |
6 | // will give and error, because standard.iso is already loaded by default | |
7 | // and it is not allowed to load two isomorphisms with the same name | |
8 | // using <standard.iso> | |
9 | using "headers.iso" // an iso file in the current directory | |
10 | ||
11 | @ rule0 @ | |
12 | @@ | |
13 | ||
14 | - a | |
15 | + b | |
16 | ||
17 | @ | |
18 | rule1 // rule name | |
19 | extends rule0 // inherit the metavariables from rule0 | |
20 | depends on rule0 && !rule0 // now this rule will never be applied ... | |
21 | using "headers2.iso" // more iso files can be included, separated by commas | |
22 | disable three, drop_cast // isos should apply to f and x, but not m | |
23 | @ | |
24 | @@ | |
25 | ||
26 | ( | |
27 | - f(3) | |
28 | + fff(12) | |
29 | | | |
30 | - x(3) | |
31 | + xxx(12) | |
32 | | | |
33 | - m(3) | |
34 | + mmm(12) | |
35 | ) | |
36 | ||
37 | @ | |
38 | rule2 // rule name | |
39 | extends rule0 // inherit the metavariables from rule0 | |
40 | depends on rule0 && !rule0 // now this rule will never be applied ... | |
41 | using "headers2.iso" // more iso files can be included, separated by commas | |
42 | @ | |
43 | @@ | |
44 | ||
45 | ( | |
46 | - f(3) | |
47 | + fff(12) | |
48 | | | |
49 | - x(3) | |
50 | + xxx(12) | |
51 | | | |
52 | - m(3) | |
53 | + mmm(12) | |
54 | ) |