~ubuntu-branches/ubuntu/karmic/coccinelle/karmic

« back to all changes in this revision

Viewing changes to parsing_cocci/context_neg.ml

  • Committer: Bazaar Package Importer
  • Author(s): Євгеній Мещеряков
  • Date: 2009-05-11 15:32:24 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090511153224-1odv41d4dkr3y80v
Tags: 0.1.8.deb-2
Use common install Makefile target for both native and bytecode
build. This hopefully fixes FTBFS on bytecode archs 

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
  let bind x y = () in
140
140
  let option_default = () in
141
141
  let donothing r k e = k e in
142
 
  let mcode (_,_,info,mcodekind,_) =
 
142
  let mcode (_,_,info,mcodekind,_,_) =
143
143
    match mcodekind with
144
144
      Ast0.PLUS -> insert info.Ast0.pos_info.Ast0.line_start
145
145
    | _ -> () in
228
228
let option_default = (*Bind(Neutral,[],[],[],[],[])*)
229
229
  Recursor(Neutral,[],[],[])
230
230
 
231
 
let mcode (_,_,info,mcodekind,pos) =
 
231
let mcode (_,_,info,mcodekind,pos,_) =
232
232
  let offset = info.Ast0.pos_info.Ast0.offset in
233
233
  match mcodekind with
234
234
    Ast0.MINUS(_) -> Token(AllMarked,offset,mcodekind,[])
236
236
  | Ast0.CONTEXT(_) -> Token(NotAllMarked,offset,mcodekind,[offset])
237
237
  | _ -> failwith "not possible"
238
238
 
239
 
let neutral_mcode (_,_,info,mcodekind,pos) =
 
239
let neutral_mcode (_,_,info,mcodekind,pos,_) =
240
240
  let offset = info.Ast0.pos_info.Ast0.offset in
241
241
  match mcodekind with
242
242
    Ast0.MINUS(_) -> Token(Neutral,offset,mcodekind,[])
246
246
 
247
247
(* neutral for context; used for mcode in bef aft nodes that don't represent
248
248
anything if they don't contain some information *)
249
 
let nc_mcode (_,_,info,mcodekind,pos) =
 
249
let nc_mcode (_,_,info,mcodekind,pos,_) =
250
250
  let offset = info.Ast0.pos_info.Ast0.offset in
251
251
  match mcodekind with
252
252
    Ast0.MINUS(_) -> Token(AllMarked,offset,mcodekind,[])
403
403
        (* cases for everything with extra mcode *)
404
404
      | Ast0.FunDecl((info,bef),_,_,_,_,_,_,_,_)
405
405
      | Ast0.Decl((info,bef),_) ->
406
 
          bind (nc_mcode ((),(),info,bef,())) (k s)
 
406
          bind (nc_mcode ((),(),info,bef,(),-1)) (k s)
407
407
      | Ast0.IfThen(_,_,_,_,_,(info,aft))
408
408
      | Ast0.IfThenElse(_,_,_,_,_,_,_,(info,aft))
409
409
      | Ast0.Iterator(_,_,_,_,_,(info,aft))
410
410
      | Ast0.While(_,_,_,_,_,(info,aft))
411
411
      | Ast0.For(_,_,_,_,_,_,_,_,_,(info,aft)) ->
412
 
          bind (k s) (nc_mcode ((),(),info,aft,()))
 
412
          bind (k s) (nc_mcode ((),(),info,aft,(),-1))
413
413
      | _ -> k s
414
414
 
415
415
) in
432
432
 
433
433
(* this is just a sanity check - really only need to look at the top-level
434
434
   structure *)
435
 
let equal_mcode (_,_,info1,_,_) (_,_,info2,_,_) =
 
435
let equal_mcode (_,_,info1,_,_,_) (_,_,info2,_,_,_) =
436
436
  info1.Ast0.pos_info.Ast0.offset = info2.Ast0.pos_info.Ast0.offset
437
437
 
438
438
let equal_option e1 e2 =