~ubuntu-branches/ubuntu/trusty/coccinelle/trusty

« back to all changes in this revision

Viewing changes to parsing_cocci/check_meta.ml

  • Committer: Package Import Robot
  • Author(s): Євгеній Мещеряков
  • Date: 2012-08-19 20:40:52 UTC
  • mfrom: (7.2.8 experimental)
  • Revision ID: package-import@ubuntu.com-20120819204052-8cujknwy6cn8a6h6
Tags: 1.0.0~rc15.deb-1
* New upstream RC 
  - Do not build-depend on libsexplib-camlp4-dev and libextlib-ocaml-dev
    anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
      seed table minus seedval
116
116
  | Ast0.MetaFunc(name,_,_) -> check_table table minus name
117
117
  | Ast0.MetaLocalFunc(name,_,_) -> check_table table minus name
 
118
  | Ast0.AsIdent(id,asid) -> failwith "not generated yet"
118
119
  | Ast0.DisjId(_,id_list,_,_) ->
119
120
      List.iter (ident context old_metas table minus) id_list
120
121
  | Ast0.OptIdent(_) | Ast0.UniqueIdent(_) ->
159
160
  | Ast0.Binary(left,op,right) ->
160
161
      expression ID old_metas table minus left;
161
162
      expression ID old_metas table minus right
 
163
  | Ast0.Nested(left,op,right) ->
 
164
      expression ID old_metas table minus left;
 
165
      expression ID old_metas table minus right
162
166
  | Ast0.Paren(lp,exp,rp) ->
163
167
      expression ID old_metas table minus exp
164
168
  | Ast0.ArrayAccess(exp1,lb,exp2,rb) ->
200
204
      get_opt (expression ID old_metas table minus) w
201
205
  | Ast0.Edots(_,Some x) | Ast0.Ecircles(_,Some x) | Ast0.Estars(_,Some x) ->
202
206
      expression ID old_metas table minus x
 
207
  | Ast0.OptExp(x) | Ast0.UniqueExp(x) ->
 
208
      expression ID old_metas table minus x
203
209
  | _ -> () (* no metavariable subterms *)
204
210
 
205
211
and get_type_name = function
377
383
  | Ast0.Do(d,body,wh,lp,exp,rp,sem) ->
378
384
      statement old_metas table minus body;
379
385
      expression ID old_metas table minus exp
380
 
  | Ast0.For(fr,lp,exp1,sem1,exp2,sem2,exp3,rp,body,_) ->
381
 
      get_opt (expression ID old_metas table minus) exp1;
 
386
  | Ast0.For(fr,lp,first,exp2,sem2,exp3,rp,body,_) ->
 
387
      (match Ast0.unwrap first with
 
388
        Ast0.ForExp(exp1,sem1) ->
 
389
          get_opt (expression ID old_metas table minus) exp1
 
390
      | Ast0.ForDecl (_,decl) ->
 
391
          declaration ID old_metas table minus decl);
382
392
      get_opt (expression ID old_metas table minus) exp2;
383
393
      get_opt (expression ID old_metas table minus) exp3;
384
394
      statement old_metas table minus body
504
514
      mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode
505
515
      donothing donothing donothing donothing donothing donothing
506
516
      donothing donothing donothing donothing donothing donothing donothing
507
 
      donothing donothing in
 
517
      donothing donothing donothing in
508
518
 
509
519
  List.iter fn.VT0.combiner_rec_top_level rules
510
520
 
558
568
      mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode
559
569
      donothing donothing donothing donothing donothing donothing
560
570
      donothing expression typeC donothing donothing declaration statement
561
 
      donothing donothing in
 
571
      donothing donothing donothing in
562
572
 
563
573
  let res =
564
574
    List.sort compare
615
625
  let err_table = make_table (err@ierr) in
616
626
  let other_table = make_table other in
617
627
  let iother_table = make_table iother in
 
628
 
618
629
  add_to_fresh_table fresh;
619
630
  rule old_metas [iother_table;other_table;err_table] true minus;
620
631
  positions [iother_table;other_table] minus;