~npalix/coccinelle/upstream

« back to all changes in this revision

Viewing changes to engine/asttoctl2.ml

  • Committer: Yoann Padioleau
  • Date: 2007-07-24 11:41:11 UTC
  • Revision ID: git-v1:988f08eed0e8ab05b77fe6198fb0a4ba4e465273
add globals

svn path=/coccinelle/; revision=3023

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
let wrapOr      n (x,y) = wrap n (CTL.Or(x,y))
75
75
let wrapSeqOr   n (x,y) = wrap n (CTL.SeqOr(x,y))
76
76
let wrapAU      n s (x,y) =
77
 
  if !Flag_parsing_cocci.sgrep_mode or !Flag_parsing_cocci.sgrep_mode2
 
77
  if !Flag_parsing_cocci.sgrep_mode or !Flag.sgrep_mode2
78
78
  then wrap n (CTL.EU(CTL.FORWARD,x,y))
79
79
  else wrap n (CTL.AU(CTL.FORWARD,s,x,y))
80
80
(* only used for goto, where we want AU even for sgrep *)
81
81
let wrapAF      n s (x,y) = wrap n (CTL.AF(CTL.FORWARD,s,x))
82
82
let wrapAX      n s x   =
83
 
  if !Flag_parsing_cocci.sgrep_mode or !Flag_parsing_cocci.sgrep_mode2
 
83
  if !Flag_parsing_cocci.sgrep_mode or !Flag.sgrep_mode2
84
84
  then wrap n (CTL.EX(CTL.FORWARD,x))
85
85
  else wrap n (CTL.AX(CTL.FORWARD,s,x))
86
86
let wrapAX_absolute      n s (x)   = wrap n (CTL.AX(CTL.FORWARD,s,x))
973
973
    (List.map statement_list nots, extra @ List.map statement eqs) in
974
974
  let notwhencodes =
975
975
    (* add in after, because it's not part of the program *)
976
 
    if !Flag_parsing_cocci.sgrep_mode or !Flag_parsing_cocci.sgrep_mode2
 
976
    if !Flag_parsing_cocci.sgrep_mode or !Flag.sgrep_mode2
977
977
    then (aftpred n label) :: notwhencodes
978
978
    else notwhencodes in
979
979
  let ender =
984
984
    | Tail ->
985
985
        let exit = endpred n label in
986
986
        let errorexit = exitpred n label in
987
 
        if !Flag_parsing_cocci.sgrep_mode or !Flag_parsing_cocci.sgrep_mode2
 
987
        if !Flag_parsing_cocci.sgrep_mode or !Flag.sgrep_mode2
988
988
        then wrapOr n (exit,errorexit)
989
989
        else exit (* was wrap n CTL.False *) in
990
990
  builder n (guard_to_strict guard)
1715
1715
    wrap(CTL.Or(rest,error_exiter)) in
1716
1716
  
1717
1717
  match (all,
1718
 
         !Flag_parsing_cocci.sgrep_mode or !Flag_parsing_cocci.sgrep_mode2)
 
1718
         !Flag_parsing_cocci.sgrep_mode or !Flag.sgrep_mode2)
1719
1719
  with
1720
1720
    ([],true) -> CTL.EF(dir,rest)
1721
1721
  | ([],false) ->