(*
- * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
+ * Copyright 2005-2010, 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.
*
(* --------------------------------------------------------------------- *)
(* Modified code *)
+type added_string = Noindent of string | Indent of string
+
type info = { line : int; column : int;
- strbef : (string * int (* line *) * int (* col *)) list;
- straft : (string * int (* line *) * int (* col *)) list }
+ strbef : (added_string * int (* line *) * int (* col *)) list;
+ straft : (added_string * int (* line *) * int (* col *)) list }
type line = int
type meta_name = string * string
(* need to be careful about rewrapping, to avoid duplicating pos info
| GeneratedRulename of string option * dependency *
string list * string list * exists * bool
| ScriptRulename of string * dependency
- | InitialScriptRulename of string
- | FinalScriptRulename of string
+ | InitialScriptRulename of string * dependency
+ | FinalScriptRulename of string * dependency
and ruletype = Normal | Generated
(dependency * string list (* dropped isos *) * exists) * top_level list
* bool list * ruletype
| ScriptRule of string * dependency * (string * meta_name) list * string
- | InitialScriptRule of string (*language*) * string (*code*)
- | FinalScriptRule of string (*language*) * string (*code*)
+ | InitialScriptRule of string (*language*) * dependency * string (*code*)
+ | FinalScriptRule of string (*language*) * dependency * string (*code*)
and dependency =
Dep of string (* rule applies for the current binding *)
| NeverDep of string (* rule never applies for any binding *)
| AndDep of dependency * dependency
| OrDep of dependency * dependency
- | NoDep
+ | NoDep | FailDep
and rule_with_metavars = metavar list * rule
| CaseLineTag of case_line
| ConstVolTag of const_vol
| Token of string * info option
- | Pragma of string list
+ | Pragma of added_string list
| Code of top_level
| ExprDotsTag of expression dots
| ParamDotsTag of parameterTypeDef dots
iso_info = [] }
let make_meta_rule_elem s d (fvs,fresh,inh) =
+ let rule = "" in
{(make_term
- (MetaRuleElem((("",s),no_info,d,NoMetaPos),Type_cocci.Unitary,false)))
+ (MetaRuleElem(((rule,s),no_info,d,NoMetaPos),Type_cocci.Unitary,false)))
with free_vars = fvs; fresh_vars = fresh; inherited = inh}
let make_meta_decl s d (fvs,fresh,inh) =
+ let rule = "" in
{(make_term
- (MetaDecl((("",s),no_info,d,NoMetaPos),Type_cocci.Unitary,false))) with
+ (MetaDecl(((rule,s),no_info,d,NoMetaPos),Type_cocci.Unitary,false))) with
free_vars = fvs; fresh_vars = fresh; inherited = inh}
let make_mcode x = (x,no_info,CONTEXT(NoPos,NOTHING),NoMetaPos)