(*
-* Copyright 2005-2008, Ecole des Mines de Nantes, University of Copenhagen
-* Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller
-* This file is part of Coccinelle.
-*
-* Coccinelle is free software: you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation, according to version 2 of the License.
-*
-* Coccinelle is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
-*
-* The authors reserve the right to distribute this or future versions of
-* Coccinelle under other licenses.
-*)
+ * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
+ * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
+ * This file is part of Coccinelle.
+ *
+ * Coccinelle is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, according to version 2 of the License.
+ *
+ * Coccinelle is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The authors reserve the right to distribute this or future versions of
+ * Coccinelle under other licenses.
+ *)
(* get a list of all of the constants in the - slice of a SmPL file, to be
if !Flag.sgrep_mode2
then
match ty with
- (_,_,Ast.MINUS(_,_),_) -> [Ast.unwrap_mcode ty]
+ (_,_,Ast.MINUS(_,_,_,_),_) -> [Ast.unwrap_mcode ty]
| _ -> []
else [Ast.unwrap_mcode ty]
| _ -> k e in
V.combiner bind option_default
mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode
- mcode
donothing donothing donothing donothing
ident expression fullType typeC donothing donothing declaration
rule_elem statement donothing donothing donothing
let option_default = [] in
let mcode r (x,_,mcodekind,_) =
match mcodekind with
- Ast.MINUS(_,_) -> [x]
+ Ast.MINUS(_,_,_,_) -> [x]
| _ -> [] in
let other r (x,_,mcodekind,_) = [] in
V.combiner bind option_default
other mcode other other other other other other other other other other
- other
donothing donothing donothing donothing
donothing donothing donothing donothing donothing donothing donothing
bind (fn.V.combiner_anything cur) prev))
[] l in
match mcodekind with
- Ast.MINUS(_,anythings) -> recurse anythings
- | Ast.CONTEXT(_,Ast.BEFORE(a)) -> recurse a
- | Ast.CONTEXT(_,Ast.AFTER(a)) -> recurse a
- | Ast.CONTEXT(_,Ast.BEFOREAFTER(a1,a2)) ->
+ Ast.MINUS(_,_,_,anythings) -> recurse anythings
+ | Ast.CONTEXT(_,Ast.BEFORE(a,_)) -> recurse a
+ | Ast.CONTEXT(_,Ast.AFTER(a,_)) -> recurse a
+ | Ast.CONTEXT(_,Ast.BEFOREAFTER(a1,a2,_)) ->
Common.union_set (recurse a1) (recurse a2)
| _ -> [] in
V.combiner bind option_default
mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode
- mcode
donothing donothing donothing donothing
donothing donothing donothing donothing donothing donothing donothing
donothing donothing donothing donothing donothing
V.combiner bind option_default
mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode
- mcode
donothing donothing donothing donothing
strictident strictexpr strictfullType stricttypeC donothing strictparam
strictdecls strictrule_elem strictstatement donothing donothing donothing
| Ast.AndDep (d1,d2) -> dependent d1 or dependent d2
| Ast.OrDep (d1,d2) -> dependent d1 && dependent d2
| Ast.NoDep -> false
+ | Ast.FailDep -> true
(* ------------------------------------------------------------------------ *)
(function (rest_info,in_plus) ->
function r ->
match r with
- Ast.ScriptRule (_,mv,deps,_) -> (rest_info, in_plus)
- | Ast.CocciRule (nm, (dep,_,_), cur, _) ->
+ Ast.ScriptRule (_,_,_,_)
+ | Ast.InitialScriptRule (_,_) | Ast.FinalScriptRule (_,_) ->
+ (rest_info, in_plus)
+ | Ast.CocciRule (nm, (dep,_,_), cur, _, _) ->
let (cur_info,cur_plus) = rule_fn cur in_plus in
let cur_info =
(* no dependencies if dependent on another rule; then we