(*
- * Copyright 2010, INRIA, University of Copenhagen
+ * Copyright 2012, INRIA
+ * Julia Lawall, Gilles Muller
+ * Copyright 2010-2011, INRIA, University of Copenhagen
* Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
* Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
* Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
raise
(Semantic_cocci.Semantic
"can't inherit the freshness of an identifier")
- | Ast.MetaListlenDecl((rule,name)) ->
- (match lookup rule name with
- Ast.MetaListlenDecl(_) -> ()
- | _ ->
- raise
- (Semantic_cocci.Semantic
- ("incompatible inheritance declaration "^name)))
| Ast.MetaTypeDecl(Ast.NONE,(rule,name)) ->
(match lookup rule name with
Ast.MetaTypeDecl(_,_) -> ()
raise
(Semantic_cocci.Semantic
("incompatible inheritance declaration "^name)))
+ | Ast.MetaListlenDecl((rule,name)) ->
+ (match lookup rule name with
+ Ast.MetaListlenDecl(_) -> ()
+ | _ ->
+ raise
+ (Semantic_cocci.Semantic
+ ("incompatible inheritance declaration "^name)))
| Ast.MetaParamDecl(Ast.NONE,(rule,name)) ->
(match lookup rule name with
Ast.MetaParamDecl(_,_) -> ()
raise
(Semantic_cocci.Semantic
("incompatible inheritance declaration "^name)))
+ | Ast.MetaConstDecl(Ast.NONE,(rule,name),ty) ->
+ (match lookup rule name with
+ Ast.MetaConstDecl(_,_,ty1) when type_irrelevant or ty = ty1 -> ()
+ | _ ->
+ raise
+ (Semantic_cocci.Semantic
+ ("incompatible inheritance declaration "^name)))
| Ast.MetaErrDecl(Ast.NONE,(rule,name)) ->
(match lookup rule name with
Ast.MetaErrDecl(_,_) -> ()
raise
(Semantic_cocci.Semantic
("incompatible inheritance declaration "^name)))
+ | Ast.MetaDeclDecl(Ast.NONE,(rule,name)) ->
+ (match lookup rule name with
+ Ast.MetaDeclDecl(_,_) -> ()
+ | _ ->
+ raise
+ (Semantic_cocci.Semantic
+ ("incompatible inheritance declaration "^name)))
+ | Ast.MetaFieldDecl(Ast.NONE,(rule,name)) ->
+ (match lookup rule name with
+ Ast.MetaFieldDecl(_,_) -> ()
+ | _ ->
+ raise
+ (Semantic_cocci.Semantic
+ ("incompatible inheritance declaration "^name)))
+ | Ast.MetaFieldListDecl(Ast.NONE,(rule,name),len_name) ->
+ (match lookup rule name with
+ Ast.MetaFieldListDecl(_,_,_) -> ()
+ | _ ->
+ raise
+ (Semantic_cocci.Semantic
+ ("incompatible inheritance declaration "^name)))
| Ast.MetaStmDecl(Ast.NONE,(rule,name)) ->
(match lookup rule name with
Ast.MetaStmDecl(_,_) -> ()
raise
(Semantic_cocci.Semantic
("incompatible inheritance declaration "^name)))
- | Ast.MetaConstDecl(Ast.NONE,(rule,name),ty) ->
- (match lookup rule name with
- Ast.MetaConstDecl(_,_,ty1) when type_irrelevant or ty = ty1 -> ()
- | _ ->
- raise
- (Semantic_cocci.Semantic
- ("incompatible inheritance declaration "^name)))
| Ast.MetaPosDecl(Ast.NONE,(rule,name)) ->
(match lookup rule name with
Ast.MetaPosDecl(_,_) ->