Release coccinelle-0.1.8
authorCoccinelle <cocci@diku.dk>
Sun, 3 Oct 2010 11:57:53 +0000 (13:57 +0200)
committerRene Rydhof Hansen <rrh@cs.aau.dk>
Sun, 3 Oct 2010 11:57:53 +0000 (13:57 +0200)
** Features:
   - Metavariables now capture the cpp code contained within their definitions
   - When - fragments are separated by ... or nest boundaries in the semantic
     patch, but end up matching adjacent source code, the comments, cpp code
     and whitespace that are between them are not deleted.
   - better parsing of C: do expansion of macros only when needed when
     have actually a parse error and also leverage the definition of macros
     in the parsed file (or in a optional_standard.h file passed as a parameter).
     This should reduce the need for many hardcoded definitions in standard.h
   - new semantics for the -macro_file option, by default now expand macros
     only when necessary. To force use the -macro_file_builtins option instead.
   - a new -extract_macros command line action to help the parser. Works with
     the -macro_file option. e.g.
       $ ./spatch -extract_macros ~/linux > /tmp/alldefs.h
       $ ./spatch -macro_file /tmp/alldefs.h -sp_file foo.cocci -dir ~/linux
   - removed -D macro_file option, not consistent with what -D usually means
   - reattempt to be more efficient for statement metavariables that are just
     placeholders (ie, no modification, no reuse)
   - triples now returned from ctl in sorted order.  The main key is the
     state.  On the other hand, the state order does not always agree with the
     order of appearance in the code.
   - spatch is now less verbose on the things it does yet handle. Less confusing
     for new users.
   - slightly better error report. Thanks to Derek Jones for the suggestion.
   - added the options -linux_spacing and -smpl_spacing.  -linux_spacing
     causes spatch to follow the spacing conventions of Linux, while
     -smpl_spacing causes spatch to follow the spacing in the semantic patch.
     -linux_spacing is the default.
   - more informative error reporting for the already tagged token case.
     Thanks to Erik Hovland for the suggestion.

** Bugfix:
   - better parsing of declare macro at toplevel and in structure.
     cf -text xfield
   - allowing back typedef names for fieldname
   - better printing of else in generated code
   - slightly better type inference for binary operators.
   - clear out declarer names and iterator names between SmPL files (for
     -testall)
   - better parsing and type checking of macro type aliases. Cf -test macro_int16.
     Thanks to Li Yingtong for pointing out the problem.
   - make insert_virtual_positions tail rec, avoid stack overflow pb.
     Thanks to Diego Liziero <diegoliz@gmail.com> for pointing out the
     problem.
   - Better type inference for arithmetic binary operators
     Thanks to Li Yingtong for pointing out the problem.
   - Better type inference for constants
     Thanks to Li Yingtong for pointing out the problem.
   - move computing of adjacency information for semantic patches to after
     application of isomorphisms, because isomorphisms can introduce "..."
   - compute adjacency information for negated ...
   - record with each transformation site the set of indices of the witness
     trees that caused the transformation site to come about.  Whitespace and
     comments between remove tokens associated with disjoint witness trees is
     not removed.
   - correct treatment of function pointer typed parameters in the SmPL ast0
     visitor.
   - better parsing error message and error recovery when comments are not ended,
     when some macros have a weird body, and when some switch have a weird
     Body.
     Thanks to Derek Jones for pointing out the problem.
   - better detection and passing of "dangerous" ifdefs, cf -test
     double_switch.
   - dropped the separation of decls and body in Seq.  This gives better
     positioning of the bindings of metavariables shared between them.
     Thanks to Erik Hovland for an example that shows the problem.

** Internals:
   - supress warning in compiling ocamlsexp (warning caused by a new behavior
     of cpp used internally in processing files in ocamlsexp/)

223 files changed:
Makefile
authors.txt
changes.txt
cocci.ml
commitmsg
commons/Makefile
commons/common.ml
commons/common.mli
commons/glimpse.ml
configure
ctl/ctl_engine.ml
demos/python_regexp.c [new file with mode: 0644]
demos/python_regexp.cocci [new file with mode: 0644]
docs/Makefile
docs/grammar/Makefile [deleted file]
docs/manual.tex [deleted file]
docs/manual/Makefile [new file with mode: 0644]
docs/manual/advanced.tex [new file with mode: 0644]
docs/manual/cocci-python.txt [moved from docs/cocci-python.txt with 100% similarity]
docs/manual/cocci_syntax.pdf [moved from docs/grammar/cocci_syntax.pdf with 92% similarity]
docs/manual/cocci_syntax.tex [moved from docs/grammar/cocci_syntax.tex with 90% similarity]
docs/manual/copyright.txt [new file with mode: 0644]
docs/manual/examples.tex [moved from docs/grammar/examples.tex with 100% similarity]
docs/manual/installing.tex [new file with mode: 0644]
docs/manual/introduction.tex [new file with mode: 0644]
docs/manual/isomorphisms.tex [new file with mode: 0644]
docs/manual/license.txt [new file with mode: 0644]
docs/manual/macros.tex [new file with mode: 0644]
docs/manual/macros_common.tex [new file with mode: 0644]
docs/manual/macros_grammar.tex [moved from docs/grammar/grammar.tex with 100% similarity]
docs/manual/macros_listing_cocci.tex [new file with mode: 0644]
docs/manual/macros_options.tex [new file with mode: 0644]
docs/manual/main.tex [new file with mode: 0644]
docs/manual/main_grammar.tex [new file with mode: 0644]
docs/manual/main_options.tex [new file with mode: 0644]
docs/manual/manual.pdf [new file with mode: 0644]
docs/manual/options.pdf [new file with mode: 0644]
docs/manual/parsing.tex [new file with mode: 0644]
docs/manual/spatch_options.tex [moved from docs/options.tex with 87% similarity]
docs/manual/tips.tex [moved from docs/grammar/tips.tex with 100% similarity]
docs/manual/tutorial.tex [new file with mode: 0644]
docs/manual/workflow.tex [new file with mode: 0644]
docs/options.pdf [deleted file]
docs/spatch.1
engine/asttoctl2.ml
engine/asttomember.ml
engine/c_vs_c.ml
engine/cocci_vs_c.ml
engine/ctlcocci_integration.ml
engine/ctlcocci_integration.mli
engine/flag_matcher.ml
engine/lib_engine.ml
engine/pattern_c.ml
engine/postprocess_transinfo.ml
engine/postprocess_transinfo.mli
engine/sgrep.ml
engine/transformation_c.ml
engine/transformation_c.mli
flag_cocci.ml
globals/config.ml.in
install.txt
main.ml
menhirlib/Makefile
ocamlsexp/Makefile
parsing_c/Makefile
parsing_c/ast_c.ml
parsing_c/comment_annotater_c.ml
parsing_c/compare_c.ml
parsing_c/control_flow_c.ml
parsing_c/control_flow_c_build.ml [moved from parsing_c/ast_to_flow.ml with 91% similarity]
parsing_c/control_flow_c_build.mli [moved from parsing_c/ast_to_flow.mli with 94% similarity]
parsing_c/cpp_ast_c.ml
parsing_c/cpp_token_c.ml [new file with mode: 0644]
parsing_c/cpp_token_c.mli [new file with mode: 0644]
parsing_c/flag_parsing_c.ml
parsing_c/lexer_c.mll
parsing_c/lexer_parser.ml
parsing_c/lib_parsing_c.ml
parsing_c/parse_c.ml
parsing_c/parse_c.mli
parsing_c/parser_c.mly
parsing_c/parsing_hacks.ml
parsing_c/parsing_hacks.mli
parsing_c/pretty_print_c.ml
parsing_c/pretty_print_c.mli
parsing_c/test_parsing_c.ml
parsing_c/token_c.ml
parsing_c/token_helpers.ml
parsing_c/token_helpers.mli
parsing_c/token_views_c.ml [new file with mode: 0644]
parsing_c/token_views_c.mli [new file with mode: 0644]
parsing_c/type_annoter_c.ml
parsing_c/type_c.ml
parsing_c/type_c.mli
parsing_c/unparse_c.ml
parsing_c/unparse_cocci.ml
parsing_c/unparse_cocci.mli
parsing_c/unparse_hrule.ml
parsing_c/visitor_c.ml
parsing_cocci/.depend
parsing_cocci/Makefile
parsing_cocci/adjacency.ml [new file with mode: 0644]
parsing_cocci/adjacency.mli [new file with mode: 0644]
parsing_cocci/adjust_pragmas.ml
parsing_cocci/arity.ml
parsing_cocci/ast0_cocci.ml
parsing_cocci/ast0_cocci.mli
parsing_cocci/ast0toast.ml
parsing_cocci/ast_cocci.ml
parsing_cocci/ast_cocci.mli
parsing_cocci/check_meta.ml
parsing_cocci/compute_lines.ml
parsing_cocci/context_neg.ml
parsing_cocci/free_vars.ml
parsing_cocci/function_prototypes.ml
parsing_cocci/get_constants.ml
parsing_cocci/get_constants2.ml
parsing_cocci/insert_plus.ml
parsing_cocci/iso_pattern.ml
parsing_cocci/lexer_cocci.mll
parsing_cocci/parse_aux.ml
parsing_cocci/parse_cocci.ml
parsing_cocci/parser_cocci_menhir.ml
parsing_cocci/parser_cocci_menhir.mli
parsing_cocci/parser_cocci_menhir.mly
parsing_cocci/pretty_print_cocci.ml
parsing_cocci/single_statement.ml
parsing_cocci/unify_ast.ml
parsing_cocci/unitary_ast0.ml
parsing_cocci/unparse_ast0.ml
parsing_cocci/visitor_ast.ml
parsing_cocci/visitor_ast0.ml
python/no_pycocci_aux.ml
readme.txt
standard.h
standard.iso
testing.ml
testing.mli
tests/SCORE_expected.sexp
tests/SCORE_expected.sexp.save [new file with mode: 0644]
tests/SCORE_expected_orig.sexp [new file with mode: 0644]
tests/a_and_e.cocci
tests/addif.cocci
tests/addif2.cocci
tests/anon.cocci
tests/argument.cocci
tests/array_init.cocci
tests/badzero.c [new file with mode: 0644]
tests/badzero.cocci [new file with mode: 0644]
tests/badzero.res [new file with mode: 0644]
tests/ben.cocci
tests/cards.cocci
tests/cast_iso.cocci
tests/check_order1.c [new file with mode: 0644]
tests/check_order1.cocci [new file with mode: 0644]
tests/check_order2.c [new file with mode: 0644]
tests/check_order2.cocci [new file with mode: 0644]
tests/constx.cocci
tests/cs_check.cocci
tests/dropf.cocci
tests/find_long.c [new file with mode: 0644]
tests/find_long.cocci [new file with mode: 0644]
tests/find_long.res [new file with mode: 0644]
tests/fun.cocci
tests/hd.cocci
tests/headers.cocci
tests/ifdef4.cocci
tests/ifdef5.cocci
tests/ifdefmeta.c [new file with mode: 0644]
tests/ifdefmeta.cocci [new file with mode: 0644]
tests/ifdefmeta.res [new file with mode: 0644]
tests/ifdefmeta1.c [new file with mode: 0644]
tests/ifdefmeta1.cocci [new file with mode: 0644]
tests/ifdefmeta1.res [new file with mode: 0644]
tests/ifdefmeta2.c [new file with mode: 0644]
tests/ifdefmeta2.cocci [new file with mode: 0644]
tests/ifdefmeta2.res [new file with mode: 0644]
tests/ifdefmeta3.c [new file with mode: 0644]
tests/ifdefmeta3.cocci [new file with mode: 0644]
tests/ifdefmeta3.res [new file with mode: 0644]
tests/ifdefmeta4.res [new file with mode: 0644]
tests/ifelse.c [new file with mode: 0644]
tests/ifelse.cocci [new file with mode: 0644]
tests/km.cocci
tests/km.res
tests/kmalloc.cocci
tests/ktype.cocci
tests/ldecl.c [new file with mode: 0644]
tests/ldecl.cocci [new file with mode: 0644]
tests/longconst.c [new file with mode: 0644]
tests/longconst.cocci [new file with mode: 0644]
tests/longconst.res [new file with mode: 0644]
tests/macro_int16.c [new file with mode: 0644]
tests/macro_int16.cocci [new file with mode: 0644]
tests/macro_int16.res [new file with mode: 0644]
tests/metaruleelem.cocci
tests/multitype.cocci
tests/neststruct.cocci
tests/oddifdef.c [new file with mode: 0644]
tests/oddifdef.cocci [new file with mode: 0644]
tests/oddifdef.res [new file with mode: 0644]
tests/parse_field.c [new file with mode: 0644]
tests/parsing_pad.c [new file with mode: 0644]
tests/parsing_pad.cocci [new file with mode: 0644]
tests/protoassert.cocci
tests/rcu3.cocci
tests/slow.c [new file with mode: 0644]
tests/stm8.cocci
tests/struct_typedef.cocci
tests/test1.cocci
tests/test10.cocci
tests/test11.cocci
tests/test12.cocci
tests/test3.cocci
tests/test6.cocci
tests/test7.cocci
tests/test9.cocci
tests/top.cocci
tests/toplevel_macrostmt.cocci
tests/whitespace.cocci
tests/xfield.c [new file with mode: 0644]
tests/xfield.cocci [new file with mode: 0644]
tests/xfield.res [new file with mode: 0644]

index 2a49292..78923d7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -85,6 +85,9 @@ OCAMLCFLAGS= #-g -dtypes # -w A
 # for profiling add  -p -inline 0
 # but 'make forprofiling' below does that for you.
 # This flag is also used in subdirectories so don't change its name here.
+# To enable backtrace support for native code, you need to put -g in OPTFLAGS
+# to also link with -g, but even in 3.11 the backtrace support seems buggy so
+# not worth it.
 OPTFLAGS=
 # the following is essential for Coccinelle to compile under gentoo
 # but is now defined above in this file
@@ -109,17 +112,14 @@ BYTECODE_STATIC=-custom
 .PHONY:: all all.opt byte opt top clean distclean configure
 .PHONY:: $(MAKESUBDIRS) $(MAKESUBDIRS:%=%.opt) subdirs subdirs.opt
 
-all: byte
-       $(MAKE) preinstall
+all: Makefile.config byte preinstall
 
 opt: all.opt
-all.opt: opt-compil
-       $(MAKE) preinstall
+all.opt: opt-compil preinstall
 
-world: 
+world: preinstall
        $(MAKE) byte
-       $(MAKE) opt
-       $(MAKE) preinstall
+       $(MAKE) opt-compil
 
 byte: .depend
        $(MAKE) subdirs
@@ -191,6 +191,10 @@ clean::
 configure:
        ./configure
 
+Makefile.config:    
+       @echo "Makefile.config is missing. Have you run ./configure?"
+       @exit 1
+
 tools:
        $(MAKE) -C tools
 
@@ -224,30 +228,35 @@ distclean::
 ##############################################################################
 # Pre-Install (customization of spatch frontend script)
 ##############################################################################
-.PHONY:: preinstall preinstall-def preinstall-byte preinstall-opt
 
-preinstall: preinstall-def preinstall-byte preinstall-opt
+preinstall: scripts/spatch scripts/spatch.opt scripts/spatch.byte
 
 # user will use spatch to run spatch.opt (native)
-preinstall-def:
+scripts/spatch:
        cp scripts/spatch.sh scripts/spatch.tmp2
        sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.tmp2 > scripts/spatch.tmp
        sed "s|LIBDIR|$(LIBDIR)|g" scripts/spatch.tmp > scripts/spatch
        rm -f scripts/spatch.tmp2 scripts/spatch.tmp
 
 # user will use spatch to run spatch (bytecode)
-preinstall-byte:
-       cp scripts/spatch.sh scripts/spatch.tmp3
-       sed "s|\.opt||" scripts/spatch.tmp3 > scripts/spatch.tmp2
-       sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.tmp2 > scripts/spatch.tmp
-       sed "s|LIBDIR|$(LIBDIR)|g" scripts/spatch.tmp > scripts/spatch.byte
-       rm -f scripts/spatch.tmp3 scripts/spatch.tmp2 scripts/spatch.tmp
+scripts/spatch.byte:
+       cp scripts/spatch.sh scripts/spatch.byte.tmp3
+       sed "s|\.opt||" scripts/spatch.byte.tmp3 > scripts/spatch.byte.tmp2
+       sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.byte.tmp2 \
+               > scripts/spatch.byte.tmp
+       sed "s|LIBDIR|$(LIBDIR)|g" scripts/spatch.byte.tmp \
+               > scripts/spatch.byte
+       rm -f   scripts/spatch.byte.tmp3 \
+               scripts/spatch.byte.tmp2 \
+               scripts/spatch.byte.tmp
 
 # user will use spatch.opt to run spatch.opt (native)
-preinstall-opt:
+scripts/spatch.opt:
        cp scripts/spatch.sh scripts/spatch.opt.tmp2
-       sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.opt.tmp2 > scripts/spatch.opt.tmp
-       sed "s|LIBDIR|$(LIBDIR)|g" scripts/spatch.opt.tmp > scripts/spatch.opt
+       sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.opt.tmp2 \
+               > scripts/spatch.opt.tmp
+       sed "s|LIBDIR|$(LIBDIR)|g" scripts/spatch.opt.tmp \
+               > scripts/spatch.opt
        rm -f scripts/spatch.opt.tmp scripts/spatch.opt.tmp2
 
 clean::
@@ -268,11 +277,6 @@ install-common:
        $(INSTALL_DATA) standard.iso $(DESTDIR)$(SHAREDIR)
        $(INSTALL_DATA) docs/spatch.1 $(DESTDIR)$(MANDIR)/man1/
        @if [ $(FEATURE_PYTHON) -eq 1 ]; then $(MAKE) install-python; fi
-       @echo ""
-       @echo "You can also install spatch by copying the program spatch"
-       @echo "(available in this directory) anywhere you want and"
-       @echo "give it the right options to find its configuration files."
-       @echo ""
 
 install-python:
        mkdir -p $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
@@ -286,7 +290,7 @@ install-python:
                $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
        $(INSTALL_LIB) dllpycaml_stubs.so $(DESTDIR)$(LIBDIR)
 
-install:
+install: install-common 
        @if test -x spatch -a ! -x spatch.opt ; then \
                $(MAKE) install-byte;fi
        @if test ! -x spatch -a -x spatch.opt ; then \
@@ -295,19 +299,24 @@ install:
                $(MAKE) install-byte; $(MAKE) install-opt;fi
        @if test ! -x spatch -a ! -x spatch.opt ; then \
                echo "\n\n\t==> Run 'make', 'make opt', or both first. <==\n\n";fi
+       @echo ""
+       @echo "\tYou can also install spatch by copying the program spatch"
+       @echo "\t(available in this directory) anywhere you want and"
+       @echo "\tgive it the right options to find its configuration files."
+       @echo ""
 
 # user will use spatch to run spatch.opt (native)
-install-def: install-common
+install-def:
        $(INSTALL_PROGRAM) spatch.opt $(DESTDIR)$(SHAREDIR)
        $(INSTALL_PROGRAM) scripts/spatch $(DESTDIR)$(BINDIR)/spatch
 
 # user will use spatch to run spatch (bytecode)
-install-byte: install-common
+install-byte:
        $(INSTALL_PROGRAM) spatch $(DESTDIR)$(SHAREDIR)
        $(INSTALL_PROGRAM) scripts/spatch.byte $(DESTDIR)$(BINDIR)/spatch
 
 # user will use spatch.opt to run spatch.opt (native)
-install-opt: install-common
+install-opt:
        $(INSTALL_PROGRAM) spatch.opt $(DESTDIR)$(SHAREDIR)
        $(INSTALL_PROGRAM) scripts/spatch.opt $(DESTDIR)$(BINDIR)/spatch.opt
 
@@ -332,8 +341,8 @@ PACKAGE=coccinelle-$(VERSION)
 
 BINSRC=spatch env.sh env.csh standard.h standard.iso \
        *.txt \
-       docs/options.pdf docs/grammar/cocci_syntax.pdf docs/spatch.1 \
-       docs/cocci-python.txt \
+       docs/manual/options.pdf docs/manual/cocci_syntax.pdf docs/spatch.1 \
+       docs/manual/cocci-python.txt \
        demos/foo.* demos/simple.*
 #      $(PYLIB) python/coccilib/ demos/printloc.*
 BINSRC2=$(BINSRC:%=$(PACKAGE)/%)
@@ -355,7 +364,7 @@ OCAMLVERSION=$(shell ocaml -version |perl -p -e 's/.*version (.*)/$$1/;')
 # Procedure to do each time:
 #  cvs update
 #  make sure that ocaml is the distribution ocaml of /usr/bin, not ~pad/...
-#  modify globals/config.ml
+#  modify globals/config.ml.in
 #  cd globals/; cvs commit -m"new version"  (do not commit from the root!)
 #  ./configure --without-python
 #  make package
@@ -459,6 +468,7 @@ website:
        rm -f $(WEBSITE)/LATEST* $(WEBSITE)/coccinelle-latest.tgz
        cp changes.txt $(WEBSITE)/changes-$(VERSION).txt
        cd $(WEBSITE); touch LATEST_IS_$(VERSION); ln -s $(PACKAGE).tgz coccinelle-latest.tgz
+       cp readme.txt $(WEBSITE)
 
 
 #TXT=$(wildcard *.txt)
@@ -469,7 +479,7 @@ syncwiki:
 darcsweb:
 #      @echo pull from ~/public_html/darcs/c-coccinelle and c-commons and lib-xxx
 
-DARCSFORESTS=commons \
+DARCSFORESTS=commons ocamlsexp \
  parsing_c parsing_cocci engine
 
 update_darcs:
index 0cd3bff..d553352 100644 (file)
@@ -5,7 +5,6 @@ Here are the authors and maintainers of the different parts of coccinelle:
 - parsing_cocci/ (parsing SmPL, isomorphism handling)
 - engine/ (ast_cocci to ctl, sgrep)
 - ctl/ (symbolic model checker)
-- popl/ popl09/
 - tools/ 
 - standard.iso
 
@@ -13,21 +12,19 @@ Here are the authors and maintainers of the different parts of coccinelle:
 
 - parsing_c/ (parsing C, unparsing C, type checking, control flow, C diff)
 - engine/ (pattern matching and transforming, unparsing, ctl integration)
-- cocci.ml (driver)
-- main.ml, testing.ml
-- emacs/cocci.el
+- main.ml, cocci.ml (driver), testing.ml
+- configure, txt files, Makefiles 
 - globals/
-- extra/
-- tools/ 
-- scripts/
-- commons/ (utility functions)
+- extra/, tools/, scripts/
+- commons/ (utility functions, e.g. for logging, profiling, regression testing)
+- editors/emacs/cocci.el
 - standard.h
 
 
 * Rene Rydhof Hansen <rrhansen@diku.dk>
 
 - Original version of the model checker in ctl/
-- emacs/cocci-ediff.el
+- editors/emacs/cocci-ediff.el
 - scripts/extractor.awk
 
 * Henrik stuart <henrik@hstuart.dk>
index 130a473..6082e83 100644 (file)
@@ -1,5 +1,80 @@
 -*- org -*-
 
+* 0.1.8
+
+** Language:
+
+** Features:
+- Metavariables now capture the cpp code contained within their definitions
+- When - fragments are separated by ... or nest boundaries in the semantic
+  patch, but end up matching adjacent source code, the comments, cpp code
+  and whitespace that are between them are not deleted.
+- better parsing of C: do expansion of macros only when needed when
+  have actually a parse error and also leverage the definition of macros
+  in the parsed file (or in a optional_standard.h file passed as a parameter).
+  This should reduce the need for many hardcoded definitions in standard.h
+- new semantics for the -macro_file option, by default now expand macros
+  only when necessary. To force use the -macro_file_builtins option instead.
+- a new -extract_macros command line action to help the parser. Works with
+  the -macro_file option. e.g. 
+    $ ./spatch -extract_macros ~/linux > /tmp/alldefs.h
+    $ ./spatch -macro_file /tmp/alldefs.h -sp_file foo.cocci -dir ~/linux
+- removed -D macro_file option, not consistent with what -D usually means
+- reattempt to be more efficient for statement metavariables that are just
+  placeholders (ie, no modification, no reuse)
+- triples now returned from ctl in sorted order.  The main key is the
+  state.  On the other hand, the state order does not always agree with the
+  order of appearance in the code.
+- spatch is now less verbose on the things it does yet handle. Less confusing
+  for new users.
+- slightly better error report. Thanks to Derek Jones for the suggestion.
+- added the options -linux_spacing and -smpl_spacing.  -linux_spacing
+  causes spatch to follow the spacing conventions of Linux, while
+  -smpl_spacing causes spatch to follow the spacing in the semantic patch.
+  -linux_spacing is the default.
+- more informative error reporting for the already tagged token case.
+  Thanks to Erik Hovland for the suggestion.
+
+** Bugfix:
+- better parsing of declare macro at toplevel and in structure. 
+  cf -text xfield
+- allowing back typedef names for fieldname
+- better printing of else in generated code
+- slightly better type inference for binary operators.
+- clear out declarer names and iterator names between SmPL files (for
+  -testall)
+- better parsing and type checking of macro type aliases. Cf -test macro_int16.
+  Thanks to Li Yingtong for pointing out the problem.
+- make insert_virtual_positions tail rec, avoid stack overflow pb.
+  Thanks to Diego Liziero <diegoliz@gmail.com> for pointing out the
+  problem.
+- Better type inference for arithmetic binary operators
+  Thanks to Li Yingtong for pointing out the problem.
+- Better type inference for constants
+  Thanks to Li Yingtong for pointing out the problem.
+- move computing of adjacency information for semantic patches to after
+  application of isomorphisms, because isomorphisms can introduce "..."
+- compute adjacency information for negated ...
+- record with each transformation site the set of indices of the witness
+  trees that caused the transformation site to come about.  Whitespace and
+  comments between remove tokens associated with disjoint witness trees is
+  not removed.
+- correct treatment of function pointer typed parameters in the SmPL ast0
+  visitor.
+- better parsing error message and error recovery when comments are not ended, 
+  when some macros have a weird body, and when some switch have a weird
+  Body. 
+  Thanks to Derek Jones for pointing out the problem.
+- better detection and passing of "dangerous" ifdefs, cf -test
+  double_switch.
+- dropped the separation of decls and body in Seq.  This gives better
+  positioning of the bindings of metavariables shared between them.
+  Thanks to Erik Hovland for an example that shows the problem.
+
+** Internals:
+- supress warning in compiling ocamlsexp (warning caused by a new behavior
+  of cpp used internally in processing files in ocamlsexp/)
+
 * 0.1.7
 
 ** Language: 
 ** Language: 
 - long long added to SmPL
 
+** Documentation:
+- add grammar reference and spatch command line options reference
+
 ** Features: 
 - can match patterns of the form unsigned T or signed T, where T is a
   metavariable
 - isomorphisms don't apply under signed/unsigned, to prevent the creation
   of things like unsigned signed int.  Need a better solution for this.
 
+
 * 0.1.3
 
 ** Features: 
index 337a491..7a446c4 100644 (file)
--- a/cocci.ml
+++ b/cocci.ml
@@ -25,6 +25,8 @@ open Common
 module CCI = Ctlcocci_integration
 module TAC = Type_annoter_c
 
+module Ast_to_flow = Control_flow_c_build
+
 (*****************************************************************************)
 (* This file is a kind of driver. It gathers all the important functions 
  * from coccinelle in one place. The different entities in coccinelle are:
@@ -307,6 +309,9 @@ let show_or_not_celem a b  =
 
 
 let show_or_not_trans_info2 trans_info = 
+  (* drop witness tree indices for printing *)
+  let trans_info =
+    List.map (function (index,trans_info) -> trans_info) trans_info in
   if !Flag.show_transinfo then begin
     if null trans_info then pr2 "transformation info is empty"
     else begin
@@ -387,11 +392,13 @@ let worth_trying cfiles tokens =
 let check_macro_in_sp_and_adjust tokens = 
   let tokens = Common.union_all tokens in
   tokens +> List.iter (fun s -> 
-    if Hashtbl.mem !Parsing_hacks._defs s
+    if Hashtbl.mem !Parse_c._defs s
     then begin
-      pr2 "warning: macro in semantic patch was in macro definitions";
-      pr2 ("disabling macro expansion for " ^ s);
-      Hashtbl.remove !Parsing_hacks._defs s
+      if !Flag_cocci.verbose_cocci then begin
+        pr2 "warning: macro in semantic patch was in macro definitions";
+        pr2 ("disabling macro expansion for " ^ s);
+      end;
+      Hashtbl.remove !Parse_c._defs s
     end
   )
 
@@ -1019,16 +1026,26 @@ let prepare_c files choose_includes : file_info list =
 
 (* r(ule), c(element in C code), e(nvironment) *)
 
+let findk f l =
+  let rec loop k = function
+      [] -> None
+    | x::xs ->
+       if f x
+       then Some (x, function n -> k (n :: xs))
+       else loop (function vs -> k (x :: vs)) xs in
+  loop (function x -> x) l
+
 let merge_env new_e old_e =
-  List.fold_left
-    (function old_e ->
-      function (e,rules) as elem ->
-       let (same,diff) = List.partition (function (e1,_) -> e =*= e1) old_e in
-       match same with
-         [] -> elem :: old_e
-       | [(_,old_rules)] -> (e,Common.union_set rules old_rules) :: diff
-       | _ -> failwith "duplicate environment entries")
-    old_e new_e
+  let (ext,old_e) =
+    List.fold_left
+      (function (ext,old_e) ->
+       function (e,rules) as elem ->
+         match findk (function (e1,_) -> e =*= e1) old_e with
+           None -> (elem :: ext,old_e)
+         | Some((_,old_rules),k) ->
+             (ext,k (e,Common.union_set rules old_rules)))
+      ([],old_e) new_e in
+  old_e @ (List.rev ext)
 
 let apply_python_rule r cache newes e rules_that_have_matched
     rules_that_have_ever_matched =
@@ -1122,26 +1139,29 @@ let rec apply_cocci_rule r rules_that_have_ever_matched es
                    (* applying the rule *)
                    (match r.ruletype with
                      Ast_cocci.Normal ->
-                       let children_e = ref [] in
-      
                       (* looping over the functions and toplevel elements in
                         .c and .h *)
-                       concat_headers_and_c !ccs +> List.iter (fun (c,f) -> 
-                         if c.flow <> None 
-                         then
-                          (* does also some side effects on c and r *)
-                           let processed =
-                             process_a_ctl_a_env_a_toplevel r
-                               relevant_bindings c f in
-                           match processed with
-                           | None -> ()
-                           | Some newbindings -> 
-                               newbindings +> List.iter (fun newbinding -> 
-                                 children_e :=
-                                   Common.insert_set newbinding !children_e)
-                                 ); (* end iter cs *)
-
-                       !children_e
+                       List.rev
+                         (concat_headers_and_c !ccs +>
+                          List.fold_left (fun children_e (c,f) -> 
+                            if c.flow <> None 
+                            then
+                             (* does also some side effects on c and r *)
+                              let processed =
+                                process_a_ctl_a_env_a_toplevel r
+                                  relevant_bindings c f in
+                              match processed with
+                              | None -> children_e
+                              | Some newbindings -> 
+                                  newbindings +>
+                                  List.fold_left
+                                    (fun children_e newbinding -> 
+                                      if List.mem newbinding children_e
+                                      then children_e
+                                      else newbinding :: children_e)
+                                    children_e
+                            else children_e)
+                            [])
                    | Ast_cocci.Generated ->
                        process_a_generated_a_env_a_toplevel r
                          relevant_bindings !ccs;
@@ -1576,7 +1596,9 @@ let post_engine a =
 
 let check_duplicate_modif2 xs = 
   (* opti: let groups = Common.groupBy (fun (a,resa) (b,resb) -> a =$= b) xs *)
-  pr2 ("Check duplication for " ^ i_to_s (List.length xs) ^ " files");
+  if !Flag_cocci.verbose_cocci
+  then pr2 ("Check duplication for " ^ i_to_s (List.length xs) ^ " files");
+
   let groups = Common.group_assoc_bykey_eff xs in
   groups +> Common.map_filter (fun (file, xs) -> 
     match xs with
dissimilarity index 97%
index 8117a27..f05683a 100644 (file)
--- a/commitmsg
+++ b/commitmsg
@@ -1,39 +1,72 @@
-Release coccinelle-0.1.7
-
-** Language:
-   - initialize and finalize script code, cf demos/initial_final.cocci
-
-** Features:
-   - -iso_limit option to limit the depth of isomorphism application
-   - with the dir option, the include path is implicitly set to the "include"
-     subdirectory of the specified directory, if the option -I is not used.
-   - give a seed for the name of a fresh identifier
-   - better handling of cpp "constructed" identifiers as in a##b, that in
-     the futur will make it easier to match over those idents.
-     cf tests/pb_parsing_macro.c. Thanks to Ali-Erdem Ozcan for pointing
-     out the problem. A new "parsing hack hint" is also available:
-     YACFE_IDENT_BUILDER, cf standard.h.
-
-** Bugfix:
-   - drop excessive "optimization" in ctl generation for while and for loops
-   - allow . as the name of the directory
-   - for type inference for an assignment, take the type of the right-hand
-     side expression, not the type of the assigned variable
-   - allow for with a declartion in the first header element, as in C++
-     (partial support)
-   - allow for matching against variable declarations that include only
-     storage, eg static, but no type at all.
-   - allow for matching against types that contain both short/long and int
-   - allow the type metavariable in the SmPL code "unsigned T" to match a T
-     that is a type consisting of more than one word, eg long int.
-   - -ifdef_to_if option made to process nested ifdefs
-     (partial support)
-
-** Internals:
-   - improve and fix installation process (usable on BSD)
-   - improve and fix testing process
-   - apply patches from Eugeniy Meshcheryakov
-   - reorganize the way we parse C identifiers, especially concatenated cpp
-     identifiers as in a##b. This may lead to some regressions as we may
-     not parse as much code as before.
-   - removed popl/ and popl09/ and popl related stuff from official distrib.
+Release coccinelle-0.1.8
+
+** Features:
+   - Metavariables now capture the cpp code contained within their definitions
+   - When - fragments are separated by ... or nest boundaries in the semantic
+     patch, but end up matching adjacent source code, the comments, cpp code
+     and whitespace that are between them are not deleted.
+   - better parsing of C: do expansion of macros only when needed when
+     have actually a parse error and also leverage the definition of macros
+     in the parsed file (or in a optional_standard.h file passed as a parameter).
+     This should reduce the need for many hardcoded definitions in standard.h
+   - new semantics for the -macro_file option, by default now expand macros
+     only when necessary. To force use the -macro_file_builtins option instead.
+   - a new -extract_macros command line action to help the parser. Works with
+     the -macro_file option. e.g.
+       $ ./spatch -extract_macros ~/linux > /tmp/alldefs.h
+       $ ./spatch -macro_file /tmp/alldefs.h -sp_file foo.cocci -dir ~/linux
+   - removed -D macro_file option, not consistent with what -D usually means
+   - reattempt to be more efficient for statement metavariables that are just
+     placeholders (ie, no modification, no reuse)
+   - triples now returned from ctl in sorted order.  The main key is the
+     state.  On the other hand, the state order does not always agree with the
+     order of appearance in the code.
+   - spatch is now less verbose on the things it does yet handle. Less confusing
+     for new users.
+   - slightly better error report. Thanks to Derek Jones for the suggestion.
+   - added the options -linux_spacing and -smpl_spacing.  -linux_spacing
+     causes spatch to follow the spacing conventions of Linux, while
+     -smpl_spacing causes spatch to follow the spacing in the semantic patch.
+     -linux_spacing is the default.
+   - more informative error reporting for the already tagged token case.
+     Thanks to Erik Hovland for the suggestion.
+    
+** Bugfix:
+   - better parsing of declare macro at toplevel and in structure.
+     cf -text xfield
+   - allowing back typedef names for fieldname
+   - better printing of else in generated code
+   - slightly better type inference for binary operators.
+   - clear out declarer names and iterator names between SmPL files (for
+     -testall)
+   - better parsing and type checking of macro type aliases. Cf -test macro_int16.
+     Thanks to Li Yingtong for pointing out the problem.
+   - make insert_virtual_positions tail rec, avoid stack overflow pb.
+     Thanks to Diego Liziero <diegoliz@gmail.com> for pointing out the
+     problem.
+   - Better type inference for arithmetic binary operators
+     Thanks to Li Yingtong for pointing out the problem.
+   - Better type inference for constants
+     Thanks to Li Yingtong for pointing out the problem.
+   - move computing of adjacency information for semantic patches to after
+     application of isomorphisms, because isomorphisms can introduce "..."
+   - compute adjacency information for negated ...
+   - record with each transformation site the set of indices of the witness
+     trees that caused the transformation site to come about.  Whitespace and
+     comments between remove tokens associated with disjoint witness trees is
+     not removed.
+   - correct treatment of function pointer typed parameters in the SmPL ast0
+     visitor.
+   - better parsing error message and error recovery when comments are not ended,
+     when some macros have a weird body, and when some switch have a weird
+     Body.
+     Thanks to Derek Jones for pointing out the problem.
+   - better detection and passing of "dangerous" ifdefs, cf -test
+     double_switch.
+   - dropped the separation of decls and body in Seq.  This gives better
+     positioning of the bindings of metavariables shared between them.
+     Thanks to Erik Hovland for an example that shows the problem.
+
+** Internals:
+   - supress warning in compiling ocamlsexp (warning caused by a new behavior
+     of cpp used internally in processing files in ocamlsexp/)
index 4073a1f..ce53152 100644 (file)
@@ -29,7 +29,7 @@ SRC+=$(MYSRC)
 SRC+=ocamlextra/enum.ml ocamlextra/dynArray.ml
 SRC+=ocamlextra/suffix_tree.ml ocamlextra/suffix_tree_ext.ml
 
-SYSLIBS=str.cma unix.cma
+SYSLIBS=str.cma bigarray.cma unix.cma
 
 INCLUDEDIRS=ocamlextra ocollection
 SUBDIRS=ocamlextra ocollection
@@ -105,7 +105,7 @@ OPTFLAGS=
 # ocaml, when it is available, which speeds up compilation. So
 # if you want the fast version of the ocaml chain tools, set this var 
 # or setenv it to ".opt" in your startup script.
-#OPTBIN= #.opt
+OPTBIN ?= #.opt
 
 OCAMLCFLAGS ?= -g -dtypes
 
index 1d128a0..c037e1b 100644 (file)
@@ -237,18 +237,37 @@ let pr_no_nl s =
   flush stdout
 
 
+
+
+
+
+let _chan_pr2 = ref (None: out_channel option)
+
+let out_chan_pr2 ?(newline=true) s = 
+  match !_chan_pr2 with
+  | None -> ()
+  | Some chan -> 
+      output_string chan (s ^ (if newline then "\n" else "")); 
+      flush chan
+
+
 let pr2 s = 
   prerr_string !_prefix_pr;
   do_n !_tab_level_print (fun () -> prerr_string " ");
   prerr_string s;
   prerr_string "\n"; 
-  flush stderr
+  flush stderr;
+  out_chan_pr2 s;
+  ()
 
 let pr2_no_nl s = 
   prerr_string !_prefix_pr;
   do_n !_tab_level_print (fun () -> prerr_string " ");
   prerr_string s;
-  flush stderr
+  flush stderr;
+  out_chan_pr2 ~newline:false s;
+  ()
+
 
 let pr_xxxxxxxxxxxxxxxxx () = 
   pr "-----------------------------------------------------------------------"
@@ -385,15 +404,35 @@ let pr2_gen x = pr2 (dump x)
 
 let _already_printed = Hashtbl.create 101
 let disable_pr2_once = ref false 
-let pr2_once s = 
+
+let xxx_once f s = 
   if !disable_pr2_once then pr2 s
   else 
     if not (Hashtbl.mem _already_printed s)
     then begin
       Hashtbl.add _already_printed s true;
-      pr2 ("(ONCE) " ^ s);
+      f ("(ONCE) " ^ s);
     end
 
+let pr2_once s = xxx_once pr2 s
+
+(* ---------------------------------------------------------------------- *)
+let mk_pr2_wrappers aref = 
+  let fpr2 s = 
+    if !aref
+    then pr2 s
+    else 
+      (* just to the log file *)
+      out_chan_pr2 s
+  in
+  let fpr2_once s = 
+    if !aref
+    then pr2_once s
+    else 
+      xxx_once out_chan_pr2 s
+  in
+  fpr2, fpr2_once
+
 
 (* ---------------------------------------------------------------------- *)
 (* could also be in File section *)
@@ -433,6 +472,10 @@ let redirect_stdin_opt optfile f =
   | Some infile -> redirect_stdin infile f
 
 
+(* cf end 
+let with_pr2_to_string f = 
+*)
+  
 
 (* ---------------------------------------------------------------------- *)
 
@@ -1050,28 +1093,6 @@ let pp_f_in_box f      =
 
 let pp s = Format.print_string s
 
-
-
-(* julia: convert something printed using format to print into a string *)
-let format_to_string f =
-  let o = open_out "/tmp/out" in
-  Format.set_formatter_out_channel o;
-  let _ = f() in
-  Format.print_flush();
-  Format.set_formatter_out_channel stdout;
-  close_out o;
-  let i = open_in "/tmp/out" in
-  let lines = ref [] in
-  let rec loop _ =
-    let cur = input_line i in
-    lines := cur :: !lines;
-    loop() in
-  (try loop() with End_of_file -> ());
-  close_in i;
-  String.concat "\n" (List.rev !lines)
-
-
-
 let mk_str_func_of_assoc_conv xs = 
   let swap (x,y) = (y,x) in
 
@@ -1083,6 +1104,16 @@ let mk_str_func_of_assoc_conv xs =
     List.assoc a xs
   )
 
+
+
+(* julia: convert something printed using format to print into a string *)
+(* now at bottom of file
+let format_to_string f =
+ ...
+*)
+
+
+
 (*****************************************************************************)
 (* Macro *)
 (*****************************************************************************)
@@ -1213,6 +1244,17 @@ let save_excursion reference f =
   reference := old;
   res
 
+let save_excursion_and_disable reference f = 
+  save_excursion reference (fun () -> 
+    reference := false;
+    f ()
+  )
+
+let save_excursion_and_enable reference f = 
+  save_excursion reference (fun () -> 
+    reference := true;
+    f ()
+  )
 
 
 let memoized h k f = 
@@ -1401,6 +1443,8 @@ let _init_gc_stack =
   Gc.set {(Gc.get ()) with Gc.stack_limit = 100 * 1024 * 1024}
 
 
+
+
 (* if process a big set of files then dont want get overflow in the middle
  * so for this we are ready to spend some extra time at the beginning that
  * could save far more later.
@@ -3300,7 +3344,7 @@ let files_of_dir_or_files_no_vcs_post_filter regex xs =
     then 
       cmd_to_list 
         ("find " ^ x  ^
-         " -noleaf -type f | grep -v /.hg/ |grep -v /CVS/ | grep -v /.git/"
+         " -noleaf -type f | grep -v /.hg/ |grep -v /CVS/ | grep -v /.git/ |grep -v /_darcs/"
         )
         +> List.filter (fun s -> s =~ regex)
     else [x]
@@ -5347,9 +5391,11 @@ let info_from_charpos a b =
 
 
 
-let (full_charpos_to_pos2: filename -> (int * int) array ) = fun filename ->
+let full_charpos_to_pos2 = fun filename ->
+
+  let size = (filesize filename + 2) in
 
-    let arr = Array.create (filesize filename + 2) (0,0) in
+    let arr = Array.create size  (0,0) in
 
     let chan = open_in filename in
 
@@ -5394,6 +5440,65 @@ let complete_parse_info filename table x =
     column = snd (table.(x.charpos));
   }
 
+
+
+let full_charpos_to_pos_large2 = fun filename ->
+
+  let size = (filesize filename + 2) in
+
+    (* old: let arr = Array.create size  (0,0) in *)
+    let arr1 = Bigarray.Array1.create 
+      Bigarray.int Bigarray.c_layout size in
+    let arr2 = Bigarray.Array1.create 
+      Bigarray.int Bigarray.c_layout size in
+    Bigarray.Array1.fill arr1 0;
+    Bigarray.Array1.fill arr2 0;
+
+    let chan = open_in filename in
+
+    let charpos   = ref 0 in
+    let line  = ref 0 in
+
+    let rec full_charpos_to_pos_aux () =
+     try
+       let s = (input_line chan) in
+       incr line;
+
+       (* '... +1 do'  cos input_line dont return the trailing \n *)
+       for i = 0 to (slength s - 1) + 1 do 
+         (* old: arr.(!charpos + i) <- (!line, i); *)
+         arr1.{!charpos + i} <- (!line);
+         arr2.{!charpos + i} <- i;
+       done;
+       charpos := !charpos + slength s + 1;
+       full_charpos_to_pos_aux();
+       
+     with End_of_file -> 
+       for i = !charpos to (* old: Array.length arr *) 
+         Bigarray.Array1.dim arr1 - 1 do
+         (* old: arr.(i) <- (!line, 0); *)
+         arr1.{i} <- !line;
+         arr2.{i} <- 0;
+       done;
+       ();
+    in 
+    begin 
+      full_charpos_to_pos_aux ();
+      close_in chan;
+      (fun i -> arr1.{i}, arr2.{i})
+    end
+let full_charpos_to_pos_large a =
+  profile_code "Common.full_charpos_to_pos_large" 
+    (fun () -> full_charpos_to_pos_large2 a)
+
+
+let complete_parse_info_large filename table x = 
+  { x with 
+    file = filename;
+    line   = fst (table (x.charpos));
+    column = snd (table (x.charpos));
+  }
+
 (*---------------------------------------------------------------------------*)
 (* Decalage is here to handle stuff such as cpp which include file and who 
  * can make shift.
@@ -5896,6 +6001,34 @@ let md5sum_of_string s =
   | _ -> failwith "md5sum_of_string wrong output"
 
 
+
+let with_pr2_to_string f = 
+  let file = new_temp_file "pr2" "out" in
+  redirect_stdout_stderr file f;
+  cat file
+
+(* julia: convert something printed using format to print into a string *)
+let format_to_string f =
+  let (nm,o) = Filename.open_temp_file "format_to_s" ".out" in
+  Format.set_formatter_out_channel o;
+  let _ = f() in
+  Format.print_newline();
+  Format.print_flush();
+  Format.set_formatter_out_channel stdout;
+  close_out o;
+  let i = open_in nm in
+  let lines = ref [] in
+  let rec loop _ =
+    let cur = input_line i in
+    lines := cur :: !lines;
+    loop() in
+  (try loop() with End_of_file -> ());
+  close_in i;
+  command2 ("rm -f " ^ nm);
+  String.concat "\n" (List.rev !lines)
+
+
+
 (*****************************************************************************)
 (* Misc/test *)
 (*****************************************************************************)
index 5bbdcfc..723748b 100644 (file)
@@ -117,16 +117,21 @@ val reset_pr_indent : unit -> unit
 (* The following functions first indent _tab_level_print spaces.
  * They also add the _prefix_pr, for instance used in MPI to show which
  * worker is talking.
+ * update: for pr2, it can also print into a log file.
  * 
  * The use of 2 in pr2 is because 2 is under UNIX the second descriptor
  * which corresponds to stderr. 
  *)
 val _prefix_pr : string ref
+
 val pr : string -> unit
-val pr2 : string -> unit
 val pr_no_nl : string -> unit
-val pr2_no_nl : string -> unit
 val pr_xxxxxxxxxxxxxxxxx : unit -> unit
+
+(* pr2 print on stderr, but can also in addition print into a file *)
+val _chan_pr2: out_channel option ref
+val pr2 : string -> unit
+val pr2_no_nl : string -> unit
 val pr2_xxxxxxxxxxxxxxxxx : unit -> unit
 
 (* use Dumper.dump *)
@@ -137,10 +142,15 @@ val dump: 'a -> string
 val _already_printed : (string, bool) Hashtbl.t
 val pr2_once : string -> unit
 
+val mk_pr2_wrappers: bool ref -> (string -> unit) * (string -> unit)
+
+
 val redirect_stdout_stderr : filename -> (unit -> unit) -> unit
 val redirect_stdin : filename -> (unit -> unit) -> unit
 val redirect_stdin_opt : filename option -> (unit -> unit) -> unit
 
+val with_pr2_to_string: (unit -> unit) -> string list
+
 val fprintf : out_channel -> ('a, out_channel, unit) format -> 'a
 val printf : ('a, out_channel, unit) format -> 'a
 val eprintf : ('a, out_channel, unit) format -> 'a
@@ -393,6 +403,8 @@ type 'a mylazy = (unit -> 'a)
 
 (* emacs spirit *)
 val save_excursion : 'a ref -> (unit -> 'b) -> 'b
+val save_excursion_and_disable : bool ref -> (unit -> 'b) -> 'b
+val save_excursion_and_enable :  bool ref -> (unit -> 'b) -> 'b
 
 (* emacs spirit *)
 val unwind_protect : (unit -> 'a) -> (exn -> 'b) -> 'a
@@ -1886,6 +1898,12 @@ val full_charpos_to_pos : filename -> (int * int) array
 val complete_parse_info : 
   filename -> (int * int) array -> parse_info -> parse_info
 
+val full_charpos_to_pos_large: 
+  filename -> (int -> (int * int))
+
+val complete_parse_info_large : 
+  filename -> (int -> (int * int))  -> parse_info -> parse_info
+
 (* return line x col x str_line  from a charpos. This function is quite
  * expensive so don't use it to get the line x col from every token in
  * a file. Instead use full_charpos_to_pos.
index f69879b..6c7d60a 100644 (file)
@@ -84,15 +84,17 @@ let glimpseindex ext dir indexdir =
     );
   ()
 
-let _tmpfile = "/tmp/pad_glimpseindex_files.list" 
 
 let glimpseindex_files files indexdir = 
   check_have_glimpse ();
   Common.command2(spf "mkdir -p %s" indexdir);
+
+  let tmpfile = Common.new_temp_file "glimpse" "list" in
+    (* "/tmp/pad_glimpseindex_files.list" *)
   
-  Common.uncat files _tmpfile;
+  Common.uncat files tmpfile;
   Common.command2 
-    (spf "cat %s | %s" _tmpfile (glimpse_cmd indexdir));
+    (spf "cat %s | %s" tmpfile (glimpse_cmd indexdir));
   ()
 
 
index 477b780..83cb129 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,4 +1,7 @@
 #!/usr/bin/perl
+
+# Author: Yoann Padioleau 
+
 ######################################################################
 # Prelude
 ######################################################################
 # assume standard: diff
 # assume standard: perl
 
-#TODO python 2.5 and perhaps a --disable-python
+#TODO check python 2.5 ?
 
 #old: --with-menhir=/path/to/menhirLib or `ocamlfind query menhirLib`
 
 my $project =
     "coccinelle";
 my $projectcmdline =
-    "spatch -cocci_file demos/simple.cocci demos/simple.c";
+    "spatch -sp_file demos/simple.cocci demos/simple.c";
 
 ######################################################################
 # Options
@@ -160,7 +163,7 @@ pr2 "";
 
 $error += check_config(
   "make -v 2>&1 |grep Make|",
-  "GNU Make 3\.[0-9]+", #version 3.81
+  "GNU Make [^0-9]*3\.[0-9]+.*", #version 3.79.1, 3.81
   "make (gnu version) is present.",
   "The program gnu make is missing or is not a good version.
 We need  3.XX",
@@ -202,6 +205,9 @@ on the $project website. !!!!
 ";
 } else {
 
+#pad: before the message was saying (make depend); make all
+# I found this confusing so I removed it.
+
     pr2 "
 
 ----------------------------------------------------------------------
@@ -209,17 +215,20 @@ on the $project website. !!!!
 All seems fine for $project.
 
 To compile $project type:
- (make depend); make all
-or alternatively, for the optimized version:
- (make depend); make all.opt
+  \$ make depend
+  \$ make all
+
+Or alternatively, for the optimized version:
+  \$ make all.opt
 If you want both, you could use:
- (make depend); make world
+  \$ make world
+
 
 To install type:
- make install
 \$ make install
 
 Then, to test $project simply type:
- $projectcmdline
 \$ $projectcmdline
 
 ";
 
index a739d05..65c3338 100644 (file)
@@ -2471,7 +2471,7 @@ let sat m phi reqopt =
       Printf.printf "triples: %d\n" !triples;
       print_state "final result" res;
       *)
-      res)
+      List.sort compare res)
     else
       (if !Flag_ctl.verbose_ctl_engine
       then Common.pr2 "missing something required";
@@ -2484,4 +2484,3 @@ let sat m phi reqopt =
 (* ********************************************************************** *)
 end
 ;;
-
diff --git a/demos/python_regexp.c b/demos/python_regexp.c
new file mode 100644 (file)
index 0000000..d362dfd
--- /dev/null
@@ -0,0 +1,8 @@
+int main()
+{
+       int x;
+
+       x = foo();
+       x = foo_new();
+       x = bar();
+}
diff --git a/demos/python_regexp.cocci b/demos/python_regexp.cocci
new file mode 100644 (file)
index 0000000..dc6c76b
--- /dev/null
@@ -0,0 +1,33 @@
+@initialize:python@
+import re
+m = re.compile('_new$')
+
+@r_init@
+expression E;
+identifier id;
+position p;
+@@
+
+E = id@p();
+
+@script:python@
+id << r_init.id;
+@@
+
+print "COCCI: Analyzing %s" % id
+if m.search(id.ident) != None:
+       print "COCCI: %s matchs '_new$'" % id
+else:
+       print "COCCI: %s discarded" % id
+       cocci.include_match(False)
+
+
+@r_do@
+expression E;
+identifier id;
+position r_init.p;
+@@
+
+E = id@p();
++ if (E == NULL)
++   goto err;
index 067c9f1..91d8e35 100644 (file)
@@ -1,25 +1,14 @@
-SUBDIRS=grammar
+SUBDIR=manual
 
-TEX=options.tex
-PDF=$(TEX:.tex=.pdf)
-AUX=$(TEX:.tex=.aux)
-LOG=$(TEX:.tex=.log)
+.PHONY: all clean distclean
 
-.PHONY: all clean distclean $(SUBDIRS)
-.SUFFIXES: .pdf .tex
-
-all: $(PDF) $(SUBDIRS)
-
-$(SUBDIRS):
-       make -C $@
-
-$(PDF): $(TEX)
-       pdflatex $<
+all: 
+       make -C $(SUBDIR)
 
 clean:
-       make -C $(SUBDIRS) clean
-       rm -f $(AUX) $(LOG)
+       make -C $(SUBDIR) clean
 
 distclean:
-       make -C $(SUBDIRS) distclean
-       rm -f $(PDF)
+       make -C $(SUBDIR) distclean
+
+
diff --git a/docs/grammar/Makefile b/docs/grammar/Makefile
deleted file mode 100644 (file)
index 3657fdc..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-TEX=cocci_syntax.tex
-WEB=/var/www/localhost/htdocs/coccinelle/
-EMNWEB=~/website/docs/
-
-PDF=$(TEX:.tex=.pdf)
-HTML=$(TEX:.tex=.html)
-
-
-.phony: all html clean check
-
-all: $(TEX)
-       pdflatex $<
-       pdflatex $<
-
-html: $(HTML)
-
-clean:
-       rm -f *.aux *.dvi *.haux *.htoc *.log *.out *~
-
-distclean: clean
-       rm -f *.pdf *.html *.gif *.css
-
-check: $(HTML)
-       checklink $<
-
-world: all html
-
-universe: world install
-
-install:
-       cp *.css *.gif *.html $(WEB)
-       cp $(PDF) $(WEB)
-       chown apache:apache -R $(WEB)
-       chmod a-w -R $(WEB)
-
-emn_install: world
-       cp *.css *.gif *.html $(EMNWEB)
-       cp $(PDF) $(EMNWEB)
-
-############################################
-############################################
-
-.SUFFIXES: .html .tex
-
-.tex.html:
-# For Gentoo: /usr/lib64/hevea
-# For Ubuntu family: /usr/share/hevea
-# For default installation
-       @if [ -f /usr/lib64/hevea/xxdate.exe ]; then \
-       hevea -exec /usr/lib64/hevea/xxdate.exe  $< ; \
-       hevea -exec /usr/lib64/hevea/xxdate.exe  $< ; \
-       elif [ -f /usr/share/hevea/xxdate.exe ]; then \
-       hevea -exec /usr/share/hevea/xxdate.exe $< ; \
-       hevea -exec /usr/share/hevea/xxdate.exe $< ; \
-       elif [ -f /usr/local/lib/hevea/xxdate.exe ]; then \
-       hevea -exec /usr/local/lib/hevea/xxdate.exe $< ; \
-       hevea -exec /usr/local/lib/hevea/xxdate.exe $< ; \
-       else \
-       echo -e "\n\n *** Hevea: Unable to find xxdate.exe ***\n\n"; \
-       fi
-       hacha -o index.html cocci_syntax.html
diff --git a/docs/manual.tex b/docs/manual.tex
deleted file mode 100644 (file)
index a4e99aa..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-\documentclass{report}
-
-
-\usepackage{listing}
-
-\title{\spatch and \sgrep manual}
-
-\tableofcontents
-
-%##############################################################################
-\chapter{Introduction}
-
-%_semantic_ patch and grep
-%next-gen
-
-%semantic patch/match
-%SmPL
-%%SMPL => semantic match and patch language ?
-
-%sed on steroids
-
-%features
-
-%abstract away 
-% -
-% -
-% -
-% -
-% -
-
-%submit idea/patch/ or even semantic patch :) to xxx@xxx
-
-%##############################################################################
-\chapter{Building \spatch and \sgrep}
-
-\section{Requirements}
-
-\section{Getting}
-
-\section{Compiling}
-%requirements
-
-\section{Running}
-
-
-
-
-%##############################################################################
-\chapter{Tutorial}
-
-%toy.c, toy.spatch
-
-\section{SmPL piece by pieces}
-
-%very simple ex
-%bigger ex, show different C constructs.
-%%abstract space
-%
-%+
-%-
-%* (a kind of -)
-%
-%first run
-%first process/workflow ?
-%
-%
-%then metavar
-%sed on steroids
-%%abstract xxx
-
-% show vs perl
-
-%then context!! 
-
-%
-%then typed metavar.
-%
-%then iso
-%
-%
-%
-%then '...' and multi usage (in arg, struct, statement)
-%%abstract yyy
-%
-%
-%
-%then multi rules and multi usage
-
-
-
-%##############################################################################
-\chapter{Advanced features}
-
-\subsection{Multi files}
-
-\subsection{Position}
-%src: a mail from julia
-
-%Tu peux maintenant mettre des positions partout.  C'est interdit d'heriter
-%une position a travers une regle qui fait une modif.
-%
-%Tu peux declarer une position avec des contraintes, eg
-%
-%position p1 != {x.p2, y.p3};
-%
-%Entre les premiers @@ d'une regle, tu peux mettre "expression" et avoir
-%une meilleure parsing.  Ca permet par exemple de faire:
-%
-%<... f() ...> + <... g() ...>
-%
-%pour decrire un + qui a f() et g() quelquepart comme arguements.
-%
-%Pour les }, j'ai mis un champ "is_fake" dans les noeuds, avec is_loop,
-%etc.
-
-\subsection{Embeded Python scripting}
-
-\subsection{More on ...}
-
-exists annotation on rule
-
-'when any' and shortest path
-
-
-when strict
-
-
-%##############################################################################
-\chapter{Examples}
-%put additionnal commented scripts ?
-
-
-
-%##############################################################################
-\chapter{Developing a semantic patch}
-
-%best practices
-
-\subsection{Emacs mode}
-
-\subsection{Basic worflow}
-
-\subsection{Linux workflow and git}
-
-%git diff
-%git revert
-
-%multi patch ?
-
-\subsection{Debugging a semantic patch/match}
-
-
-%##############################################################################
-\chapter{\spatch/\sgrep command line options}
-
-%cpp
-
-%iso
-%rules
-
-%##############################################################################
-\chapter{Other tools}
-
-%partial-match?
-
-%cocci-ediff ?
-
-%coccigui
-
-
-
-%org-mode ?
-
-%patchparse
-
-
-%patch handling (splitter, mailer, maintainer)
-
-
-
-
-
-%##############################################################################
-\chapter{Reference}
-%put grammar ?
-
-
-%context!!
-
-%well-formedness
-
-%limitations
-% goto
-% ...
-
-
-%lexical conventions
-% superset of C
-%plus
-% blanks, column!!!
-%comments, c vs cocci comments
-%identifiers
-
-
-\section{Toplevel}
-
-\section{Metavariables}
-%typed metavar
-%scoped metavar and rules
-
-\section{Variables}
-
-\section{Types}
-
-\section{Expressions}
-
-%funcall and ...
-
-%cf also position trick
-
-\section{Statements}
-
-%declaration
-
-%type definition
-% struct iso
-
-
-
-\section{Rules}
-
-
-\section{Isomorphisms}
-
-%named iso
-
-
-%iso file
-%extra file standard.h
-
-%implicit iso
-
-
-\section{cpp quircks}
-
-%declarator
-%declarer
-
-%also extra file standard.h
-
-%##############################################################################
-\appendix
-
-
-
-%index (reversed)
-%index of concepts ? keywords ?
diff --git a/docs/manual/Makefile b/docs/manual/Makefile
new file mode 100644 (file)
index 0000000..865619f
--- /dev/null
@@ -0,0 +1,164 @@
+##############################################################################
+# Variables
+##############################################################################
+
+MAINSRC=main.tex
+SRC=$(wildcard *.tex)
+
+#tools:
+# latex, pdflatex
+# xfig
+# emacs, auctex, ediff
+# darcs
+# latexdiff 
+
+##############################################################################
+# Top rules
+##############################################################################
+.PHONY: all clean distclean
+.SUFFIXES: .pdf .tex
+
+all: manual.pdf cocci_syntax.pdf options.pdf
+
+manual.pdf: $(SRC)
+       pdflatex main.tex
+       pdflatex main.tex
+       mv main.pdf manual.pdf
+
+
+
+
+cocci_syntax.pdf: main_grammar.tex cocci_syntax.tex  macros_listing_cocci.tex macros_grammar.tex macros_common.tex examples.tex tips.tex
+       pdflatex main_grammar.tex
+       pdflatex main_grammar.tex
+       mv main_grammar.pdf cocci_syntax.pdf
+
+options.pdf: main_options.tex spatch_options.tex   macros_options.tex 
+       pdflatex main_options.tex
+       pdflatex main_options.tex
+       mv main_options.pdf options.pdf
+
+
+
+
+distclean:: clean
+       rm -f manual.pdf cocci_syntax.pdf options.pdf
+
+
+# lindig trick
+#RERUN =     Rerun (LaTeX|to get cross-references right)
+#
+#pdf:      $(PDF)
+#
+#%.pdf:        %.tex 
+#          $(PDFLATEX) $<
+#          if egrep -s '$(RERUN)' $*.log ;then $(PDFLATEX) $<; fi
+#          if egrep -s '$(RERUN)' $*.log ;then $(PDFLATEX) $<; fi
+
+##############################################################################
+# Html version
+##############################################################################
+.PHONY: html check 
+
+.SUFFIXES: .html .tex
+
+TEX=cocci_syntax.tex
+WEB=/var/www/localhost/htdocs/coccinelle/
+EMNWEB=~/website/docs/
+
+PDF=$(TEX:.tex=.pdf)
+HTML=$(TEX:.tex=.html)
+
+html: $(HTML)
+
+clean::
+       rm -f *.aux *.dvi *.haux *.htoc *.log *.out *~
+
+distclean:: clean
+       rm -f *.pdf *.html *.gif *.css
+
+check: $(HTML)
+       checklink $<
+
+world: all html
+
+universe: world install
+
+install:
+       cp *.css *.gif *.html $(WEB)
+       cp $(PDF) $(WEB)
+       chown apache:apache -R $(WEB)
+       chmod a-w -R $(WEB)
+
+emn_install: world
+       cp *.css *.gif *.html $(EMNWEB)
+       cp $(PDF) $(EMNWEB)
+
+
+
+
+.tex.html:
+# For Gentoo: /usr/lib64/hevea
+# For Ubuntu family: /usr/share/hevea
+# For default installation
+       @if [ -f /usr/lib64/hevea/xxdate.exe ]; then \
+       hevea -exec /usr/lib64/hevea/xxdate.exe  $< ; \
+       hevea -exec /usr/lib64/hevea/xxdate.exe  $< ; \
+       elif [ -f /usr/share/hevea/xxdate.exe ]; then \
+       hevea -exec /usr/share/hevea/xxdate.exe $< ; \
+       hevea -exec /usr/share/hevea/xxdate.exe $< ; \
+       elif [ -f /usr/local/lib/hevea/xxdate.exe ]; then \
+       hevea -exec /usr/local/lib/hevea/xxdate.exe $< ; \
+       hevea -exec /usr/local/lib/hevea/xxdate.exe $< ; \
+       else \
+       echo -e "\n\n *** Hevea: Unable to find xxdate.exe ***\n\n"; \
+       fi
+       hacha -o index.html cocci_syntax.html
+
+
+##############################################################################
+# Install
+##############################################################################
+
+
+##############################################################################
+# Developer rules
+##############################################################################
+
+LATEXDIFFOPT=--type=CTRADITIONAL
+
+#if multi files ? sed sur les \input{} ? ou create in another dir ?
+latexdiff:
+       latexdiff $(LATEXDIFFOPT) main-old.tex main.tex > main-diff.tex
+       make MAINSRC=main-diff
+       rm -f main-diff.aux
+
+replacediff:
+       cp main-old.tex main-older.tex
+       cp main.tex main-old.tex
+
+clean::
+       rm -f main-diff.*
+
+update:
+
+commit:
+
+
+##############################################################################
+# Generic rules
+##############################################################################
+FORMAT=letter
+
+%.ps: %.dvi
+       dvips -P cmz $< -o $@ -t $(FORMAT)
+
+clean::
+       rm -f   *.aux \
+                *.bbl \
+                *.blg \
+                *.dvi \
+                *.log \
+                *.out \
+                *.toc
+
diff --git a/docs/manual/advanced.tex b/docs/manual/advanced.tex
new file mode 100644 (file)
index 0000000..ad74da9
--- /dev/null
@@ -0,0 +1 @@
+\chapter{Advanced Features}
similarity index 92%
rename from docs/grammar/cocci_syntax.pdf
rename to docs/manual/cocci_syntax.pdf
index c690e60..d49195f 100644 (file)
Binary files a/docs/grammar/cocci_syntax.pdf and b/docs/manual/cocci_syntax.pdf differ
similarity index 90%
rename from docs/grammar/cocci_syntax.tex
rename to docs/manual/cocci_syntax.tex
index 869ab16..b1c1cd9 100644 (file)
@@ -1,94 +1,3 @@
-\documentclass{article}
-%\usepackage[latin9]{inputenc}
-\usepackage{hevea}
-\usepackage{fullpage}
-\usepackage{alltt}
-\usepackage{xspace}
-\usepackage[pdfborder={0 0 0}]{hyperref}
-\usepackage{listings}
-\usepackage[usenames,dvipsnames]{color}
-\usepackage{times}
-\usepackage[T1]{fontenc}
-\usepackage{multirow}
-
-\lstset{basicstyle=\ttfamily,numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=5pt,language=C,commentstyle=\color{OliveGreen},keywordstyle=\color{blue},stringstyle=\color{BrickRed}}
-
-%
-% You must prefix the +/- lines of
-% cocci files with @+/@- respectively.
-% This will enable the automatic coloration.
-%
-% Note: You need at least the following version of hevea
-% http://hevea.inria.fr/distri/unstable/hevea-2008-12-17.tar.gz
-%
-\ifhevea % For HTML generation
-\lstdefinelanguage{Cocci}{
-morekeywords={idexpression,expression,statement,identifier,type,
-parameter,list,when,strict,any,forall,local,position,typedef},
-keywordstyle=\color{OliveGreen}\bfseries,
-sensitive=false,
-moredelim=[is][\color{blue}]{@M}{@M},
-moredelim=[il][\color{OliveGreen}]{@+},
-moredelim=[il][\color{BrickRed}]{@-}}
-
-\lstdefinelanguage{PatchC}[ANSI]{C}{
-stringstyle=\color{black},
-moredelim=[il][\color{OliveGreen}]{@+},
-moredelim=[il][\color{BrickRed}]{@-},
-moredelim=[il][\color{Plum}]{@M}}
-
-\else % For DVI/PS/PDF generation
-\lstdefinelanguage{Cocci}{
-morekeywords={idexpression,expression,statement,identifier,type,
-parameter,list,when,strict,any,forall,local,position,typedef},
-keywordstyle=\color{OliveGreen}\bfseries,
-sensitive=false,
-moredelim=*[is][\color{blue}]{@M}{@M},
-moredelim=[il][\color{OliveGreen}]{@+},
-moredelim=[il][\color{BrickRed}]{@-}}
-
-\lstdefinelanguage{PatchC}[ANSI]{C}{
-stringstyle=\color{black},
-moredelim=[il][\color{OliveGreen}]{@+},
-moredelim=[il][\color{BrickRed}]{@-},
-moredelim=[il][\color{Plum}]{@M}}
-\fi
-
-\newif\iflanguagestyle
-\languagestylefalse
-\input{grammar}
-
-\newcommand{\sizecodebis}[0]{\scriptsize}
-
-\newcommand{\mita}[1]{\mbox{\it{{#1}}}}
-\newcommand{\mtt}[1]{\mbox{\tt{{#1}}}}
-\newcommand{\msf}[1]{\mbox{\sf{{#1}}}}
-\newcommand{\stt}[1]{\mbox{\scriptsize\tt{{#1}}}}
-\newcommand{\ssf}[1]{\mbox{\scriptsize\sf{{#1}}}}
-\newcommand{\sita}[1]{\mbox{\scriptsize\it{{#1}}}}
-\newcommand{\mrm}[1]{\mbox{\rm{{#1}}}}
-\newcommand{\mth}[1]{\({#1}\)}
-\newcommand{\entails}[2]{\begin{array}{@{}c@{}}{#1}\\\hline{#2}\end{array}}
-\newcommand{\ttlb}{\mbox{\tt \char'173}}
-\newcommand{\ttrb}{\mbox{\tt \char'175}}
-\newcommand{\ttmid}{\mbox{\tt \char'174}}
-\newcommand{\tttld}{\mbox{\tt \char'176}}
-
-\newcommand{\fixme}[1]{{\color{red} #1}}
-
-\ifhevea
-\newcommand{\phantom}{}
-\newcommand{\air}{   }
-\else
-\newcommand{\air}{\phantom{xxx}}
-\fi
-
-\title{The SmPL Grammar (version 0.1.4)}
-\author{Research group on Coccinelle}
-\date{\today}
-
-\begin{document}
-\maketitle
 
 %\section{The SmPL Grammar}
 
@@ -104,11 +13,15 @@ arguments.  The grammar also uses some unspecified nonterminals, such
 as \T{id}, \T{const}, etc.  These refer to the sets suggested by
 the name, {\em i.e.}, \T{id} refers to the set of possible
 C-language identifiers, while \T{const} refers to the set of
-possible C-language constants.  \ifhevea A PDF version of this
-documentation is available at
-\url{http://www.emn.fr/x-info/coccinelle/docs/cocci_syntax.pdf}.\else
+possible C-language constants.  
+%
+\ifhevea 
+A PDF version of this documentation is available at
+\url{http://www.emn.fr/x-info/coccinelle/docs/cocci_syntax.pdf}.
+\else
 A HTML version of this documentation is available online at
-\url{http://www.emn.fr/x-info/coccinelle/docs/cocci_syntax.html}. \fi
+\url{http://www.emn.fr/x-info/coccinelle/docs/cocci_syntax.html}. 
+\fi
 
 %% \ifhevea A PDF
 %% version of this documentation is available at
@@ -878,13 +791,10 @@ in a concise way.
   \CASE{<.*>}
 \end{grammar}
 
-\include{examples}
-\include{tips}
-\end{document}
 
 %%% Local Variables:
 %%% mode: LaTeX
-%%% TeX-master: "cocci_syntax"
+%%% TeX-master: "main_grammar"
 %%% coding: latin-9
 %%% TeX-PDF-mode: t
 %%% ispell-local-dictionary: "american"
diff --git a/docs/manual/copyright.txt b/docs/manual/copyright.txt
new file mode 100644 (file)
index 0000000..e6ad334
--- /dev/null
@@ -0,0 +1,7 @@
+Coccinelle manual - Julia Lawall, Yoann Padioleau 
+
+Copyright (C) 2009, Julia Lawall, Yoann Padioleau 
+
+    Permission is granted to copy, distribute and/or modify this document
+    under the terms of the GNU Free Documentation License, Version 1.3.
+    A copy of the license is included in the file license.txt
diff --git a/docs/manual/installing.tex b/docs/manual/installing.tex
new file mode 100644 (file)
index 0000000..e405401
--- /dev/null
@@ -0,0 +1,16 @@
+%##############################################################################
+\chapter{Installing Coccinelle}
+%##############################################################################
+%\chapter{Building \spatch and \sgrep}
+
+\section{Requirements}
+%coupling: with install.txt 
+
+\section{Getting Coccinelle}
+
+\section{Compiling Coccinelle}
+%coupling: with install.txt 
+
+\section{Running Coccinelle}
+%coupling: with readme.txt 
+
diff --git a/docs/manual/introduction.tex b/docs/manual/introduction.tex
new file mode 100644 (file)
index 0000000..430f2a2
--- /dev/null
@@ -0,0 +1,59 @@
+\chapter{Introduction}
+%src: cocci website, LWN article
+
+Coccinelle is a tool to help automate repetitive 
+source-to-source style-preserving program transformations
+on C source code, like for instance to perform some refactorings.
+%coupling: readme.txt
+Coccinelle is presented as a command line tool called \spatch that takes
+as input the name of a file containing the specification of a program
+transformation, called a {\em semantic patch}, and a set of C files,
+and then performs the transformation on all those C files.
+%synopsis ?
+
+To make it easy to express those transformations,
+Coccinelle proposes a WYSISWYG approach where the C programmer 
+can leverage the things he already knows: the C syntax
+and the patch syntax. Indeed, with Coccinelle transformations
+are written in specific language called SmPL, for 
+Semantic Patch Language, which as the name suggests is very
+close to the syntax of a patch, but which does not 
+work at a line level, than traditional patches do.
+but a more high level, or semantic level.
+
+Here is an example of a simple program transformation.
+To replace every calls to \verb+foo+ of any expression $x$ 
+to a call to \verb+bar+, create a semantic patch file \verb+ex1.cocci+
+(semantic patches usually ends with the \verb+.cocci+  filename extension)
+containing:
+\begin{verbatim}
+@@ expression x; @@
+
+- foo(x)
++ bar(x)
+
+\end{verbatim}
+
+Then to ``apply'' the specified program transformation to a set of C files,
+simply do:
+\begin{verbatim}
+$ spatch -sp_file ex1.cocci *.c
+\end{verbatim}
+%command line: 
+
+%can do inplace, or with git, cf chapter on developing ...
+
+%Other approaches 
+%instead of 
+%expressing the transformation on the internal representation
+%of a C frontend, for instance the abstract syntax tree 
+%used internally by gcc, which would require for the user
+%to learn how to use this internal data structure, 
+
+%if can find and transform, can also find, so semantic grep.
+
+%vs regexp
+%vs ast
+
+%features:
+%src: darcs manual
diff --git a/docs/manual/isomorphisms.tex b/docs/manual/isomorphisms.tex
new file mode 100644 (file)
index 0000000..c0348f1
--- /dev/null
@@ -0,0 +1,2 @@
+\chapter{Isomorphisms and \texttt{standard.iso}}
+
diff --git a/docs/manual/license.txt b/docs/manual/license.txt
new file mode 100644 (file)
index 0000000..2f7e03c
--- /dev/null
@@ -0,0 +1,451 @@
+
+                GNU Free Documentation License
+                 Version 1.3, 3 November 2008
+
+
+ Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+     <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense.  It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does.  But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book.  We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License.  Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein.  The "Document", below,
+refers to any such manual or work.  Any member of the public is a
+licensee, and is addressed as "you".  You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject.  (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.)  The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.  If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant.  The Document may contain zero
+Invariant Sections.  If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.  A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters.  A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text.  A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification.  Examples of
+transparent image formats include PNG, XCF and JPG.  Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page.  For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+The "publisher" means any person or entity that distributes copies of
+the Document to the public.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language.  (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".)  To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document.  These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no
+other conditions whatsoever to those of this License.  You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute.  However, you may accept
+compensation in exchange for copies.  If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover.  Both covers must also clearly and legibly identify
+you as the publisher of these copies.  The front cover must present
+the full title with all words of the title equally prominent and
+visible.  You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to
+give them a chance to provide you with an updated version of the
+Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it.  In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+   from that of the Document, and from those of previous versions
+   (which should, if there were any, be listed in the History section
+   of the Document).  You may use the same title as a previous version
+   if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+   responsible for authorship of the modifications in the Modified
+   Version, together with at least five of the principal authors of the
+   Document (all of its principal authors, if it has fewer than five),
+   unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+   Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+   adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+   giving the public permission to use the Modified Version under the
+   terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+   and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+   to it an item stating at least the title, year, new authors, and
+   publisher of the Modified Version as given on the Title Page.  If
+   there is no section Entitled "History" in the Document, create one
+   stating the title, year, authors, and publisher of the Document as
+   given on its Title Page, then add an item describing the Modified
+   Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+   public access to a Transparent copy of the Document, and likewise
+   the network locations given in the Document for previous versions
+   it was based on.  These may be placed in the "History" section.
+   You may omit a network location for a work that was published at
+   least four years before the Document itself, or if the original
+   publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+   Preserve the Title of the section, and preserve in the section all
+   the substance and tone of each of the contributor acknowledgements
+   and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+   unaltered in their text and in their titles.  Section numbers
+   or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements".  Such a section
+   may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+   or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant.  To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version.  Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity.  If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy.  If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications".  You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other
+documents released under this License, and replace the individual
+copies of this License in the various documents with a single copy
+that is included in the collection, provided that you follow the rules
+of this License for verbatim copying of each of the documents in all
+other respects.
+
+You may extract a single document from such a collection, and
+distribute it individually under this License, provided you insert a
+copy of this License into the extracted document, and follow this
+License in all other respects regarding verbatim copying of that
+document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections.  You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers.  In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions of the
+GNU Free Documentation License from time to time.  Such new versions
+will be similar in spirit to the present version, but may differ in
+detail to address new problems or concerns.  See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation.  If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.  If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy's public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
+11. RELICENSING
+
+"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works.  A
+public wiki that anybody can edit is an example of such a server.  A
+"Massive Multiauthor Collaboration" (or "MMC") contained in the site
+means any set of copyrightable works thus published on the MMC site.
+
+"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 
+license published by Creative Commons Corporation, a not-for-profit 
+corporation with a principal place of business in San Francisco, 
+California, as well as future copyleft versions of that license 
+published by that same organization.
+
+"Incorporate" means to publish or republish a Document, in whole or in 
+part, as part of another Document.
+
+An MMC is "eligible for relicensing" if it is licensed under this 
+License, and if all works that were first published under this License 
+somewhere other than this MMC, and subsequently incorporated in whole or 
+in part into the MMC, (1) had no cover texts or invariant sections, and 
+(2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+    Copyright (c)  YEAR  YOUR NAME.
+    Permission is granted to copy, distribute and/or modify this document
+    under the terms of the GNU Free Documentation License, Version 1.3
+    or any later version published by the Free Software Foundation;
+    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+    A copy of the license is included in the section entitled "GNU
+    Free Documentation License".
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+    with the Invariant Sections being LIST THEIR TITLES, with the
+    Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/docs/manual/macros.tex b/docs/manual/macros.tex
new file mode 100644 (file)
index 0000000..3a008b6
--- /dev/null
@@ -0,0 +1,7 @@
+\newcommand{\spatch}{\texttt{spatch}\xspace}
+\newcommand{\sgrep}{\texttt{sgrep}\xspace}
+
+\newcommand{\cpp}{\texttt{cpp}\xspace}
+
+
+\newcommand{\cocciversion}{0.1.8\xspace}
diff --git a/docs/manual/macros_common.tex b/docs/manual/macros_common.tex
new file mode 100644 (file)
index 0000000..2b6096f
--- /dev/null
@@ -0,0 +1,65 @@
+
+% Very convenient to add comments on the paper. Just set the boolean
+% to false before sending the paper:
+\newboolean{showcomments}
+\setboolean{showcomments}{true}
+\ifthenelse{\boolean{showcomments}}
+{ \newcommand{\mynote}[2]{
+    \fbox{\bfseries\sffamily\scriptsize#1}
+    {\small$\blacktriangleright$\textsf{\emph{#2}}$\blacktriangleleft$}}}
+{ \newcommand{\mynote}[2]{}}
+
+\newcommand\jl[1]{\mynote{Julia}{#1}}
+
+
+
+\newcommand{\sizecodebis}[0]{\scriptsize}
+
+\newcommand{\mita}[1]{\mbox{\it{{#1}}}}
+\newcommand{\mtt}[1]{\mbox{\tt{{#1}}}}
+\newcommand{\msf}[1]{\mbox{\sf{{#1}}}}
+\newcommand{\stt}[1]{\mbox{\scriptsize\tt{{#1}}}}
+\newcommand{\ssf}[1]{\mbox{\scriptsize\sf{{#1}}}}
+\newcommand{\sita}[1]{\mbox{\scriptsize\it{{#1}}}}
+\newcommand{\mrm}[1]{\mbox{\rm{{#1}}}}
+\newcommand{\mth}[1]{\({#1}\)}
+\newcommand{\entails}[2]{\begin{array}{@{}c@{}}{#1}\\\hline{#2}\end{array}}
+\newcommand{\ttlb}{\mbox{\tt \char'173}}
+\newcommand{\ttrb}{\mbox{\tt \char'175}}
+\newcommand{\ttmid}{\mbox{\tt \char'174}}
+\newcommand{\tttld}{\mbox{\tt \char'176}}
+
+\newcommand{\fixme}[1]{{\color{red} #1}}
+
+
+%------------------------------------------------------------------------------
+%%%Squeeze space in bibliographybg
+%  \let\oldthebibliography=\thebibliography
+%  \let\endoldthebibliography=\endthebibliography
+%  \renewenvironment{thebibliography}[1]{%
+%    \begin{oldthebibliography}{#1}%
+%      \setlength{\parskip}{0ex}%
+%      \setlength{\itemsep}{0ex}%
+%  }%
+%  {%
+%    \end{oldthebibliography}%
+%  }
+
+
+%------------------------------------------------------------------------------
+
+%christian lindig tricks: 
+% http://www.st.cs.uni-saarland.de/~lindig/tex.html
+
+%\newif\ifdraft\drafttrue
+
+%see overfull 
+%\ifdraft
+%\overfullrule3pt
+%\fi
+
+
+
+%\def\<#1>{\texttt{#1}}
+%Now I can write \<some code here>, which feels more natural 
+% in the editor than \texttt{some code here}.
diff --git a/docs/manual/macros_listing_cocci.tex b/docs/manual/macros_listing_cocci.tex
new file mode 100644 (file)
index 0000000..7ed91f9
--- /dev/null
@@ -0,0 +1,45 @@
+\lstset{basicstyle=\ttfamily,numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=5pt,language=C,commentstyle=\color{OliveGreen},keywordstyle=\color{blue},stringstyle=\color{BrickRed}}
+
+%
+% You must prefix the +/- lines of
+% cocci files with @+/@- respectively.
+% This will enable the automatic coloration.
+%
+% Note: You need at least the following version of hevea
+% http://hevea.inria.fr/distri/unstable/hevea-2008-12-17.tar.gz
+%
+\ifhevea % For HTML generation
+\lstdefinelanguage{Cocci}{
+morekeywords={idexpression,expression,statement,identifier,type,
+parameter,list,when,strict,any,forall,local,position,typedef},
+keywordstyle=\color{OliveGreen}\bfseries,
+sensitive=false,
+moredelim=[is][\color{blue}]{@M}{@M},
+moredelim=[il][\color{OliveGreen}]{@+},
+moredelim=[il][\color{BrickRed}]{@-}}
+
+\lstdefinelanguage{PatchC}[ANSI]{C}{
+stringstyle=\color{black},
+moredelim=[il][\color{OliveGreen}]{@+},
+moredelim=[il][\color{BrickRed}]{@-},
+moredelim=[il][\color{Plum}]{@M}}
+
+\else % For DVI/PS/PDF generation
+\lstdefinelanguage{Cocci}{
+morekeywords={idexpression,expression,statement,identifier,type,
+parameter,list,when,strict,any,forall,local,position,typedef},
+keywordstyle=\color{OliveGreen}\bfseries,
+sensitive=false,
+moredelim=*[is][\color{blue}]{@M}{@M},
+moredelim=[il][\color{OliveGreen}]{@+},
+moredelim=[il][\color{BrickRed}]{@-}}
+
+\lstdefinelanguage{PatchC}[ANSI]{C}{
+stringstyle=\color{black},
+moredelim=[il][\color{OliveGreen}]{@+},
+moredelim=[il][\color{BrickRed}]{@-},
+moredelim=[il][\color{Plum}]{@M}}
+\fi
+
+\newif\iflanguagestyle
+\languagestylefalse
diff --git a/docs/manual/macros_options.tex b/docs/manual/macros_options.tex
new file mode 100644 (file)
index 0000000..ea919e4
--- /dev/null
@@ -0,0 +1,6 @@
+
+\newcommand{\minimum}[2]{\paragraph*{\makebox[0in][r]{\FilledBigDiamondshape\,\,} {{#1}}} {#2}}
+\newcommand{\normal}[2]{\paragraph*{\makebox[0in][r]{\BigLowerDiamond\,\,} {{#1}}} {#2}}
+\newcommand{\rare}[2]{\paragraph*{\makebox[0in][r]{\BigDiamondshape\,\,} {{#1}}} {#2}}
+\newcommand{\developer}[2]{\paragraph*{{#1}} {#2}}
+
diff --git a/docs/manual/main.tex b/docs/manual/main.tex
new file mode 100644 (file)
index 0000000..52cb41c
--- /dev/null
@@ -0,0 +1,202 @@
+\documentclass{report}
+
+%******************************************************************************
+% Prelude
+%******************************************************************************
+%------------------------------------------------------------------------------
+% Packages
+%------------------------------------------------------------------------------
+
+\usepackage{ifthen}
+\usepackage{hevea}
+
+\usepackage{times}
+\usepackage{fullpage}
+
+\usepackage[T1]{fontenc}
+
+\usepackage{amsmath}
+\usepackage{amssymb}
+
+% fancy symbol, but require latex-extra-fonts (huge) package
+\usepackage[geometry]{ifsym}
+
+
+
+\usepackage{graphics}
+\usepackage[pdftex]{graphicx} 
+
+
+\usepackage{epsfig}
+\usepackage{subfigure}
+\usepackage{wrapfig}
+
+\usepackage[all]{xy}
+
+
+\usepackage{fancyvrb}
+\usepackage{moreverb}
+\usepackage{alltt}
+
+\usepackage{boxedminipage}
+
+\usepackage{xspace}
+\usepackage{endnotes}
+
+\usepackage{multirow}
+%\usepackage{colortbl} % conflict with color package below
+
+\usepackage{listings}
+%\usepackage{code/lgrind}
+
+\usepackage[pdfborder={0 0 0}]{hyperref}
+%\usepackage{url}
+
+\usepackage[usenames,dvipsnames]{color}
+
+%------------------------------------------------------------------------------
+% Shortcuts
+%------------------------------------------------------------------------------
+
+\input{macros_common}
+%e.g: 
+%  \newcommand{\mita}[1]{\mbox{\it{{#1}}}}
+
+\input{macros_options}
+
+\input{macros_listing_cocci} % order is important 
+\input{macros_grammar}
+
+
+%------------------------------------------------------------------------------
+% Globals
+%------------------------------------------------------------------------------
+\input{macros}
+%e.g:
+% \newcommand{\avgcorrect}{96\%\xspace} % if consider all files
+% \newcommand{\MyTool}{aComment\xspace}
+% \newcommand{\bugsfound}{XXX\xspace}
+
+
+%******************************************************************************
+% Title
+%******************************************************************************
+\begin{document}
+%don't want date printed
+\date{}
+
+%------------------------------------------------------------------------------
+\title{
+{\Huge \bf Coccinelle}\\
+{User's manual}\\
+{release \cocciversion}\\
+}
+%\title{\spatch and \sgrep manual}
+
+\author{
+Julia Lawall and Yoann Padioleau \\
+{(with contributions from 
+Rene Rydhof Hansen, 
+Nicolas Palix, 
+Henrik Stuart)
+}
+}  
+%src: Xavier Leroy manual
+
+\date{\today}
+
+\maketitle
+\tableofcontents
+
+%******************************************************************************
+% Body
+%******************************************************************************
+
+\chapter*{Foreword} 
+
+This manual documents the release \cocciversion of Coccinelle.
+It is organized as follows:
+\begin{itemize}
+  \item Part~\ref{part:usermanual} is an introduction to Coccinelle
+  \item Part~\ref{part:refmanual} is the reference description
+    of Coccinelle, its language and command line tool.
+\end{itemize}
+
+\section*{Conventions}
+
+\section*{Copyright}
+
+%coupling: copyright.txt
+Coccinelle is copyright \copyright 2005, 2006, 2007, 2008, 2009 
+University of Copenhagen DIKU and Ecole des Mines de Nantes.
+
+Coccinelle is open source and can be freely redistributed under the
+terms of the GNU General Public License version 2. See the file
+\verb+license.txt+ in the distribution for licensing information.
+
+The present documentation is copyright 2008, 2009 Yoann Padioleau
+and Julia Lawall and distributed under the terms of the 
+GNU Free Documentation License version 1.3.
+
+\section*{Availability}
+
+Coccinelle can be freely downloaded 
+from \verb+http://www.emn.fr/x-info/coccinelle+.
+This website contains also additional information.
+
+
+\part{User Manual}
+\label{part:usermanual}
+
+\input{introduction}
+
+\input{installing} 
+
+\input{tutorial}
+
+\chapter{Examples}
+\input{examples}
+\input{tips}
+
+
+\input{isomorphisms}
+
+\input{parsing}
+
+
+\input{workflow}
+
+\input{advanced}
+
+
+
+
+\part{Reference Manual}
+\label{part:refmanual}
+
+\chapter{SmPL grammar}
+
+\input{cocci_syntax}
+
+\chapter{\spatch command line options}
+
+%coupling: ../spatch.1 
+\input{spatch_options}
+
+%******************************************************************************
+% Appendix
+%******************************************************************************
+
+%index
+
+{\small 
+\bibliographystyle{acm}
+\bibliography{main}
+}
+
+
+%******************************************************************************
+% Postlude
+%******************************************************************************
+
+\end{document}
diff --git a/docs/manual/main_grammar.tex b/docs/manual/main_grammar.tex
new file mode 100644 (file)
index 0000000..b46185e
--- /dev/null
@@ -0,0 +1,45 @@
+\documentclass{article}
+
+\usepackage{times}
+\usepackage{fullpage}
+
+\usepackage[T1]{fontenc}
+%\usepackage[latin9]{inputenc}
+
+\usepackage{ifthen}
+\usepackage{hevea}
+
+\usepackage{alltt}
+\usepackage{xspace}
+\usepackage[pdfborder={0 0 0}]{hyperref}
+\usepackage{listings}
+\usepackage[usenames,dvipsnames]{color}
+\usepackage{multirow}
+
+\input{macros_listing_cocci}
+\input{macros_grammar}
+\input{macros_common}
+
+
+\ifhevea
+\newcommand{\phantom}{}
+\newcommand{\air}{   }
+\else
+\newcommand{\air}{\phantom{xxx}}
+\fi
+
+\title{The SmPL Grammar (version 0.1.4)}
+\author{Research group on Coccinelle}
+\date{\today}
+
+\begin{document}
+\maketitle
+
+
+\input{cocci_syntax}
+
+\include{examples}
+\include{tips}
+
+\end{document}
+
diff --git a/docs/manual/main_options.tex b/docs/manual/main_options.tex
new file mode 100644 (file)
index 0000000..c02f43e
--- /dev/null
@@ -0,0 +1,21 @@
+\documentclass{article}
+
+\usepackage{ifthen}
+
+\usepackage{fullpage}
+\usepackage{amsmath}
+\usepackage{amssymb}
+
+% fancy symbol, but require latex-extra-fonts (huge) package
+\usepackage[geometry]{ifsym}
+
+\input{macros_options}
+
+\title{Coccinelle Usage (version 0.1.7)}
+
+\begin{document}
+\maketitle
+
+\input{spatch_options}
+
+\end{document}
diff --git a/docs/manual/manual.pdf b/docs/manual/manual.pdf
new file mode 100644 (file)
index 0000000..b805854
Binary files /dev/null and b/docs/manual/manual.pdf differ
diff --git a/docs/manual/options.pdf b/docs/manual/options.pdf
new file mode 100644 (file)
index 0000000..be99d47
Binary files /dev/null and b/docs/manual/options.pdf differ
diff --git a/docs/manual/parsing.tex b/docs/manual/parsing.tex
new file mode 100644 (file)
index 0000000..1d17780
--- /dev/null
@@ -0,0 +1 @@
+\chapter{Parsing C, \cpp, and \texttt{standard.h}}
\ No newline at end of file
similarity index 87%
rename from docs/options.tex
rename to docs/manual/spatch_options.tex
index 3b18077..e112a86 100644 (file)
@@ -1,30 +1,3 @@
-\documentclass{article}
-\usepackage{fullpage}
-\usepackage{amsmath}
-\usepackage{amssymb}
-\usepackage{ifthen}
-\usepackage[geometry]{ifsym}
-\title{Coccinelle Usage (version 0.1.4)}
-\newcommand{\minimum}[2]{\paragraph*{\makebox[0in][r]{\FilledBigDiamondshape\,\,} {{#1}}} {#2}}
-\newcommand{\normal}[2]{\paragraph*{\makebox[0in][r]{\BigLowerDiamond\,\,} {{#1}}} {#2}}
-\newcommand{\rare}[2]{\paragraph*{\makebox[0in][r]{\BigDiamondshape\,\,} {{#1}}} {#2}}
-\newcommand{\developer}[2]{\paragraph*{{#1}} {#2}}
-
-% Very convenient to add comments on the paper. Just set the boolean
-% to false before sending the paper:
-\newboolean{showcomments}
-\setboolean{showcomments}{true}
-\ifthenelse{\boolean{showcomments}}
-{ \newcommand{\mynote}[2]{
-    \fbox{\bfseries\sffamily\scriptsize#1}
-    {\small$\blacktriangleright$\textsf{\emph{#2}}$\blacktriangleleft$}}}
-{ \newcommand{\mynote}[2]{}}
-
-\newcommand\jl[1]{\mynote{Julia}{#1}}
-
-\begin{document}
-\maketitle
-
 \section{Introduction}
 
 This document describes the options provided by Coccinelle.  The options
@@ -179,20 +152,14 @@ Test the parsing of cpp code and attributes, respectively.}
 
 \subsection{Selecting C files}
 
-An argument that ends in {\tt .c} is assumed to be a C file to process.  A
-directory can be specified with the option {\bf -dir}, described below.
-Normally, only one C file or one directory is specified.  If multiple files
-are specified, they are treated in parallel, {\em i.e.}, the first semantic
-patch rule is applied to all functions in all files, then the second
-semantic patch rule is applied to all functions in all files, etc.  If a
-directory is specified then no files may be specified and only the
+An argument that ends in {\tt .c} is assumed to be a C file to process.
+Normally, only one C file or one directory is specified.  If multiple C
+files are specified, they are treated in parallel, {\em i.e.}, the first
+semantic patch rule is applied to all functions in all files, then the
+second semantic patch rule is applied to all functions in all files, etc.
+If a directory is specified then no files may be specified and only the
 rightmost directory specified is used.
 
-\minimum{-dir}{ Specify a directory containing C files to process.  By
-  default, the include path will be set to the ``include'' subdirectory of
-  this directory.  A different include path can be specified using the
-  option {\bf -I}.}
-
 \normal{-include\_headers}{ This option causes header files to be processed
 independently.  This option only makes sense if a directory is specified
 using {\bf -dir}.}
@@ -204,6 +171,16 @@ specified.  The index may be created using the script {\tt
 http://webglimpse.net/.  In conjunction with the option {\bf -patch\_cocci}
 this option prints the regular expression that will be passed to glimpse.}
 
+\rare{-dir}{ Specify a directory containing C files to process.  By
+  default, the include path will be set to the ``include'' subdirectory of
+  this directory.  A different include path can be specified using the
+  option {\bf -I}.  {\bf -dir} only considers the rightmost directory in
+  the argument list.  This behavior is convenient for creating a script
+  that always works on a single directory, but allows the user of the
+  script to override the provided directory with another one.  Spatch
+  collects the files in the directory using {\tt find} and does not follow
+  symbolic links.}
+
 \developer{-kbuild\_info $\langle$file$\rangle$}{ The specified file
   contains information about which sets of files should be considered in
   parallel.}
@@ -228,6 +205,9 @@ keeping track of tests that have succeeded and failed.
   Coccinelle to file{\tt{.c}} to the file file{\tt{.res}} representing the
   expected result.}
 
+\developer{-expected\_score\_file $\langle$file$\rangle$}{
+which score file to compare with in the testall run}
+
 \subsection{Parsing C files}
 
 \rare{-show\_c}{Show the C code that is being processed.}
@@ -237,6 +217,19 @@ keeping track of tests that have succeeded and failed.
 \rare{-type\_error\_msg}{Show information about where the C type checker
   was not able to determine the type of an expression.}
 
+\rare{-int\_bits $\langle$n$\rangle$, -long\_bits
+$\langle$n$\rangle$}{Provide integer size information. n is the number of
+bits in an unsigned integer or unsigned long, respectively.  If only the
+option {\bf -int\_bits} is used, unsigned longs will be assumed to have
+twice as many bits as unsigned integers.  If only the option {\bf
+-long\_bits} is used, unsigned ints will be assumed to have half as many
+bits as unsigned integers.  This information is only used in determining
+the types of integer constants, according to the ANSI C standard (C89).  If
+neither is provided, the type of an integer constant is determined by the
+sequence of ``u'' and ``l'' annotations following the constant.  If there
+is none, the constant is assumed to be a signed integer.  If there is only
+``u'', the constant is assumed to be an unsigned integer, etc.}
+
 \developer{-use\_cache} Use preparsed versions of the C files that are
 stored in a cache.
 
@@ -259,15 +252,21 @@ stored in a cache.
 
 \subsubsection*{Macros and other preprocessor code}
 
-\normal{-D $\langle$file$\rangle$, -macro\_file $\langle$file$\rangle$}{
+\normal{-macro\_file $\langle$file$\rangle$}{
   Extra macro definitions to be taken into account when parsing the C
   files.}
 
-\rare{-ifdef\_to\_if}{ This option constructs represents an \#ifdef in
-the source code as a conditional in the control-flow graph.  This option is
-unsafe, as it makes the source code unparsable when \#ifdef is used in a
-way that does not directly convert to a conditional.  Nevertheless, it can
-be useful when \#ifdef is used in a well-structured way.}
+\normal{-macro\_file\_builtins $\langle$file$\rangle$}{
+  Builtin macro definitions to be taken into account when parsing the C
+  files.}
+
+\rare{-ifdef\_to\_if,-no\_ifdef\_to\_if}{
+The option {\bf -ifdef\_to\_if}
+represents an {\tt \#ifdef} in the source code as a conditional in the
+control-flow graph when doing so represents valid code.  {\bf
+-no\_ifdef\_to\_if} disables this feature.  {\bf -ifdef\_to\_if} is the
+default.
+}
 
 \rare{-use\_if0\_code}{ Normally code under \#if 0 is ignored.  If this
 option is set then the code is considered, just like the code under any
@@ -404,6 +403,13 @@ These options use a simplified version of the SmPL language.  {\bf
 
 Normally, the only output is a diff printed to standard output.
 
+\normal{-linux\_spacing, -smpl\_spacing}{Control the spacing within the code
+  added by the semantic patch.  The option {\bf -linux\_spacing} causes
+  spatch to follow the conventions of Linux, regardless of the spacing in
+  the semantic patch.  This is the default.  The option {\bf
+  -smpl\_spacing} causes spatch to follow the spacing given in the semantic
+  patch, within individual lines.}
+
 \rare{-o $\langle$file$\rangle$}{ The output file.}
 
 \rare{-inplace}{ Modify the input file.}
@@ -477,4 +483,3 @@ condition occurs, rather than only once.}
 
 \developer{-pad, -hrule $\langle$dir$\rangle$, -xxx, -l1}{}
 
-\end{document}
similarity index 100%
rename from docs/grammar/tips.tex
rename to docs/manual/tips.tex
diff --git a/docs/manual/tutorial.tex b/docs/manual/tutorial.tex
new file mode 100644 (file)
index 0000000..6840b72
--- /dev/null
@@ -0,0 +1,2 @@
+\chapter{Tutorial}
+
diff --git a/docs/manual/workflow.tex b/docs/manual/workflow.tex
new file mode 100644 (file)
index 0000000..97228d3
--- /dev/null
@@ -0,0 +1,4 @@
+\chapter{Developing a Semantic Patch}
+
+%editing semantic patch, emacs mode
+
diff --git a/docs/options.pdf b/docs/options.pdf
deleted file mode 100644 (file)
index 7184f64..0000000
Binary files a/docs/options.pdf and /dev/null differ
index c38cdc7..87e0ec8 100644 (file)
@@ -21,6 +21,7 @@
 .\" TeX users may be more comfortable with the \fB<whatever>\fP and
 .\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
 .\" respectively. Also \fR for roman.
+.\" pad: src: deputy man page
 .SH NAME
 spatch \- apply a semantic patch file to a set of C files
 
index dd6e5a7..1c4d196 100644 (file)
@@ -434,7 +434,7 @@ let contains_modif =
   let option_default = false in
   let mcode r (_,_,kind,metapos) =
     match kind with
-      Ast.MINUS(_,_) -> true
+      Ast.MINUS(_,_,_,_) -> true
     | Ast.PLUS -> failwith "not possible"
     | Ast.CONTEXT(_,info) -> not (info = Ast.NOTHING) in
   let do_nothing r k e = k e in
@@ -531,7 +531,7 @@ let count_nested_braces s =
   let option_default = 0 in
   let stmt_count r k s =
     match Ast.unwrap s with
-      Ast.Seq(_,_,_,_) | Ast.FunDecl(_,_,_,_,_) -> (k s) + 1
+      Ast.Seq(_,_,_) | Ast.FunDecl(_,_,_,_) -> (k s) + 1
     | _ -> k s in
   let donothing r k e = k e in
   let mcode r x = 0 in
@@ -635,12 +635,10 @@ and get_before_e s a =
       (match Ast.unwrap ast with
        Ast.MetaStmt(_,_,_,_) -> (s,[])
       |        _ -> (s,[Ast.Other s]))
-  | Ast.Seq(lbrace,decls,body,rbrace) ->
+  | Ast.Seq(lbrace,body,rbrace) ->
       let index = count_nested_braces s in
-      let (de,dea) = get_before decls [Ast.WParen(lbrace,index)] in
-      let (bd,_) = get_before body dea in
-      (Ast.rewrap s (Ast.Seq(lbrace,de,bd,rbrace)),
-       [Ast.WParen(rbrace,index)])
+      let (bd,_) = get_before body [Ast.WParen(lbrace,index)] in
+      (Ast.rewrap s (Ast.Seq(lbrace,bd,rbrace)),[Ast.WParen(rbrace,index)])
   | Ast.Define(header,body) ->
       let (body,_) = get_before body [] in
       (Ast.rewrap s (Ast.Define(header,body)), [Ast.Other s])
@@ -674,10 +672,9 @@ and get_before_e s a =
            | Ast.OptCase(case_line) -> failwith "not supported")
          cases in
       (Ast.rewrap s (Ast.Switch(header,lb,cases,rb)),[Ast.Other s])
-  | Ast.FunDecl(header,lbrace,decls,body,rbrace) ->
-      let (de,dea) = get_before decls [] in
-      let (bd,_) = get_before body dea in
-      (Ast.rewrap s (Ast.FunDecl(header,lbrace,de,bd,rbrace)),[])
+  | Ast.FunDecl(header,lbrace,body,rbrace) ->
+      let (bd,_) = get_before body [] in
+      (Ast.rewrap s (Ast.FunDecl(header,lbrace,bd,rbrace)),[])
   | _ ->
       Pretty_print_cocci.statement "" s; Format.print_newline();
       failwith "get_before_e: not supported"
@@ -768,11 +765,10 @@ and get_after_e s a =
                   (Ast.MetaStmt(nm,keep,Ast.SequencibleAfterDots a,i)))),[])
       |        Ast.MetaStmt(_,_,_,_) -> (s,[])
       |        _ -> (s,[Ast.Other s]))
-  | Ast.Seq(lbrace,decls,body,rbrace) ->
+  | Ast.Seq(lbrace,body,rbrace) ->
       let index = count_nested_braces s in
-      let (bd,bda) = get_after body [Ast.WParen(rbrace,index)] in
-      let (de,_) = get_after decls bda in
-      (Ast.rewrap s (Ast.Seq(lbrace,de,bd,rbrace)),
+      let (bd,_) = get_after body [Ast.WParen(rbrace,index)] in
+      (Ast.rewrap s (Ast.Seq(lbrace,bd,rbrace)),
        [Ast.WParen(lbrace,index)])
   | Ast.Define(header,body) ->
       let (body,_) = get_after body a in
@@ -807,10 +803,9 @@ and get_after_e s a =
            | Ast.OptCase(case_line) -> failwith "not supported")
          cases in
       (Ast.rewrap s (Ast.Switch(header,lb,cases,rb)),[Ast.Other s])
-  | Ast.FunDecl(header,lbrace,decls,body,rbrace) ->
-      let (bd,bda) = get_after body [] in
-      let (de,_) = get_after decls bda in
-      (Ast.rewrap s (Ast.FunDecl(header,lbrace,de,bd,rbrace)),[])
+  | Ast.FunDecl(header,lbrace,body,rbrace) ->
+      let (bd,_) = get_after body [] in
+      (Ast.rewrap s (Ast.FunDecl(header,lbrace,bd,rbrace)),[])
   | _ -> failwith "get_after_e: not supported"
 
 let preprocess_dots sl =
@@ -1156,19 +1151,19 @@ let svar_context_with_add_after stmt s label quantified d ast
        Ast.CONTEXT(pos,Ast.BEFOREAFTER(bef,_)) ->
          Ast.CONTEXT(pos,Ast.BEFORE(bef))
       |        Ast.CONTEXT(pos,_) -> Ast.CONTEXT(pos,Ast.NOTHING)
-      | Ast.MINUS(_,_) | Ast.PLUS -> failwith "not possible") in
+      | Ast.MINUS(_,_,_,_) | Ast.PLUS -> failwith "not possible") in
   let middle_metamatch =
     matcher
       (match d with
        Ast.CONTEXT(pos,_) -> Ast.CONTEXT(pos,Ast.NOTHING)
-      | Ast.MINUS(_,_) | Ast.PLUS -> failwith "not possible") in
+      | Ast.MINUS(_,_,_,_) | Ast.PLUS -> failwith "not possible") in
   let last_metamatch =
     matcher
       (match d with
        Ast.CONTEXT(pos,Ast.BEFOREAFTER(_,aft)) ->
          Ast.CONTEXT(pos,Ast.AFTER(aft))
       |        Ast.CONTEXT(_,_) -> d
-      | Ast.MINUS(_,_) | Ast.PLUS -> failwith "not possible") in
+      | Ast.MINUS(_,_,_,_) | Ast.PLUS -> failwith "not possible") in
 
   let rest_nodes =
     ctl_and CTL.NONSTRICT middle_metamatch prelabel_pred in  
@@ -1201,19 +1196,16 @@ let svar_minus_or_no_add_after stmt s label quantified d ast
   let prelabel_pred =
     CTL.Pred (Lib_engine.PrefixLabel(label_var),CTL.Control) in
   let matcher d = make_match None guard (make_meta_rule_elem d fvinfo) in
-  let pure_d =
+  let ender =
+    match (d,after) with
+      (Ast.CONTEXT(pos,Ast.NOTHING),(Tail|End|VeryEnd)) ->
+       (* just match the root. don't care about label; always ok *)
+       make_raw_match None false ast
+    | (Ast.MINUS(pos,inst,adj,[]),(Tail|End|VeryEnd)) ->
     (* don't have to put anything before the beginning, so don't have to
        distinguish the first node.  so don't have to bother about paths,
        just use the label. label ensures that found nodes match up with
        what they should because it is in the lhs of the andany. *)
-    match d with
-       Ast.MINUS(pos,[]) -> true
-      | Ast.CONTEXT(pos,Ast.NOTHING) -> true
-      | _ -> false in
-  let ender =
-    match (pure_d,after) with
-      (true,Tail) | (true,End) | (true,VeryEnd) ->
-       (* the label sharing makes it safe to use AndAny *)
        CTL.HackForStmt(CTL.FORWARD,CTL.NONSTRICT,
                        ctl_and CTL.NONSTRICT label_pred
                          (make_raw_match label false ast),
@@ -1224,7 +1216,7 @@ let svar_minus_or_no_add_after stmt s label quantified d ast
        let rest_metamatch =
          matcher
            (match d with
-             Ast.MINUS(pos,_) -> Ast.MINUS(pos,[])
+             Ast.MINUS(pos,inst,adj,_) -> Ast.MINUS(pos,inst,adj,[])
            | Ast.CONTEXT(pos,_) -> Ast.CONTEXT(pos,Ast.NOTHING)
            | Ast.PLUS -> failwith "not possible") in
        let rest_nodes = ctl_and CTL.NONSTRICT rest_metamatch prelabel_pred in
@@ -1605,17 +1597,19 @@ and statement stmt after quantified minus_quantified
                 is absent *)
              let new_mc =
                match (retmc,semmc) with
-                 (Ast.MINUS(_,l1),Ast.MINUS(_,l2)) when !Flag.sgrep_mode2 ->
+                 (Ast.MINUS(_,inst1,adj1,l1),Ast.MINUS(_,_,_,l2))
+                 when !Flag.sgrep_mode2 ->
                    (* in sgrep mode, we can propagate the - *)
-                   Some (Ast.MINUS(Ast.NoPos,l1@l2))
-               | (Ast.MINUS(_,l1),Ast.MINUS(_,l2))
+                   Some (Ast.MINUS(Ast.NoPos,inst1,adj1,l1@l2))
+               | (Ast.MINUS(_,_,_,l1),Ast.MINUS(_,_,_,l2))
                | (Ast.CONTEXT(_,Ast.BEFORE(l1)),
                   Ast.CONTEXT(_,Ast.AFTER(l2))) ->
                    Some (Ast.CONTEXT(Ast.NoPos,Ast.BEFORE(l1@l2)))
                | (Ast.CONTEXT(_,Ast.BEFORE(_)),Ast.CONTEXT(_,Ast.NOTHING))
                | (Ast.CONTEXT(_,Ast.NOTHING),Ast.CONTEXT(_,Ast.NOTHING)) ->
                    Some retmc
-               | (Ast.CONTEXT(_,Ast.NOTHING),Ast.CONTEXT(_,Ast.AFTER(l))) ->
+               | (Ast.CONTEXT(_,Ast.NOTHING),
+                  Ast.CONTEXT(_,Ast.AFTER(l))) ->
                    Some (Ast.CONTEXT(Ast.NoPos,Ast.BEFORE(l)))
                | _ -> None in
              let ret = Ast.make_mcode "return" in
@@ -1660,24 +1654,24 @@ and statement stmt after quantified minus_quantified
                    quantified minus_quantified label llabel slabel guard in
              dots_done := true;
              make_seq_after term after)
-  | Ast.Seq(lbrace,decls,body,rbrace) ->
-      let (lbfvs,b1fvs,b2fvs,b3fvs,rbfvs) =
+  | Ast.Seq(lbrace,body,rbrace) ->
+      let (lbfvs,b1fvs,b2fvs,rbfvs) =
        match
          seq_fvs quantified
-           [Ast.get_fvs lbrace;Ast.get_fvs decls;
+           [Ast.get_fvs lbrace;
              Ast.get_fvs body;Ast.get_fvs rbrace]
        with
-         [(lbfvs,b1fvs);(_,b2fvs);(_,b3fvs);(rbfvs,_)] ->
-           (lbfvs,b1fvs,b2fvs,b3fvs,rbfvs)
+         [(lbfvs,b1fvs);(_,b2fvs);(rbfvs,_)] ->
+           (lbfvs,b1fvs,b2fvs,rbfvs)
        | _ -> failwith "not possible" in
-      let (mlbfvs,mb1fvs,mb2fvs,mb3fvs,mrbfvs) =
+      let (mlbfvs,mb1fvs,mb2fvs,mrbfvs) =
        match
          seq_fvs minus_quantified
-           [Ast.get_mfvs lbrace;Ast.get_mfvs decls;
+           [Ast.get_mfvs lbrace;
              Ast.get_mfvs body;Ast.get_mfvs rbrace]
        with
-         [(lbfvs,b1fvs);(_,b2fvs);(_,b3fvs);(rbfvs,_)] ->
-           (lbfvs,b1fvs,b2fvs,b3fvs,rbfvs)
+         [(lbfvs,b1fvs);(_,b2fvs);(rbfvs,_)] ->
+           (lbfvs,b1fvs,b2fvs,rbfvs)
        | _ -> failwith "not possible" in
       let pv = count_nested_braces stmt in
       let lv = get_label_ctr() in
@@ -1701,26 +1695,17 @@ and statement stmt after quantified minus_quantified
                paren_pred)) in
       let new_quantified2 =
        Common.union_set b1fvs (Common.union_set b2fvs quantified) in
-      let new_quantified3 = Common.union_set b3fvs new_quantified2 in
       let new_mquantified2 =
        Common.union_set mb1fvs (Common.union_set mb2fvs minus_quantified) in
-      let new_mquantified3 = Common.union_set mb3fvs new_mquantified2 in
       let pattern_as_given =
        let new_quantified2 = Common.union_set [pv] new_quantified2 in
-       let new_quantified3 = Common.union_set [pv] new_quantified3 in
        quantify true [pv;lv]
          (quantify guard b1fvs
             (make_seq
                [start_brace;
                  quantify guard b2fvs
-                   (statement_list decls
-                      (After
-                         (quantify guard b3fvs
-                            (statement_list body
-                               (After (make_seq_after end_brace after))
-                               new_quantified3 new_mquantified3
-                               (Some (lv,ref true)) (* label mostly useful *)
-                               llabel slabel true guard)))
+                   (statement_list body
+                      (After (make_seq_after end_brace after))
                       new_quantified2 new_mquantified2
                       (Some (lv,ref true)) llabel slabel false guard)])) in
       if ends_in_return body
@@ -1742,13 +1727,12 @@ and statement stmt after quantified minus_quantified
              ctl_au
                (make_match empty_rbrace)
                (ctl_ax (* skip the destination label *)
-                  (quantify guard b3fvs
+                  (quantify guard b2fvs
                      (statement_list body End
-                        new_quantified3 new_mquantified3 None llabel slabel
+                        new_quantified2 new_mquantified2 None llabel slabel
                         true guard)))] in
        let pattern3 =
          let new_quantified2 = Common.union_set [pv] new_quantified2 in
-         let new_quantified3 = Common.union_set [pv] new_quantified3 in
          quantify true [pv;lv]
            (quantify guard b1fvs
               (make_seq
@@ -1762,23 +1746,11 @@ and statement stmt after quantified minus_quantified
                            (* want AF even for sgrep *)
                            (CTL.AF(CTL.FORWARD,CTL.STRICT,end_brace))))
                      (quantify guard b2fvs
-                        (statement_list decls
-                           (After
-                              (quantify guard b3fvs
-                                 (statement_list body Tail
-                                       (*After
-                                          (make_seq_after
-                                             nopv_end_brace after)*)
-                                    new_quantified3 new_mquantified3
-                                    None llabel slabel true guard)))
+                        (statement_list body Tail
                            new_quantified2 new_mquantified2
                            (Some (lv,ref true))
                            llabel slabel false guard))])) in
-       ctl_or pattern_as_given
-         (match Ast.unwrap decls with
-           Ast.DOTS([]) -> ctl_or pattern2 pattern3
-         | Ast.DOTS(l) -> pattern3
-         | _ -> failwith "circles and stars not supported")
+       ctl_or pattern_as_given (ctl_or pattern2 pattern3)
       else pattern_as_given
   | Ast.IfThen(ifheader,branch,aft) ->
       ifthen ifheader branch aft after quantified minus_quantified
@@ -1836,7 +1808,7 @@ and statement stmt after quantified minus_quantified
   | Ast.Dots((_,i,d,_),whencodes,bef,aft) ->
       let dot_code =
        match d with
-         Ast.MINUS(_,_) ->
+         Ast.MINUS(_,_,_,_) ->
             (* no need for the fresh metavar, but ... is a bit weird as a
               variable name *)
            Some(make_match (make_meta_rule_elem d ([],[],[])))
@@ -2005,24 +1977,24 @@ and statement stmt after quantified minus_quantified
       wrapper
        (end_control_structure b1fvs switch_header body
           after_pred (Some(ctl_ex after_pred)) None aft after label guard)
-  | Ast.FunDecl(header,lbrace,decls,body,rbrace) ->
-      let (hfvs,b1fvs,lbfvs,b2fvs,b3fvs,b4fvs,rbfvs) =
+  | Ast.FunDecl(header,lbrace,body,rbrace) ->
+      let (hfvs,b1fvs,lbfvs,b2fvs,b3fvs,rbfvs) =
        match
          seq_fvs quantified
-           [Ast.get_fvs header;Ast.get_fvs lbrace;Ast.get_fvs decls;
+           [Ast.get_fvs header;Ast.get_fvs lbrace;
              Ast.get_fvs body;Ast.get_fvs rbrace]
        with
-         [(hfvs,b1fvs);(lbfvs,b2fvs);(_,b3fvs);(_,b4fvs);(rbfvs,_)] ->
-           (hfvs,b1fvs,lbfvs,b2fvs,b3fvs,b4fvs,rbfvs)
+         [(hfvs,b1fvs);(lbfvs,b2fvs);(_,b3fvs);(rbfvs,_)] ->
+           (hfvs,b1fvs,lbfvs,b2fvs,b3fvs,rbfvs)
        | _ -> failwith "not possible" in
-      let (mhfvs,mb1fvs,mlbfvs,mb2fvs,mb3fvs,mb4fvs,mrbfvs) =
+      let (mhfvs,mb1fvs,mlbfvs,mb2fvs,mb3fvs,mrbfvs) =
        match
          seq_fvs quantified
-           [Ast.get_mfvs header;Ast.get_mfvs lbrace;Ast.get_mfvs decls;
+           [Ast.get_mfvs header;Ast.get_mfvs lbrace;
              Ast.get_mfvs body;Ast.get_mfvs rbrace]
        with
-         [(hfvs,b1fvs);(lbfvs,b2fvs);(_,b3fvs);(_,b4fvs);(rbfvs,_)] ->
-           (hfvs,b1fvs,lbfvs,b2fvs,b3fvs,b4fvs,rbfvs)
+         [(hfvs,b1fvs);(lbfvs,b2fvs);(_,b3fvs);(rbfvs,_)] ->
+           (hfvs,b1fvs,lbfvs,b2fvs,b3fvs,rbfvs)
        | _ -> failwith "not possible" in
       let function_header = quantify guard hfvs (make_match header) in
       let start_brace = quantify guard lbfvs (make_match lbrace) in
@@ -2046,16 +2018,14 @@ and statement stmt after quantified minus_quantified
       let new_quantified3 =
        Common.union_set b1fvs
          (Common.union_set b2fvs (Common.union_set b3fvs quantified)) in
-      let new_quantified4 = Common.union_set b4fvs new_quantified3 in
       let new_mquantified3 =
        Common.union_set mb1fvs
          (Common.union_set mb2fvs
             (Common.union_set mb3fvs minus_quantified)) in
-      let new_mquantified4 = Common.union_set mb4fvs new_mquantified3 in
       let fn_nest =
-       match (Ast.undots decls,Ast.undots body,
+       match (Ast.undots body,
               contains_modif rbrace or contains_pos rbrace) with
-         ([],[body],false) ->
+         ([body],false) ->
            (match Ast.unwrap body with
              Ast.Nest(stmt_dots,[],multi,_,_) ->
                if multi
@@ -2081,7 +2051,7 @@ and statement stmt after quantified minus_quantified
               statement_list stmt_dots
                 (* discards match on right brace, but don't need it *)
                 (Guard (make_seq_after end_brace after))
-                new_quantified4 new_mquantified4
+                new_quantified3 new_mquantified3
                 None llabel slabel true guard)
        | Some (Common.Right whencode) ->
            (* try to be more efficient for the case where the body is just
@@ -2102,7 +2072,7 @@ and statement stmt after quantified minus_quantified
                                  | Ast.WhenNot(sl) ->
                                      let x =
                                        statement_list sl Tail
-                                         new_quantified4 new_mquantified4
+                                         new_quantified3 new_mquantified3
                                          label llabel slabel true true in
                                      ctl_or prev x
                                  | Ast.WhenNotTrue(_) | Ast.WhenNotFalse(_) ->
@@ -2116,7 +2086,7 @@ and statement stmt after quantified minus_quantified
                                 Ast.WhenAlways(s) ->
                                   let x =
                                     statement s Tail
-                                      new_quantified4 new_mquantified4
+                                      new_quantified3 new_mquantified3
                                       label llabel slabel true in
                                   ctl_and prev x
                               | Ast.WhenNot(sl) -> prev
@@ -2130,13 +2100,8 @@ and statement stmt after quantified minus_quantified
            make_seq
              [start_brace;
                quantify guard b3fvs
-                 (statement_list decls
-                    (After
-                       (quantify guard b4fvs
-                          (statement_list body
-                             (After (make_seq_after end_brace after))
-                             new_quantified4 new_mquantified4
-                             None llabel slabel true guard)))
+                 (statement_list body
+                    (After (make_seq_after end_brace after))
                     new_quantified3 new_mquantified3 None llabel slabel
                     false guard)] in
       quantify guard b1fvs
index acfa8e8..b5ef902 100644 (file)
@@ -29,7 +29,7 @@ module CTL = Ast_ctl
 
 let mcode r (_,_,kind,_) =
   match kind with
-    Ast.MINUS(_,_) -> true
+    Ast.MINUS(_,_,_,_) -> true
   | Ast.PLUS -> failwith "not possible"
   | Ast.CONTEXT(_,info) -> not (info = Ast.NOTHING)
 
@@ -183,11 +183,8 @@ and statement testfn mcode tail stmt : 'a list list =
        (* modifications on return are managed in some other way *)
        Ast.Return(_,_) | Ast.ReturnExpr(_,_,_) when tail -> []
       |        _ -> if testfn ast then rule_elem ast else [])
-  | Ast.Seq(lbrace,decls,body,rbrace) ->
-      let body_info =
-       conj
-         (statement_list testfn mcode false decls)
-         (statement_list testfn mcode tail body) in
+  | Ast.Seq(lbrace,body,rbrace) ->
+      let body_info = statement_list testfn mcode tail body in
       if testfn lbrace or testfn rbrace
       then conj_wrapped [lbrace;rbrace] body_info
       else body_info
@@ -230,11 +227,8 @@ and statement testfn mcode tail stmt : 'a list list =
 
   | Ast.Dots(_,whencodes,_,_) -> []
 
-  | Ast.FunDecl(header,lbrace,decls,body,rbrace) ->
-      let body_info =
-       conj
-         (statement_list testfn mcode false decls)
-         (statement_list testfn mcode true body) in
+  | Ast.FunDecl(header,lbrace,body,rbrace) ->
+      let body_info = statement_list testfn mcode true body in
       if testfn header or testfn lbrace or testfn rbrace
       then conj (rule_elem header) body_info
       else body_info
index 3f2e7e9..3bb9e77 100644 (file)
@@ -217,11 +217,12 @@ and typeC tya tyb =
       (sua =*= sub && saopt =*= sbopt && List.length sta =|= List.length stb) 
       >&&> 
       Common.zip sta stb +> List.fold_left 
-        (fun acc ((xfielda, iia), (xfieldb, iib)) -> 
-          let iix = iia in
+        (fun acc ((fielda), (fieldb)) -> 
           acc >>= (fun xs -> 
-            match xfielda, xfieldb with 
-            | EmptyField, EmptyField -> return ((EmptyField, iix)::xs)
+            match fielda, fieldb with 
+            | EmptyField iia, EmptyField iib -> 
+                let iix = iia in
+                return ((EmptyField iix)::xs)
 
             | DeclarationField (FieldDeclList (fa, iipta)), 
               DeclarationField (FieldDeclList (fb, iiptb)) -> 
@@ -253,7 +254,7 @@ and typeC tya tyb =
                   ) (return [])
                  >>= (fun fx -> 
                    return (((DeclarationField 
-                               (FieldDeclList (List.rev fx,iipt))), iix)::xs)
+                               (FieldDeclList (List.rev fx,iipt))))::xs)
                  )
             | _ -> fail
           )
index dd17d4b..e50003c 100644 (file)
@@ -30,6 +30,7 @@ module Flag = Flag_matcher
 (*****************************************************************************)
 (* Wrappers *)
 (*****************************************************************************)
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_matcher.verbose_matcher
 
 (*****************************************************************************)
 (* Helpers *)
@@ -91,12 +92,12 @@ let mcodekind mc = A.get_mcodekind mc
 let mcode_contain_plus = function
   | A.CONTEXT (_,A.NOTHING) -> false
   | A.CONTEXT _ -> true
-  | A.MINUS (_,[]) -> false
-  | A.MINUS (_,x::xs) -> true
+  | A.MINUS (_,_,_,[]) -> false
+  | A.MINUS (_,_,_,x::xs) -> true
   | A.PLUS -> raise Impossible
 
 let mcode_simple_minus = function
-  | A.MINUS (_,[]) -> true
+  | A.MINUS (_,_,_,[]) -> true
   | _ -> false
 
 
@@ -110,8 +111,8 @@ let mcode_simple_minus = function
 
 let minusizer = 
   ("fake","fake"), 
-  {A.line = 0; column =0; A.strbef=[]; A.straft=[];},
-  (A.MINUS(A.DontCarePos, [])),
+  {A.line = 0; A.column =0; A.strbef=[]; A.straft=[];},
+  (A.MINUS(A.DontCarePos,[],-1,[])),
   A.NoMetaPos
 
 let generalize_mcode ia = 
@@ -121,11 +122,11 @@ let generalize_mcode ia =
     | A.PLUS -> raise Impossible
     | A.CONTEXT (A.NoPos,x) -> 
        A.CONTEXT (A.DontCarePos,x)
-    | A.MINUS   (A.NoPos,x) -> 
-       A.MINUS   (A.DontCarePos,x)
+    | A.MINUS   (A.NoPos,inst,adj,x) -> 
+       A.MINUS   (A.DontCarePos,inst,adj,x)
 
     | A.CONTEXT ((A.FixPos _|A.DontCarePos), _) 
-    | A.MINUS ((A.FixPos _|A.DontCarePos), _)
+    | A.MINUS ((A.FixPos _|A.DontCarePos), _, _, _)
         ->
         raise Impossible
   in
@@ -448,10 +449,14 @@ let initialisation_to_affectation decl =
                    ref (Some ((Lib_parsing_c.al_type returnType),local),
                               Ast_c.NotTest) in
                   let ident = name in
-                  let idexpr = (B.Ident (ident), typ),Ast_c.noii in
-                  F.DefineExpr
-                    ((B.Assignment (idexpr, B.SimpleAssign, e), 
-                     Ast_c.noType()), [iini])
+                  let idexpr = 
+                    Ast_c.mk_e_bis (B.Ident (ident)) typ Ast_c.noii
+                  in
+                  let assign = 
+                    Ast_c.mk_e 
+                      (B.Assignment (idexpr,B.SimpleAssign, e)) [iini] in
+                  F.DefineExpr assign
+                    
               | _ -> F.Decl decl
               )
           | _ -> F.Decl decl
@@ -762,7 +767,7 @@ let rec (expression: (A.expression, Ast_c.expression) matcher) =
           ))
       in
       (match term ia1, ib with 
-      | A.Int x, B.Int y -> 
+      | A.Int x, B.Int (y,_) -> 
           X.value_format_flag (fun use_value_equivalence -> 
             if use_value_equivalence 
             then 
@@ -1082,10 +1087,9 @@ let rec (expression: (A.expression, Ast_c.expression) matcher) =
 
 
 
-
 (* ------------------------------------------------------------------------- *)
 and (ident_cpp: info_ident -> (A.ident, B.name) matcher) = 
- fun infoidb ida idb -> 
+ fun infoidb ida idb ->
    match idb with
    | B.RegularName (s, iis) -> 
        let iis = tuple_of_list1 iis in
@@ -1095,7 +1099,11 @@ and (ident_cpp: info_ident -> (A.ident, B.name) matcher) =
            (B.RegularName (s, [iis]))
          ))
    | B.CppConcatenatedName _ | B.CppVariadicName _ |B.CppIdentBuilder _
-       -> raise Todo
+       ->
+        (* This should be moved to the Id case of ident.  Metavariables
+        should be allowed to be bound to such variables.  But doing so
+        would require implementing an appropriate distr function *)
+        fail
 
 and (ident: info_ident -> (A.ident, string * Ast_c.info) matcher) = 
  fun infoidb ida ((idb, iib) as ib) -> 
@@ -1663,7 +1671,7 @@ and (declaration: (A.mcodekind * bool * A.declaration,B.declaration) matcher) =
                          [iisb;lpb;rpb;iiendb;iifakestart] ++ iistob))
           ))))))))
 
-  | _, (B.MacroDecl _ |B.DeclList _) -> fail
+  | _, (B.MacroDecl _ |B.DeclList _) ->       fail
 
 
 
@@ -2229,9 +2237,8 @@ and (struct_fields: (A.declaration list, B.field list) matcher) =
       )
 
 and (struct_field: (A.declaration, B.field) matcher) = fun fa fb -> 
-  let (xfield, iifield) = fb in
 
-  match xfield with 
+  match fb with 
   | B.DeclarationField (B.FieldDeclList (onefield_multivars,iiptvirg)) -> 
 
     let iiptvirgb = tuple_of_list1 iiptvirg in
@@ -2276,8 +2283,8 @@ and (struct_field: (A.declaration, B.field) matcher) = fun fa fb ->
                   return (
                     (fa),
                     ((B.DeclarationField 
-                        (B.FieldDeclList ([onevar, iivirg], [iiptvirgb]))),
-                    iifield)
+                        (B.FieldDeclList ([onevar, iivirg], [iiptvirgb])))
+                    )
                   )
               | _ -> raise Impossible
             )
@@ -2287,11 +2294,12 @@ and (struct_field: (A.declaration, B.field) matcher) = fun fa fb ->
       pr2_once "PB: More that one variable in decl. Have to split";
       fail
     )
-  | B.EmptyField -> 
-      let _iiptvirgb = tuple_of_list1 iifield in
+  | B.EmptyField _iifield -> 
       fail
 
-  | B.MacroStructDeclTodo -> fail
+  | B.MacroDeclField _ -> 
+      raise Todo
+
   | B.CppDirectiveStruct directive -> fail
   | B.IfdefStruct directive -> fail
 
index c9c3d02..e4c83b0 100644 (file)
@@ -380,19 +380,22 @@ let metavars_binding_to_binding2 binding =
 
 
 let (satbis_to_trans_info: 
-  (nodei * Lib_engine.metavars_binding2 * Lib_engine.predicate) list -> 
-  (nodei * Lib_engine.metavars_binding * Ast_cocci.rule_elem) list) = 
+  (int list *
+     (nodei * Lib_engine.metavars_binding2 * Lib_engine.predicate)) list -> 
+  (int list *
+     (nodei * Lib_engine.metavars_binding * Ast_cocci.rule_elem)) list) = 
   fun xs -> 
-    xs +> List.fold_left (fun prev (nodei, binding2, pred) -> 
-         match pred with
-           | Lib_engine.Match (rule_elem) ->
-              if !Flag.track_iso_usage then show_isos rule_elem;
-              (nodei, metavars_binding2_to_binding binding2, rule_elem)
-              ::prev
+    xs +> List.fold_left (fun prev (index,(nodei, binding2, pred)) -> 
+      match pred with
+      | Lib_engine.Match (rule_elem) ->
+         if !Flag.track_iso_usage then show_isos rule_elem;
+         (index,
+          (nodei, metavars_binding2_to_binding binding2, rule_elem))
+         ::prev
             (* see BindGood in asttotctl2 *)
-           | Lib_engine.BindGood (_) -> prev
-           | _ -> raise Impossible
-         ) []
+      | Lib_engine.BindGood (_) -> prev
+      | _ -> raise Impossible
+    ) []
 
 (*****************************************************************************)
 
@@ -418,8 +421,8 @@ let (mysat2:
   Lib_engine.model ->
   (Lib_engine.ctlcocci * (pred list list)) -> 
   (Lib_engine.mvar list*Lib_engine.metavars_binding) ->
-  (Lib_engine.transformation_info * bool * Lib_engine.metavars_binding *
-     Lib_engine.metavars_binding list)) =
+  (Lib_engine.numbered_transformation_info * bool *
+     Lib_engine.metavars_binding * Lib_engine.metavars_binding list)) =
   fun (flow, label, states) ctl (used_after, binding) -> 
     let binding2 = metavars_binding_to_binding2 binding in
     let (triples,(trans_info2, returned_any_states, used_after_envs)) = 
index 593bca6..f515e06 100644 (file)
@@ -19,8 +19,8 @@ val mysat :
   Lib_engine.model -> 
   (Lib_engine.ctlcocci * (pred list list)) -> 
   (Lib_engine.mvar list * Lib_engine.metavars_binding) -> 
-  (Lib_engine.transformation_info *  bool * Lib_engine.metavars_binding *
-     Lib_engine.metavars_binding list)
+  (Lib_engine.numbered_transformation_info *  bool *
+     Lib_engine.metavars_binding * Lib_engine.metavars_binding list)
 
 
 val print_bench : unit -> unit
index 887be68..9bcb3f4 100644 (file)
@@ -21,6 +21,8 @@
 
 
 let debug_engine = ref false
+let verbose_matcher = ref true
+
 
 (* false = simpler formulas, only for debugging *)
 let useEU = ref true
@@ -34,3 +36,7 @@ let only_return_is_error_exit = ref false
 let allow_inconsistent_paths = ref false
 
 let show_misc = ref true
+
+
+let show_transinfo = ref false
+
index 859844e..54647b8 100644 (file)
@@ -77,6 +77,9 @@ type model = Control_flow_c.cflow * label_ctlcocci * nodei list
 type transformation_info = 
  (nodei * metavars_binding * Ast_cocci.rule_elem) list
 
+type numbered_transformation_info = 
+ (int list * (nodei * metavars_binding * Ast_cocci.rule_elem)) list
+
 
 (*****************************************************************************)
 (* comparing binding *)
index 32d69d4..78dfb46 100644 (file)
@@ -250,9 +250,9 @@ module XMATCH = struct
     | Ast_cocci.CONTEXT (pos, xs) -> 
         assert (pos =*= Ast_cocci.NoPos || pos =*= Ast_cocci.DontCarePos);
         Ast_cocci.CONTEXT (posmck, xs)
-    | Ast_cocci.MINUS (pos, xs) -> 
+    | Ast_cocci.MINUS (pos, inst, adj, xs) -> 
         assert (pos =*= Ast_cocci.NoPos || pos =*= Ast_cocci.DontCarePos);
-        Ast_cocci.MINUS (posmck, xs)
+        Ast_cocci.MINUS (posmck, inst, adj, xs)
   
 
   let tag_mck_pos_mcode (x,info,mck,pos) posmck stuff = fun tin -> 
index 0d07454..1a66f31 100644 (file)
@@ -105,11 +105,29 @@ let process_tree inherited_env l =
 let collect_used_after used_after envs =
   List.map (List.filter (function (v,vl) -> List.mem v used_after)) envs
 
+(* ----------------------------------------------------------------------- *)
+(* distinguish between distinct witness trees, each gets an index n *)
+
+let numberify trees =
+  let trees =
+    Common.fold_left_with_index
+      (function acc -> function xs -> function n ->
+       (List.map (function x -> (n,x)) xs) @ acc)
+      [] trees in
+  List.fold_left
+    (function res ->
+      function (n,x) ->
+       let (same,diff) = List.partition (function (ns,xs) -> x = xs) res in
+       match same with
+         [(ns,xs)] -> (n::ns,xs)::diff
+       | _ -> ([n],x)::res)
+    [] trees
+
 (* ----------------------------------------------------------------------- *)
 (* entry point *)
 
 let process used_after inherited_env l =
-  extra_counter := 0;
   let (trees, fresh_envs) =
     List.split (List.map (process_tree inherited_env) l) in
-  (Common.uniq(List.concat trees), collect_used_after used_after fresh_envs)
+  let trees = numberify trees in
+  (trees, collect_used_after used_after fresh_envs)
index 8fa8506..e45a8d6 100644 (file)
@@ -5,7 +5,9 @@ val process :
     (Ograph_extended.nodei *
        (Ast_cocci.meta_name * Lib_engine.metavar_binding_kind2) list *
        Lib_engine.predicate) list list ->
-        (Ograph_extended.nodei *
-           (Ast_cocci.meta_name * Lib_engine.metavar_binding_kind2) list *
-           Lib_engine.predicate) list *
+        (int list *
+           (Ograph_extended.nodei *
+              (Ast_cocci.meta_name * Lib_engine.metavar_binding_kind2)
+              list *
+              Lib_engine.predicate)) list *
           (Ast_cocci.meta_name * Lib_engine.metavar_binding_kind2) list list
index ed6dd49..d18659e 100644 (file)
@@ -54,23 +54,23 @@ let process_sgrep ii mck =
   let col = Ast_c.col_of_info ii in
   let str = Ast_c.str_of_info ii in
   match mck with
-    Ast_cocci.MINUS(pos,repl) ->
+    Ast_cocci.MINUS(pos,inst,adj,repl) ->
       (match extract_sgrep_marker repl with
        (NoMark,_) -> mck
       |        (BefMark(marker),repl) ->
          Printf.printf "Match on line %s starting at %s: line %d offset %d\n"
            marker file line col;
-         Ast_cocci.MINUS(pos,repl)
+         Ast_cocci.MINUS(pos,inst,adj,repl)
       |        (AftMark(marker),repl) ->
          Printf.printf "Match on line %s ending at %s: line %d offset %d\n"
            marker file line (col + String.length str);
-         Ast_cocci.MINUS(pos,repl)
+         Ast_cocci.MINUS(pos,inst,adj,repl)
       |        (BefAftMark(bmarker,amarker),repl) ->
          Printf.printf "Match on line %s starting at %s: line %d offset %d\n"
            bmarker file line col;
          Printf.printf "Match on line %s ending at %s: line %d offset %d\n"
            amarker file line (col + String.length str);
-         Ast_cocci.MINUS(pos,repl))
+         Ast_cocci.MINUS(pos,inst,adj,repl))
   | Ast_cocci.CONTEXT(pos,Ast_cocci.NOTHING) -> mck
   | Ast_cocci.CONTEXT(pos,Ast_cocci.BEFORE(bef)) ->
       (match extract_sgrep_marker bef with
@@ -132,7 +132,8 @@ let process_sgrep ii mck =
          Printf.printf "Match on line %s starting at %s: line %d offset %d\n"
            marker file line col;
          (match extract_sgrep_marker aft with
-           (NoMark,_) -> Ast_cocci.CONTEXT(pos,Ast_cocci.BEFOREAFTER(bef,aft))
+           (NoMark,_) ->
+             Ast_cocci.CONTEXT(pos,Ast_cocci.BEFOREAFTER(bef,aft))
          | (AftMark(marker),[]) ->
              Printf.printf
                "Match on line %s ending at %s: line %d offset %d\n"
index 2e1077f..6bcdb17 100644 (file)
@@ -34,6 +34,7 @@ type xinfo = {
   optional_qualifier_iso : bool;
   value_format_iso : bool;
   current_rule_name : string; (* used for errors *)
+  index : int list (* witness tree indices *)
 }
 
 module XTRANS = struct
@@ -164,11 +165,11 @@ module XTRANS = struct
    let check_pos info mck pos = 
      match mck with
      | Ast_cocci.PLUS -> raise Impossible
-     | Ast_cocci.CONTEXT (Ast_cocci.FixPos (i1,i2),_) 
-     | Ast_cocci.MINUS   (Ast_cocci.FixPos (i1,i2),_) -> 
+     | Ast_cocci.CONTEXT (Ast_cocci.FixPos (i1,i2),_)
+     | Ast_cocci.MINUS   (Ast_cocci.FixPos (i1,i2),_,_,_) -> 
          pos <= i2 && pos >= i1
-     | Ast_cocci.CONTEXT (Ast_cocci.DontCarePos,_) 
-     | Ast_cocci.MINUS   (Ast_cocci.DontCarePos,_) -> 
+     | Ast_cocci.CONTEXT (Ast_cocci.DontCarePos,_)
+     | Ast_cocci.MINUS   (Ast_cocci.DontCarePos,_,_,_) -> 
          true
      | _ ->
         match info with
@@ -184,7 +185,7 @@ module XTRANS = struct
   let tag_with_mck mck ib = fun tin -> 
 
     let cocciinforef = ib.Ast_c.cocci_tag in
-    let (oldmcode, oldenv) = !cocciinforef in
+    let (oldmcode, oldenv) = Ast_c.mcode_and_env_of_cocciref cocciinforef in
 
     let mck =
       (* coccionly: 
@@ -202,41 +203,69 @@ module XTRANS = struct
     );
 
     match (oldmcode,mck) with
-    | (Ast_cocci.CONTEXT(_,Ast_cocci.NOTHING),      _)
+    | (Ast_cocci.CONTEXT(_,Ast_cocci.NOTHING),  _)
     | (_,   Ast_cocci.CONTEXT(_,Ast_cocci.NOTHING)) 
       ->
-        cocciinforef := (mck, tin.binding);
+       let update_inst inst = function
+           Ast_cocci.MINUS (pos,_,adj,any_xxs) ->
+             Ast_cocci.MINUS (pos,inst,adj,any_xxs)
+         | mck -> mck in
+        cocciinforef := Some (update_inst tin.extra.index mck, tin.binding);
         ib
 
+    | (Ast_cocci.MINUS(old_pos,old_inst,old_adj,[]),
+       Ast_cocci.MINUS(new_pos,new_inst,new_adj,[]))
+       when old_pos = new_pos && oldenv =*= tin.binding
+           (* no way to combine adjacency information, just drop one *)
+      ->
+        cocciinforef := Some
+         (Ast_cocci.MINUS
+            (old_pos,Common.union_set old_inst new_inst,old_adj,[]),
+          tin.binding);
+        (if !Flag_matcher.show_misc
+        then pr2 "already tagged but only removed, so safe");
+       ib
+
     | _ -> 
-        if (oldmcode, oldenv) =*= (mck, tin.binding)
-        then begin
-          if !Flag_matcher.show_misc
-          then pr2 "already tagged but with same mcode, so safe";
-          ib
-        end
-        else 
           (* coccionly: 
           if !Flag.sgrep_mode2
           then ib (* safe *)
           else 
           *)
              begin
-            (* coccionly:
-             Format.set_formatter_out_channel stderr;
-              Common.pr2 "SP mcode ";
-              Pretty_print_cocci.print_mcodekind oldmcode;
-              Format.print_newline();
-              Common.pr2 "C code mcode ";
-              Pretty_print_cocci.print_mcodekind mck;
-              Format.print_newline();
-              Format.print_flush();
-            *)
-              failwith
+            (* coccionly: 
+               pad: if dont want cocci write:
+                failwith
                (match Ast_c.pinfo_of_info ib with
                  Ast_c.FakeTok _ -> "already tagged fake token"
+             *)
+              let pm str mcode env =
+                Printf.sprintf
+                  "%s modification:\n%s\nAccording to environment:\n%s\n"
+                  str
+                  (Common.format_to_string
+                     (function _ ->
+                       Pretty_print_cocci.print_mcodekind mcode))
+                  (String.concat "\n"
+                     (List.map
+                        (function ((r,vr),vl) ->
+                          Printf.sprintf "   %s.%s -> %s" r vr
+                            (Common.format_to_string
+                               (function _ ->
+                                 Pretty_print_engine.pp_binding_kind vl)))
+                        env)) in
+              flush stdout; flush stderr;
+              Common.pr2
+                ("\n"^ (pm "previous" oldmcode oldenv) ^ "\n" ^
+                 (pm "current" mck tin.binding));
+               failwith
+                (match Ast_c.pinfo_of_info ib with
+                  Ast_c.FakeTok _ ->
+                    Common.sprintf "%s: already tagged fake token\n"
+                      tin.extra.current_rule_name
                | _ ->
-                   Common.sprintf "%s: already tagged token:\n%s"
+                   Printf.sprintf
+                     "%s: already tagged token:\nC code context\n%s"
                      tin.extra.current_rule_name
                      (Common.error_message (Ast_c.file_of_info ib)
                         (Ast_c.str_of_info ib, Ast_c.opos_of_info ib)))
@@ -276,12 +305,17 @@ module XTRANS = struct
 
   let distribute_mck mcodekind distributef expr tin =
     match mcodekind with
-    | Ast_cocci.MINUS (pos,any_xxs) -> 
+    | Ast_cocci.MINUS (pos,_,adj,any_xxs) -> 
+       let inst = tin.extra.index in
         distributef (
-          (fun ib -> tag_with_mck (Ast_cocci.MINUS (pos,any_xxs)) ib tin),
-          (fun ib -> tag_with_mck (Ast_cocci.MINUS (pos,[])) ib tin),
-          (fun ib -> tag_with_mck (Ast_cocci.MINUS (pos,[])) ib tin),
-          (fun ib -> tag_with_mck (Ast_cocci.MINUS (pos,any_xxs)) ib tin)
+          (fun ib ->
+           tag_with_mck (Ast_cocci.MINUS (pos,inst,adj,any_xxs)) ib tin),
+          (fun ib ->
+           tag_with_mck (Ast_cocci.MINUS (pos,inst,adj,[])) ib tin),
+          (fun ib ->
+           tag_with_mck (Ast_cocci.MINUS (pos,inst,adj,[])) ib tin),
+          (fun ib ->
+           tag_with_mck (Ast_cocci.MINUS (pos,inst,adj,any_xxs)) ib tin)
         ) expr
     | Ast_cocci.CONTEXT (pos,any_befaft) -> 
         (match any_befaft with
@@ -382,11 +416,11 @@ module XTRANS = struct
    let get_pos mck = 
      match mck with
      | Ast_cocci.PLUS -> raise Impossible
-     | Ast_cocci.CONTEXT (Ast_cocci.FixPos (i1,i2),_) 
-     | Ast_cocci.MINUS   (Ast_cocci.FixPos (i1,i2),_) -> 
+     | Ast_cocci.CONTEXT (Ast_cocci.FixPos (i1,i2),_)
+     | Ast_cocci.MINUS   (Ast_cocci.FixPos (i1,i2),_,_,_) -> 
          Ast_cocci.FixPos (i1,i2)
-     | Ast_cocci.CONTEXT (Ast_cocci.DontCarePos,_) 
-     | Ast_cocci.MINUS   (Ast_cocci.DontCarePos,_) -> 
+     | Ast_cocci.CONTEXT (Ast_cocci.DontCarePos,_)
+     | Ast_cocci.MINUS   (Ast_cocci.DontCarePos,_,_,_) -> 
          Ast_cocci.DontCarePos
      | _ -> failwith "weird: dont have position info for the mcodekind"      
       
@@ -498,7 +532,7 @@ let transform_re_node a b tin =
 
 let (transform2: string (* rule name *) -> string list (* dropped_isos *) ->
   Lib_engine.metavars_binding (* inherited bindings *) ->
-  Lib_engine.transformation_info -> F.cflow -> F.cflow) = 
+  Lib_engine.numbered_transformation_info -> F.cflow -> F.cflow) = 
  fun rule_name dropped_isos binding0 xs cflow -> 
 
    let extra = { 
@@ -506,19 +540,20 @@ let (transform2: string (* rule name *) -> string list (* dropped_isos *) ->
      optional_qualifier_iso = not(List.mem "optional_qualifier" dropped_isos);
      value_format_iso = not(List.mem "value_format" dropped_isos);
      current_rule_name = rule_name;
+     index = [];
    } in
 
   (* find the node, transform, update the node,  and iter for all elements *)
 
-   xs +> List.fold_left (fun acc (nodei, binding, rule_elem) -> 
+   xs +> List.fold_left (fun acc (index, (nodei, binding, rule_elem)) -> 
       (* subtil: not cflow#nodes but acc#nodes *)
       let node  = acc#nodes#assoc nodei in 
 
       if !Flag.show_transinfo
       then pr2 "transform one node";
-      
+
       let tin = {
-        XTRANS.extra = extra;
+        XTRANS.extra = {extra with index = index};
         XTRANS.binding = binding0@binding;
         XTRANS.binding0 = []; (* not used - everything constant for trans *)
       } in
index c380456..0e943a9 100644 (file)
@@ -2,5 +2,5 @@
 val transform : 
   string (* rule name *) -> string list (* dropped isos *) ->
   Lib_engine.metavars_binding -> (* inherited bindings *)
-  Lib_engine.transformation_info -> 
+  Lib_engine.numbered_transformation_info -> 
   Control_flow_c.cflow -> Control_flow_c.cflow (* could be unit *)
index 247fa4e..7399eb2 100644 (file)
@@ -41,11 +41,13 @@ let show_mcodekind_in_ctl = ref false
 let show_binding_in_out = ref false
 let show_dependencies =   ref false
 
+let verbose_cocci = ref true
+
 let windows = ref false
 
 let popl = ref false
 
-let ifdef_to_if = ref false
+let ifdef_to_if = ref true(*false*)
 
 type include_options =
     I_UNSPECIFIED | I_NO_INCLUDES | I_NORMAL_INCLUDES | I_ALL_INCLUDES
index 6d7bf93..3670c92 100644 (file)
@@ -1,4 +1,4 @@
-let version = "0.1.7"
+let version = "0.1.8"
 
 let path = 
   try (Sys.getenv "COCCINELLE_HOME") 
index 8156c5f..f7b736a 100644 (file)
@@ -16,12 +16,20 @@ Then simply type
  make
  make install
 
-Note:  'make' will compile the bytecode version by default.
-       You could use 'make all.opt' to have the optimized version.
-       If you compile both, 'make install' will take care of that
-       and install both, spatch and spatch.opt.
-       If you use only one of them, 'make install' will install
-       the one you have compiled, either spatch ou spatch.opt,
-       under the front-end spatch. You could use 'make world' to
-       compile the bytecode and the native code version.
 
+
+
+
+'make' will compile the bytecode version by default.
+You could use 'make all.opt' to have the optimized version.
+If you compile both, 'make install' will take care of that
+and install both, spatch and spatch.opt.
+If you use only one of them, 'make install' will install
+the one you have compiled, either spatch ou spatch.opt,
+under the front-end spatch. You could use 'make world' to
+compile the bytecode and the optimized code version.
+
+We provide the files generated by menhir in the tarball.
+However, 'make distclean' will remove them. You could
+either restore them from the tarball or install menhir.
+Using 'make clean' should be safe with regards to these files.
diff --git a/main.ml b/main.ml
index 52096bb..7aa9ab5 100644 (file)
--- a/main.ml
+++ b/main.ml
@@ -38,17 +38,20 @@ let output_file = ref ""
 let inplace_modif = ref false  (* but keeps a .cocci_orig *)
 let outplace_modif = ref false (* generates a .cocci_res  *)
 
-(* could be avoided by using Common.files_of_dir_or_files instead *)
+(* somehow obsolete now *)
 let dir = ref false 
 
 let include_headers = ref false
 let kbuild_info = ref ""
 
+let macro_file = ref "" 
+
 (* test mode *)
 let test_mode = ref false
 let test_all = ref false
 let test_okfailed = ref false
 let test_regression_okfailed = ref false
+let expected_score_file = ref ""
 
 
 (* action mode *)
@@ -57,7 +60,6 @@ let action = ref ""
 (* works with -test but also in "normal" spatch mode *)
 let compare_with_expected = ref false
 
-
 let distrib_index = ref (None : int option)
 let distrib_max   = ref (None : int option)
 let mod_distrib   = ref false
@@ -86,14 +88,29 @@ let quiet_profile = (
     FC.show_ctl_text;
     FC.show_binding_in_out;
 
+    FC.verbose_cocci;
+
+    Flag_parsing_c.show_parsing_error;
+
+    Flag_parsing_c.verbose_lexing;
+    Flag_parsing_c.verbose_parsing;
+    Flag_parsing_c.verbose_type;
+    Flag_parsing_c.verbose_cfg;
+    Flag_parsing_c.verbose_unparsing;
+    Flag_parsing_c.verbose_visit;
+
+    Flag_matcher.verbose_matcher;
+    Flag_matcher.debug_engine;
+
+    Flag_parsing_c.debug_unparsing;
+
     Flag_parsing_cocci.show_SP;
     Flag_parsing_cocci.show_iso_failures;
+
     Flag_ctl.verbose_ctl_engine;
     Flag_ctl.verbose_match;
-    Flag_matcher.debug_engine;
-    Flag_parsing_c.debug_unparsing;
-    Flag_parsing_c.verbose_type;
-    Flag_parsing_c.verbose_parsing;
+
+
   ])
 
 (* some information that is useful in seeing why a semantic patch doesn't
@@ -101,12 +118,24 @@ work properly *)
 let debug_profile = (
   [
     Flag.show_misc;
+    Flag.show_transinfo;
+
     FC.show_diff;
     FC.show_cocci;
     FC.show_binding_in_out;
     FC.show_dependencies;
-    Flag.show_transinfo;
+
     Flag_parsing_cocci.show_iso_failures;
+
+    FC.verbose_cocci;
+
+    Flag_parsing_c.verbose_cfg;
+    Flag_parsing_c.verbose_unparsing;
+    Flag_parsing_c.verbose_visit;
+
+    Flag_matcher.verbose_matcher;
+
+    Flag_parsing_c.show_parsing_error;
   ],
   [
 
@@ -200,7 +229,9 @@ let short_options = [
 
   "-iso_file", Arg.Set_string Config.std_iso,   
   " <file> (default=" ^ !Config.std_iso ^")";
-  "-macro_file", Arg.Set_string Config.std_h,
+  "-macro_file", Arg.Set_string macro_file,
+  " <file>";
+  "-macro_file_builtins", Arg.Set_string Config.std_h,
   " <file> (default=" ^ !Config.std_h ^ ")";
 
   "-all_includes",
@@ -239,7 +270,7 @@ let short_options = [
     "  guess what";
 
   "-date",   Arg.Unit (fun () -> 
-    pr2 "version: $Date: 2009/04/15 18:01:55 $";
+    pr2 "version: $Date: 2009/05/08 16:15:31 $";
     raise (Common.UnixExit 0)
     ), 
   "   guess what";
@@ -274,11 +305,12 @@ let other_options = [
   "aliases and obsolete options", 
   "",
   [ 
+    "-sp", Arg.Set_string cocci_file,     " short option of -sp_file";
+    "-iso", Arg.Set_string Config.std_iso,   " short option of -iso_file";
+
     "-cocci_file", Arg.Set_string cocci_file, 
     "   <file> the semantic patch file";
-    "-c", Arg.Set_string cocci_file,     " short option of -cocci_file";
-    "-iso", Arg.Set_string Config.std_iso,   " short option of -iso_file";
-    "-D",   Arg.Set_string Config.std_h,     " short option of -macro_file";
+    "-c", Arg.Set_string cocci_file,     " short option of -sp_file";
   ];
 
   "most useful show options", 
@@ -348,6 +380,8 @@ let other_options = [
     "-filter_msg",      Arg.Set  Flag_parsing_c.filter_msg , 
     "  filter some cpp message when the macro is a \"known\" cpp construct";
     "-filter_define_error",Arg.Set Flag_parsing_c.filter_define_error,"  ";
+    "-filter_msg_define_error",Arg.Set Flag_parsing_c.filter_msg_define_error,
+    "  filter the error msg";
     "-filter_passed_level", Arg.Set_int Flag_parsing_c.filter_passed_level,"  ";
 (*  debug cfg doesn't seem to have any effect, so drop it as an option *)
 (*  "-debug_cfg",          Arg.Set Flag_parsing_c.debug_cfg , "  "; *)
@@ -423,6 +457,10 @@ let other_options = [
     "-l1",                Arg.Clear Flag_parsing_c.label_strategy_2, " ";
     "-ifdef_to_if",              Arg.Set FC.ifdef_to_if, 
     "   convert ifdef to if (experimental)";
+    "-no_ifdef_to_if",              Arg.Clear FC.ifdef_to_if, 
+    "   convert ifdef to if (experimental)";
+
+    "-disable_multi_pass", Arg.Set Flag_parsing_c.disable_multi_pass, " ";
 
     "-noif0_passing",   Arg.Clear Flag_parsing_c.if0_passing, 
     " ";
@@ -442,7 +480,15 @@ let other_options = [
        any way of printing things out *)
     "-allow_inconsistent_paths",
     Arg.Set Flag_matcher.allow_inconsistent_paths,
-    "if this flag is set don't check for inconsistent paths; dangerous";    
+    "   if this flag is set don't check for inconsistent paths; dangerous";
+    "-int_bits", Arg.Int Flag_parsing_c.set_int_bits,
+    "  the number of bits in an unsigned int";
+    "-long_bits", Arg.Int Flag_parsing_c.set_long_bits,
+    "  the number of bits in an unsigned long";
+    "-linux_spacing", Arg.Unit Flag_parsing_c.set_linux_spacing,
+    "  spacing of + code follows the conventions of Linux";
+    "-smpl_spacing", Arg.Unit Flag_parsing_c.set_smpl_spacing,
+    "  spacing of + code follows the semantic patch";
   ];
 
   "misc options",
@@ -452,6 +498,8 @@ let other_options = [
     "   option to set if launch spatch in ocamldebug";
     "-disable_once",     Arg.Set Common.disable_pr2_once, 
     "   to print more messages";
+    "-show_trace_profile",          Arg.Set Common.show_trace_profile, 
+    "   show trace";
     "-save_tmp_files",   Arg.Set Common.save_tmp_files,   " ";
   ];
 
@@ -490,6 +538,8 @@ let other_options = [
 
     "-compare_with_expected", Arg.Set compare_with_expected, 
     "   use also file.res"; 
+    "-expected_score_file", Arg.Set_string expected_score_file, 
+    "   which score file to compare with in -testall"; 
     "-relax_include_path", Arg.Set FC.relax_include_path,
     " ";
     
@@ -514,7 +564,6 @@ let other_options = [
 let all_options = 
   short_options ++ List.concat (List.map Common.thd3 other_options)
  
-
   
 (* I don't want the -help and --help that are appended by Arg.align *)
 let arg_align2 xs =
@@ -599,166 +648,175 @@ let glimpse_filter (coccifile, isofile) dir =
 let main_action xs = 
   match xs with
   | x::xs ->
-       adjust_stdin x (fun () ->
-          if !cocci_file =$= ""
-          then failwith "I need a cocci file,  use -sp_file <file>";
-
-         if !dir && !Flag.patch =*= None
-         then
-           (match xs with
-           | [] -> Flag.patch := Some x
-           | _ ->
-               pr2
-                 ("warning: patch output can only be created when only one\n"^
-                  "directory is specified or when the -patch flag is used")
-            );
-
-          let infiles = 
-            Common.profile_code "Main.infiles computation" (fun () -> 
-             match !dir, !kbuild_info, !Flag.use_glimpse with
-              (* glimpse *)
-              | false, _, true -> 
-                  failwith "-use_glimpse works only with -dir"
-              | true, s, true when s <> "" -> 
-                  failwith "-use_glimpse does not work with -kbuild"
-              | true, "", true -> 
-                  if not (null xs)
-                  then failwith "-use_glimpse can accept only one dir";
-
-                 Flag.dir := x;
-                  let files =
-                   match glimpse_filter (!cocci_file, !Config.std_iso) x with
-                     None ->
-                       Common.cmd_to_list (* same as "true, "", _" case *)
-                         (if !include_headers
-                            (* FIXME : Could we remove xs ?
-                               -use_glimpse requires a singleton.
-                               This is checked some lines before.
-                         then ("find "^(join " " (x::xs))^" -name \"*.[ch]\"")
-                         else ("find "^(join " " (x::xs))^" -name \"*.c\""))
-                            *)
-                         then ("find "^ x ^" -name \"*.[ch]\"")
-                         else ("find "^ x ^" -name \"*.c\""))
-                   | Some files -> files in
-                  files +> List.map (fun x -> [x])
-              (* normal *)
-             | false, _, _ -> [x::xs]
-             | true, "", _ -> 
-                 Common.cmd_to_list
-                   (if !include_headers
-                   then ("find "^(join " " (x::xs))^" -name \"*.[ch]\"")
+
+      (* a more general solution would be to use 
+       * Common.files_of_dir_or_files (x::xs) 
+       * as some elements in xs may also be directories, or individual
+       * files.
+       *)
+      if Common.is_directory x
+      then dir := true;
+
+      adjust_stdin x (fun () ->
+        if !cocci_file =$= ""
+        then failwith "I need a cocci file,  use -sp_file <file>";
+
+       if !dir && !Flag.patch =*= None
+       then
+         (match xs with
+         | [] -> Flag.patch := Some x
+         | _ ->
+             pr2
+               ("warning: patch output can only be created when only one\n"^
+                   "directory is specified or when the -patch flag is used")
+          );
+
+        let infiles = 
+          Common.profile_code "Main.infiles computation" (fun () -> 
+           match !dir, !kbuild_info, !Flag.use_glimpse with
+            (* glimpse *)
+            | false, _, true -> 
+                failwith "-use_glimpse works only with -dir"
+            | true, s, true when s <> "" -> 
+                failwith "-use_glimpse does not work with -kbuild"
+            | true, "", true -> 
+                if not (null xs)
+                then failwith "-use_glimpse can accept only one dir";
+
+               Flag.dir := x;
+                let files =
+                 match glimpse_filter (!cocci_file, !Config.std_iso) x with
+                 None ->
+                   Common.cmd_to_list (* same as "true, "", _" case *)
+                     (if !include_headers
+                         (* FIXME : Could we remove xs ?
+                            -use_glimpse requires a singleton.
+                            This is checked some lines before.
+                            then ("find "^(join " " (x::xs))^" -name \"*.[ch]\"")
+                            else ("find "^(join " " (x::xs))^" -name \"*.c\""))
+                         *)
+                     then ("find "^ x ^" -name \"*.[ch]\"")
+                       else ("find "^ x ^" -name \"*.c\""))
+                 | Some files -> files in
+                files +> List.map (fun x -> [x])
+                  (* normal *)
+           | false, _, _ -> [x::xs]
+           | true, "", _ -> 
+               Common.cmd_to_list
+                 (if !include_headers
+                 then ("find "^(join " " (x::xs))^" -name \"*.[ch]\"")
                    else ("find "^(join " " (x::xs))^" -name \"*.c\""))
-                 +> List.map (fun x -> [x])
-
-              (* kbuild *)
-             | true, kbuild_info_file,_ -> 
-                 let dirs = 
-                    Common.cmd_to_list ("find "^(join " " (x::xs))^" -type d") 
-                  in
-                 let info = Kbuild.parse_kbuild_info kbuild_info_file in
-                 let groups = Kbuild.files_in_dirs dirs info in
-                 
-                 groups +> List.map (function Kbuild.Group xs -> xs)
-           )
-          in
-
-         let infiles =
-           match (!distrib_index,!distrib_max) with
-             (None,None) -> infiles
-           | (Some index,Some max) ->
-               (if index >= max
-               then
-                 failwith "index starts at 0, and so must be less than max");
-               if !mod_distrib
-               then
+               +> List.map (fun x -> [x])
+
+            (* kbuild *)
+           | true, kbuild_info_file,_ -> 
+               let dirs = 
+                  Common.cmd_to_list ("find "^(join " " (x::xs))^" -type d") 
+                in
+               let info = Kbuild.parse_kbuild_info kbuild_info_file in
+               let groups = Kbuild.files_in_dirs dirs info in
+               
+               groups +> List.map (function Kbuild.Group xs -> xs)
+         )
+        in
+
+       let infiles =
+         match (!distrib_index,!distrib_max) with
+         (None,None) -> infiles
+         | (Some index,Some max) ->
+             (if index >= max
+             then
+               failwith "index starts at 0, and so must be less than max");
+             if !mod_distrib
+             then
+               let rec loop ct = function
+                 [] -> []
+                 | x::xs ->
+                     if (ct mod max) =|= index
+                     then x::(loop (ct+1) xs)
+                     else loop (ct+1) xs in
+               loop 0 infiles
+             else
+               begin
+                 let all_files = List.length infiles in
+                 let regions = (all_files + (max - 1)) / max in
+                 let this_min = index * regions in
+                 let this_max = (index+1) * regions in
                  let rec loop ct = function
-                     [] -> []
+                   [] -> []
                    | x::xs ->
-                       if (ct mod max) =|= index
+                       if this_min <= ct && ct < this_max
                        then x::(loop (ct+1) xs)
                        else loop (ct+1) xs in
                  loop 0 infiles
-               else
-                 begin
-                   let all_files = List.length infiles in
-                   let regions = (all_files + (max - 1)) / max in
-                   let this_min = index * regions in
-                   let this_max = (index+1) * regions in
-                   let rec loop ct = function
-                       [] -> []
-                     | x::xs ->
-                         if this_min <= ct && ct < this_max
-                         then x::(loop (ct+1) xs)
-                         else loop (ct+1) xs in
-                   loop 0 infiles
-                 end
-           | _ -> failwith "inconsistent distribution information" in
-           
-          let outfiles = 
-            Common.profile_code "Main.outfiles computation" (fun () ->
-             let cocci_infos =
-               Cocci.pre_engine (!cocci_file, !Config.std_iso) in
-             let res =
-               infiles +> List.map (fun cfiles -> 
-                 pr2 ("HANDLING: " ^ (join " " cfiles));
-                 Common.timeout_function_opt !FC.timeout (fun () -> 
-                   Common.report_if_take_time 10 (join " " cfiles) (fun () -> 
+               end
+         | _ -> failwith "inconsistent distribution information" in
+       
+        let outfiles = 
+          Common.profile_code "Main.outfiles computation" (fun () ->
+           let cocci_infos =
+             Cocci.pre_engine (!cocci_file, !Config.std_iso) in
+           let res =
+             infiles +> List.map (fun cfiles -> 
+               pr2 ("HANDLING: " ^ (join " " cfiles));
+               Common.timeout_function_opt !FC.timeout (fun () -> 
+                 Common.report_if_take_time 10 (join " " cfiles) (fun () -> 
                     (* Unix.sleep 1; *)
-                      try 
-                    (* this is the main call *)
-                       Cocci.full_engine cocci_infos cfiles
-                     with 
-                     | Common.UnixExit x -> raise (Common.UnixExit x)
-                     | e ->
-                         if !dir
-                         then begin
-                           pr2 ("EXN:" ^ Printexc.to_string e); 
-                           [] (* *)
-                         end
-                         else raise e))) in
-             Cocci.post_engine cocci_infos;
-             res
-            ) +> List.concat 
-          in
-
-          Common.profile_code "Main.result analysis" (fun () -> 
-             
-           Ctlcocci_integration.print_bench();
+                    try 
+                      (* this is the main call *)
+                     Cocci.full_engine cocci_infos cfiles
+                   with 
+                   | Common.UnixExit x -> raise (Common.UnixExit x)
+                   | e ->
+                       if !dir
+                       then begin
+                         pr2 ("EXN:" ^ Printexc.to_string e); 
+                         [] (* *)
+                       end
+                       else raise e))) in
+           Cocci.post_engine cocci_infos;
+           res
+          ) +> List.concat 
+        in
+
+        Common.profile_code "Main.result analysis" (fun () -> 
+         
+         Ctlcocci_integration.print_bench();
+         
+          let outfiles = Cocci.check_duplicate_modif outfiles in
+          
+          outfiles +> List.iter (fun (infile, outopt) -> 
+           outopt +> Common.do_option (fun outfile -> 
+             if !inplace_modif
+             then begin
+                Common.command2 ("cp "^infile^" "^infile^".cocci_orig");
+                Common.command2 ("cp "^outfile^" "^infile);
+             end;
+
+             if !outplace_modif
+             then Common.command2 ("cp "^outfile^" "^infile^".cocci_res");
              
-            let outfiles = Cocci.check_duplicate_modif outfiles in
-              
-            outfiles +> List.iter (fun (infile, outopt) -> 
-             outopt +> Common.do_option (fun outfile -> 
-               if !inplace_modif
-               then begin
-                  Common.command2 ("cp "^infile^" "^infile^".cocci_orig");
-                  Common.command2 ("cp "^outfile^" "^infile);
-               end;
-
-               if !outplace_modif
-               then Common.command2 ("cp "^outfile^" "^infile^".cocci_res");
-                 
-               if !output_file =$= "" 
-               then begin
-                  let tmpfile = "/tmp/"^Common.basename infile in
-                  pr2 (spf "One file modified. Result is here: %s" tmpfile);
-                  Common.command2 ("cp "^outfile^" "^tmpfile);
-               end
-             ));
-            if !output_file <> "" then
-             (match outfiles with 
-             | [infile, Some outfile] when infile =$= x && null xs -> 
-                  Common.command2 ("cp " ^outfile^ " " ^ !output_file);
-             | [infile, None] when infile =$= x && null xs -> 
-                  Common.command2 ("cp " ^infile^ " " ^ !output_file);
-             | _ -> 
-                  failwith 
-                    ("-o can not be applied because there is multiple " ^
-                        "modified files");
-             );
-            
-            if !compare_with_expected
-            then Testing.compare_with_expected outfiles))
+             if !output_file =$= "" 
+             then begin
+                let tmpfile = "/tmp/"^Common.basename infile in
+                pr2 (spf "One file modified. Result is here: %s" tmpfile);
+                Common.command2 ("cp "^outfile^" "^tmpfile);
+             end
+           ));
+          if !output_file <> "" then
+           (match outfiles with 
+           | [infile, Some outfile] when infile =$= x && null xs -> 
+                Common.command2 ("cp " ^outfile^ " " ^ !output_file);
+           | [infile, None] when infile =$= x && null xs -> 
+                Common.command2 ("cp " ^infile^ " " ^ !output_file);
+           | _ -> 
+                failwith 
+                  ("-o can not be applied because there is multiple " ^
+                      "modified files");
+           );
+          
+          if !compare_with_expected
+          then Testing.compare_with_expected outfiles))
 
   | [] -> raise Impossible
 
@@ -777,9 +835,13 @@ let main () =
 
     let args = ref [] in
 
+    (* Gc.set {(Gc.get ()) with Gc.stack_limit = 1024 * 1024};*)
+
     (* this call can set up many global flag variables via the cmd line *)
     arg_parse2 (Arg.align all_options) (fun x -> args := x::!args) usage_msg;
 
+    (* julia hack so that one can override directories specified on
+     * the command line. *)
     (if !dir
     then
       let chosen_dir =
@@ -794,6 +856,7 @@ let main () =
         else List.hd !args in
       if !FC.include_path =*= None
       then FC.include_path := Some (Filename.concat chosen_dir "include"));
+
     args := List.rev !args;
 
     if !cocci_file <> "" && (not (!cocci_file =~ ".*\\.\\(sgrep\\|spatch\\)$"))
@@ -805,7 +868,10 @@ let main () =
     then Config.std_h := Common.adjust_ext_if_needed !Config.std_h ".h";
 
     if !Config.std_h <> "" 
-    then Parse_c.init_defs !Config.std_h;
+    then Parse_c.init_defs_builtins !Config.std_h;
+
+    if !macro_file <> "" 
+    then Parse_c.init_defs_macros !macro_file;
 
 
     (* must be done after Arg.parse, because Common.profile is set by it *)
@@ -825,7 +891,9 @@ let main () =
 
     | []  when !test_all -> 
         FC.include_path := Some "tests/include";
-        Testing.testall ()
+        if !expected_score_file <> ""
+        then Testing.testall ~expected_score_file:!expected_score_file ()
+        else Testing.testall ()
 
     | [] when !test_regression_okfailed -> 
         Testing.test_regression_okfailed ()
@@ -876,9 +944,21 @@ let main () =
     end
   end
 
+
+let main_with_better_error_report () = 
+  if !Common.debugger then main () 
+  else 
+    try 
+      main () 
+    with
+    | Unix.Unix_error (_, "stat", filename) -> 
+        pr2 (spf "ERROR: File %s does not exist" filename);
+        raise (UnixExit (-1))
+    
+
 (*****************************************************************************)
-let _ =
+let start =
   Common.main_boilerplate (fun () -> 
-    main ();
+    main_with_better_error_report ();
     Ctlcocci_integration.print_bench();
   )
index f412b78..fdf2583 100644 (file)
@@ -18,7 +18,7 @@ EXTRAOPT=-for-pack MenhirLib
 ##############################################################################
 # Generic variables
 ##############################################################################
-OCAMLCFLAGS=-g -dtypes
+OCAMLCFLAGS ?=-g -dtypes
 OPTFLAGS=
 
 OCAMLC=ocamlc$(OPTBIN)     $(OCAMLCFLAGS) $(INCLUDES)
index fd31cc9..dc91b3e 100644 (file)
@@ -64,7 +64,7 @@ SYSLIBS= str.cma unix.cma bigarray.cma num.cma
 ##############################################################################
 
 #dont use -custom, it makes the bytecode unportable.
-OCAMLCFLAGS= -g -dtypes # -w A
+OCAMLCFLAGS ?= -g -dtypes # -w A
 #-for-pack Sexplib
 
 # This flag is also used in subdirectories so don't change its name here.
@@ -111,10 +111,10 @@ $(TARGETPACK).cmo: $(OBJS)
 
 # special handling, fun that they use cpp whereas they claim camplp4 can do everything
 pre_sexp.cmo: pre_sexp.ml
-       $(OCAMLC) -pp cpp -c $<
+       $(OCAMLC) -pp "cpp -w" -c $<
 
 pre_sexp.cmx: pre_sexp.ml
-       $(OCAMLOPT) -pp cpp -c $<
+       $(OCAMLOPT) -pp "cpp -w" -c $<
 
 
 
@@ -158,7 +158,7 @@ beforedepend::
 
 # need also -pp cpp here
 depend:: beforedepend
-       $(OCAMLDEP) -pp cpp *.mli *.ml    > .depend
+       $(OCAMLDEP) -pp "cpp -w" *.mli *.ml    > .depend
 
 distclean: clean
        rm -f .depend
index 9850b55..3be6d2e 100644 (file)
@@ -9,14 +9,15 @@ TARGET=parsing_c
 
 # - type_cocci.ml ast_cocci.ml  # + unparse_hrule
 SRC= flag_parsing_c.ml parsing_stat.ml \
- token_c.ml ast_c.ml control_flow_c.ml type_c.ml \
+ token_c.ml ast_c.ml control_flow_c.ml \
  visitor_c.ml lib_parsing_c.ml \
ast_to_flow.ml \
control_flow_c_build.ml \
  pretty_print_c.ml \
  semantic_c.ml lexer_parser.ml parser_c.ml lexer_c.ml \
- token_helpers.ml parsing_hacks.ml \
+ token_helpers.ml token_views_c.ml \
+ cpp_token_c.ml parsing_hacks.ml \
  unparse_cocci.ml unparse_c.ml unparse_hrule.ml  \
- parse_c.ml \
+ parse_c.ml type_c.ml \
  cpp_ast_c.ml \
  type_annoter_c.ml comment_annotater_c.ml \
  compare_c.ml \
@@ -38,7 +39,7 @@ INCLUDES= -I ../commons -I ../commons/ocamlextra -I ../commons/ocollection \
 
 #LIBS=../commons/commons.cma
 #INCLUDES= -I ../commons
-SYSLIBS= str.cma unix.cma
+SYSLIBS= str.cma unix.cma num.cma
 
 ##############################################################################
 # Generic variables
@@ -78,8 +79,6 @@ $(TARGET).top: $(OBJS) $(LIBS)
 clean::
        rm -f $(TARGET).top
 
-
-
 lexer_c.ml: lexer_c.mll
        $(OCAMLLEX) $<
 clean::
@@ -146,6 +145,9 @@ distclean::
 
 beforedepend::
 
+distclean::
+       rm -f .depend
+
 depend:: beforedepend
        $(OCAMLDEP) *.mli *.ml    > .depend
 
index d8824f6..747fac8 100644 (file)
@@ -67,9 +67,11 @@ open Common
 (* forunparser: *)
 
 type posl = int * int (* line-col, for MetaPosValList, for position variables *)
+ (* with sexp *)
 
 (* the virtual position is set in Parsing_hacks.insert_virtual_positions *)
 type virtual_position = Common.parse_info * int (* character offset *)
+ (* with sexp *)
 
 type parse_info = 
   (* Present both in ast and list of tokens *)
@@ -85,6 +87,7 @@ type parse_info =
    * are used to be able to use '=' to compare big ast portions.
    *)
   | AbstractLineTok of Common.parse_info (* local to the abstracted thing *)
+ (* with sexp *)
 
 type info = { 
   pinfo : parse_info;
@@ -92,7 +95,7 @@ type info = {
   (* this cocci_tag can be changed, which is how we can express some program
    * transformations by tagging the tokens involved in this transformation. 
    *)
-  cocci_tag: (Ast_cocci.mcodekind * metavars_binding) ref;
+  cocci_tag: (Ast_cocci.mcodekind * metavars_binding) option ref;
   (* set in comment_annotater_c.ml *)
   comments_tag: comments_around ref;
 
@@ -102,9 +105,16 @@ and il = info list
 
 (* wrap2 is like wrap, except that I use it often for separator such
  * as ','. In that case the info is associated to the argument that
- * follows, so in 'a,b' I will have in the list [(a,[]); (b,[','])]. *)
+ * follows, so in 'a,b' I will have in the list [(a,[]); (b,[','])]. 
+ * 
+ * wrap3 is like wrap, except that I use it in case sometimes it 
+ * will be empty because the info will be included in a nested
+ * entity (e.g. for Ident in expr because it's inlined in the name)
+ * so user should never assume List.length wrap3 > 0.
+ *)
 and 'a wrap  = 'a * il
 and 'a wrap2 = 'a * il
+and 'a wrap3 = 'a * il (* * evotype*)
 
 (* ------------------------------------------------------------------------- *)
 (* Name *)
@@ -113,6 +123,14 @@ and 'a wrap2 = 'a * il
 (* was called 'ident' before, but 'name' is I think better
  * as concatenated strings can be used not only for identifiers and for 
  * declarators, but also for fields, for labels, etc.
+ * 
+ * Note: because now the info is embeded in the name, the info for
+ * expression like Ident, or types like Typename, are not anymore
+ * stored in the expression or type. Hence if you assume this,
+ * which was true before, you are now wrong. So never write code like
+ * let (unwrape,_), ii = e  and use 'ii' believing it contains
+ * the local ii to e. If you want to do that, use the appropiate
+ * wrapper get_local_ii_of_expr_inlining_ii_of_name.
  *)
 and name = 
    | RegularName of string wrap
@@ -150,7 +168,7 @@ and name =
 
 
 and fullType = typeQualifier * typeC
- and typeC = typeCbis wrap
+ and typeC = typeCbis wrap (* todo reput wrap3 *)
 
   and typeCbis =
   | BaseType        of baseType
@@ -208,14 +226,14 @@ and fullType = typeQualifier * typeC
      (* -------------------------------------- *)    
      and structUnion = Struct | Union
      and structType  = field list 
-        and field = fieldbis wrap 
-         and fieldbis = 
+         and field = 
            | DeclarationField of field_declaration
            (* gccext: *)
-           | EmptyField 
+           | EmptyField of info
 
             (* cppext: *)
-           | MacroStructDeclTodo
+           | MacroDeclField of (string * argument wrap2 list) 
+                               wrap (* optional ';'*)
 
             (* cppext: *)
            | CppDirectiveStruct of cpp_directive
@@ -265,7 +283,7 @@ and attribute = attributebis wrap
 (* ------------------------------------------------------------------------- *)
 (* C expression *)
 (* ------------------------------------------------------------------------- *)
-and expression = (expressionbis * exp_info ref (* semantic: *)) wrap
+and expression = (expressionbis * exp_info ref (* semantic: *)) wrap3
  and exp_info = exp_type option * test
   and exp_type = fullType (* Type_c.completed_and_simplified *) * local
     and local = LocalVar of parse_info | NotLocalVar (* cocci: *)
@@ -306,7 +324,7 @@ and expression = (expressionbis * exp_info ref (* semantic: *)) wrap
   | Cast           of fullType * expression                     
 
   (* gccext: *)        
-  | StatementExpr of compound wrap (* ( )     new scope *) 
+  | StatementExpr of compound wrap (* ( )     new scope *) 
   | Constructor  of fullType * initialiser wrap2 (* , *) list 
 
   (* forunparser: *)
@@ -315,7 +333,7 @@ and expression = (expressionbis * exp_info ref (* semantic: *)) wrap
   (* cppext: IfdefExpr TODO *)
 
   (* cppext: normmally just expression *)
-  and argument = (expression, weird_argument) either
+  and argument = (expression, weird_argument) Common.either
    and weird_argument = 
        | ArgType of parameterType
        | ArgAction of action_macro
@@ -336,7 +354,7 @@ and expression = (expressionbis * exp_info ref (* semantic: *)) wrap
     | String of (string * isWchar)
     | MultiString of string list (* can contain MacroString, todo: more info *)
     | Char   of (string * isWchar) (* normally it is equivalent to Int *)
-    | Int    of (string  (* * intType*)) 
+    | Int    of (string * intType)
     | Float  of (string * floatType)
 
     and isWchar = IsWchar | IsChar
@@ -373,7 +391,7 @@ and expression = (expressionbis * exp_info ref (* semantic: *)) wrap
  * 
  *)
 
-and statement = statementbis wrap 
+and statement = statementbis wrap3
  and statementbis = 
   | Labeled       of labeled
   | Compound      of compound   (* new scope *)
@@ -488,7 +506,7 @@ and statement = statementbis wrap
 and declaration = 
   | DeclList of onedecl wrap2 (* , *) list wrap (* ; fakestart sto *)
   (* cppext: *)
-  | MacroDecl of (string * argument wrap2 list) wrap
+  | MacroDecl of (string * argument wrap2 list) wrap (* fakestart *)
 
      and onedecl = 
        { v_namei: (name * (info (* = *) * initialiser) option) option;
@@ -535,7 +553,7 @@ and declaration =
 and definition = definitionbis wrap (* ( ) { } fakestart sto *)
   and definitionbis = 
   { f_name: name;
-    f_type: functionType; (* todo? a functionType2 ? *)
+    f_type: functionType; (* less? a functionType2 ? *)
     f_storage: storage;
     f_body: compound;
     f_attr: attribute list; (* gccext: *)
@@ -553,7 +571,7 @@ and cpp_directive =
   | PragmaAndCo of il 
 (*| Ifdef ? no, ifdefs are handled differently, cf ifdef_directive below *)
 
-and define = string wrap (* #define s *) * (define_kind * define_val)
+and define = string wrap (* #define s eol *) * (define_kind * define_val)
    and define_kind =
    | DefineVar
    | DefineFunc   of ((string wrap) wrap2 list) wrap (* () *)
@@ -650,7 +668,6 @@ and toplevel =
 (* ------------------------------------------------------------------------- *)
 and program = toplevel list
 
-
 (*****************************************************************************)
 (* Cocci Bindings *)
 (*****************************************************************************)
@@ -697,10 +714,12 @@ and metavars_binding = (Ast_cocci.meta_name, metavar_binding_kind) assoc
 and comments_around = {
   mbefore: Token_c.comment_like_token list;
   mafter:  Token_c.comment_like_token list;
-}
-(* old: can do something simpler than CComment for coccinelle, cf above.
-  mbefore: comment_and_relative_pos list;
-  mafter:  comment_and_relative_pos list;
+
+  (* less: could remove ? do something simpler than CComment for
+   * coccinelle, cf above. *)
+  mbefore2: comment_and_relative_pos list;
+  mafter2:  comment_and_relative_pos list;
+  }
   and comment_and_relative_pos = {
 
    minfo: Common.parse_info;
@@ -715,13 +734,12 @@ and comments_around = {
     *  cppbetween: bool; touse? if false positive 
     *  is_alone_in_line: bool; (*for labels, to avoid false positive*)
    *)
- }
 }
 
 and comment = Common.parse_info
 and com = comment list ref
-*)
-
 
+ (* with sexp *)
 
 
 (*****************************************************************************)
@@ -736,17 +754,28 @@ let noType () = ref (None,NotTest)
 let noInstr = (ExprStatement (None), [])
 let noTypedefDef () = None
 
-
 let emptyMetavarsBinding = 
   ([]: metavars_binding)
 
-let emptyAnnot = 
+let emptyAnnotCocci =
   (Ast_cocci.CONTEXT (Ast_cocci.NoPos,Ast_cocci.NOTHING),
   emptyMetavarsBinding)
 
+let emptyAnnot = 
+  (None: (Ast_cocci.mcodekind * metavars_binding) option)
+
+(* compatibility mode *)
+let mcode_and_env_of_cocciref aref = 
+  match !aref with
+  | Some x -> x
+  | None -> emptyAnnotCocci
+
+
 let emptyComments= {
   mbefore = [];
   mafter = [];
+  mbefore2 = [];
+  mafter2 = [];
 }
 
 
@@ -781,10 +810,36 @@ let unwrap = fst
 
 let unwrap2 = fst
 
-
 let unwrap_expr ((unwrap_e, typ), iie) = unwrap_e
 let rewrap_expr ((_old_unwrap_e, typ), iie)  newe = ((newe, typ), iie)
 
+let unwrap_typeC (qu, (typeC, ii)) = typeC
+let rewrap_typeC (qu, (typeC, ii)) newtypeC  = (qu, (newtypeC, ii))
+
+let unwrap_typeCbis (typeC, ii) = typeC
+
+let unwrap_st (unwrap_st, ii) = unwrap_st
+
+(* ------------------------------------------------------------------------- *)
+let mk_e unwrap_e ii = (unwrap_e, noType()), ii
+let mk_e_bis unwrap_e ty ii = (unwrap_e, ty), ii
+
+let mk_ty typeC ii = nQ, (typeC, ii)
+let mk_tybis typeC ii = (typeC, ii)
+
+let mk_st unwrap_st ii = (unwrap_st, ii)
+
+(* ------------------------------------------------------------------------- *)
+let get_ii_typeC_take_care (typeC, ii) = ii
+let get_ii_st_take_care (st, ii) = ii
+let get_ii_expr_take_care (e, ii) = ii
+
+let get_st_and_ii (st, ii) = st, ii
+let get_ty_and_ii (qu, (typeC, ii)) = qu, (typeC, ii)
+let get_e_and_ii  (e, ii) = e, ii
+
+
+(* ------------------------------------------------------------------------- *)
 let get_type_expr ((unwrap_e, typ), iie) = !typ
 let set_type_expr ((unwrap_e, oldtyp), iie) newtyp =
   oldtyp := newtyp
@@ -800,12 +855,6 @@ let get_onlylocal_expr ((unwrap_e, typ), iie) =
   | Some (ft,local), _test -> Some local
   | None, _ -> None
 
-
-
-let unwrap_typeC (qu, (typeC, ii)) = typeC
-let rewrap_typeC (qu, (typeC, ii)) newtypeC  = (qu, (newtypeC, ii))
-
-
 (* ------------------------------------------------------------------------- *)
 let rewrap_str s ii =  
   {ii with pinfo =
@@ -818,6 +867,8 @@ let rewrap_str s ii =
 let rewrap_pinfo pi ii =  
   {ii with pinfo = pi}
 
+
+
 (* info about the current location *)
 let get_pi = function
     OriginTok pi -> pi
@@ -828,7 +879,7 @@ let get_pi = function
 (* original info *)
 let get_opi = function
     OriginTok pi -> pi
-  | ExpandedTok (pi,_) -> pi
+  | ExpandedTok (pi,_) -> pi (* diff with get_pi *)
   | FakeTok (_,_) -> failwith "no position information"
   | AbstractLineTok pi -> pi
 
@@ -849,7 +900,7 @@ let get_info f ii =
 let get_orig_info f ii =
   match ii.pinfo with
     OriginTok pi -> f pi
-  | ExpandedTok (pi,_) -> f pi
+  | ExpandedTok (pi,_) -> f pi (* diff with get_info *)
   | FakeTok (_,(pi,_)) -> f pi
   | AbstractLineTok pi -> f pi
 
@@ -861,7 +912,7 @@ let opos_of_info  ii = get_orig_info (function x -> x.Common.charpos) ii
 let line_of_info  ii = get_orig_info (function x -> x.Common.line)    ii
 let col_of_info   ii = get_orig_info (function x -> x.Common.column)  ii
 let file_of_info  ii = get_orig_info (function x -> x.Common.file)    ii
-let mcode_of_info ii = fst (!(ii.cocci_tag))
+let mcode_of_info ii = fst (mcode_and_env_of_cocciref ii.cocci_tag)
 let pinfo_of_info ii = ii.pinfo
 let parse_info_of_info ii = get_pi ii.pinfo
 
@@ -915,7 +966,7 @@ let info_to_fixpos ii =
 
 (* cocci: *)
 let is_test (e : expression) =
-  let (_,info) = unwrap e in
+  let (_,info), _ = e in
   let (_,test) = !info in
   test =*= Test
 
@@ -973,7 +1024,10 @@ let al_comments x =
         Common.line = magic_real_number;
         Common.column = magic_real_number}) in
   {mbefore = []; (* duplicates mafter of the previous token *)
-    mafter = List.map al_com (keep_cpp x.mafter)}
+   mafter = List.map al_com (keep_cpp x.mafter);
+   mbefore2=[];
+   mafter2=[];
+  }
 
 let al_info_cpp tokenindex x = 
   { pinfo =
@@ -1044,26 +1098,6 @@ let rec (unsplit_comma: ('a, il) either list -> 'a wrap2 list) =
 (* Helpers, could also be put in lib_parsing_c.ml instead *)
 (*****************************************************************************)
 
-let rec stmt_elems_of_sequencable xs = 
-  xs +> Common.map (fun x -> 
-    match x with
-    | StmtElem e -> [e]
-    | CppDirectiveStmt _
-    | IfdefStmt _ 
-        -> 
-        pr2_once ("stmt_elems_of_sequencable: filter a directive");
-        []
-    | IfdefStmt2 (_ifdef, xxs) -> 
-        pr2 ("stmt_elems_of_sequencable: IfdefStm2 TODO?");
-        xxs +> List.map (fun xs -> 
-          let xs' = stmt_elems_of_sequencable xs in
-          xs'
-        ) +> List.flatten
-  ) +> List.flatten
-        
-  
-
-
 (* should maybe be in pretty_print_c ? *)
 
 let s_of_inc_file inc_file = 
@@ -1089,6 +1123,8 @@ let s_of_attr attr =
   +> List.map (fun (Attribute s, ii) -> s)
   +> Common.join ","
 
+
+(* ------------------------------------------------------------------------- *)
 let str_of_name ident = 
   match ident with
   | RegularName (s,ii) -> s
@@ -1100,27 +1136,64 @@ let str_of_name ident =
         (xs +> List.map (fun ((x,iix), iicomma) -> x) +> Common.join ",") ^
         ")"
 
-let info_of_name ident = 
-  match ident with
-  | RegularName (s,ii) -> List.hd ii
+let get_s_and_ii_of_name name = 
+  match name with
+  | RegularName (s, iis) -> s, iis 
+  | CppIdentBuilder ((s, iis), xs) -> s, iis
+  | CppVariadicName (s,iis)  -> 
+      let (iop, iis) = Common.tuple_of_list2 iis in
+      s, [iis]
   | CppConcatenatedName xs -> 
       (match xs with
       | [] -> raise Impossible
-      | ((x,ii1),ii2)::xs -> 
-          List.hd ii1
+      | ((s,iis),noiiop)::xs -> 
+          s, iis
       )
-  | CppVariadicName (s, ii) -> 
-      let (iihash, iis) = Common.tuple_of_list2 ii in 
-      iihash
-  | CppIdentBuilder ((s,iis),xs) -> 
-      List.hd iis
 
-let get_s_and_ii_of_name name = 
-  match name with
-  | RegularName (s, iis) -> s, List.hd iis 
-  | _ -> raise Todo
+let get_s_and_info_of_name name = 
+  let (s,ii) = get_s_and_ii_of_name name in
+  s, List.hd ii
+
+let info_of_name name = 
+  let (s,ii) = get_s_and_ii_of_name name in
+  List.hd ii
+
+let ii_of_name name = 
+  let (s,ii) = get_s_and_ii_of_name name in
+  ii
+
 
 
+let get_local_ii_of_expr_inlining_ii_of_name e = 
+  let (ebis,_),ii = e in
+  match ebis, ii with
+  | Ident name, noii -> 
+      assert(null noii);
+      ii_of_name name
+  | RecordAccess   (e, name), ii -> 
+      ii @ ii_of_name name
+  | RecordPtAccess (e, name), ii -> 
+      ii @ ii_of_name name
+  | _, ii -> ii
+
+
+let get_local_ii_of_tybis_inlining_ii_of_name ty =
+  match ty with
+  | TypeName (name, _typ), [] -> ii_of_name name
+  | _, ii -> ii
+
+(* only Label and Goto have name *)
+let get_local_ii_of_st_inlining_ii_of_name st =
+  match st with
+  | Labeled (Label (name, st)), ii -> ii_of_name name @ ii
+  | Jump (Goto name), ii -> 
+      let (i1, i3) = Common.tuple_of_list2 ii in
+      [i1] @ ii_of_name name @ [i3]
+  | _, ii -> ii
+
+  
+
+(* ------------------------------------------------------------------------- *)
 let name_of_parameter param = 
   param.p_namei +> Common.map_option (str_of_name)
 
index 2885b56..ebcd0a1 100644 (file)
@@ -127,6 +127,8 @@ let annotate_program toks asts =
      info.Ast_c.comments_tag :=
        { Ast_c.mbefore = before';
          Ast_c.mafter = after';
+         mbefore2 = [];
+         mafter2 = [];
        };
      
    );
index bb5894a..0b9062f 100644 (file)
@@ -71,7 +71,7 @@ let normal_form_program xs =
     Visitor_c.kexpr_s = (fun (k,bigf) e -> 
       match e with
       (* todo: should also do something for multistrings *)
-      | (Constant (String (s,kind)), typ), [ii] 
+      | (Constant (String (s,kind)), typ), [ii]
           when Common.string_match_substring cvs_keyword_regexp s -> 
           let newstr = cvs_compute_newstr s in
           (Constant (String (newstr,kind)), typ), [rewrap_str newstr ii]
index fafae71..4bddb08 100644 (file)
@@ -141,23 +141,23 @@ type node = node1 * string
     * if they are in different nodes. Solved by using shared ref
     * and allow the "already-tagged" token.
     *)
-  | SeqStart of statement * int * info
+  | SeqStart of fullstatement * int * info
   | SeqEnd   of int * info
 
 
-  | ExprStatement of statement * (expression option) wrap
+  | ExprStatement of fullstatement * (expression option) wrap
 
 
-  | IfHeader  of statement * expression wrap
+  | IfHeader  of fullstatement * expression wrap
   | Else of info
-  | WhileHeader of statement * expression wrap
-  | DoHeader of statement * info
+  | WhileHeader of fullstatement * expression wrap
+  | DoHeader of fullstatement * info
   | DoWhileTail of expression wrap
-  | ForHeader of statement * 
+  | ForHeader of fullstatement * 
                  (exprStatement wrap * exprStatement wrap * exprStatement wrap)
                  wrap
-  | SwitchHeader of statement * expression wrap
-  | MacroIterHeader of statement * (string * argument wrap2 list) wrap
+  | SwitchHeader of fullstatement * expression wrap
+  | MacroIterHeader of fullstatement * (string * argument wrap2 list) wrap
 
   (* Used to mark the end of if, while, dowhile, for, switch. Later we
    * will be able to "tag" some cocci code on this node.
@@ -198,8 +198,8 @@ type node = node1 * string
    *)
   | EndStatement of info option (* fake_info *)
 
-  | Return     of statement * unit wrap
-  | ReturnExpr of statement * expression wrap
+  | Return     of fullstatement * unit wrap
+  | ReturnExpr of fullstatement * expression wrap
 
   (* ------------------------ *)
   | IfdefHeader of ifdef_directive
@@ -221,11 +221,11 @@ type node = node1 * string
   | MacroTop of string * argument wrap2 list * il 
 
   (* ------------------------ *)
-  | Case  of statement * expression wrap
-  | Default of statement * unit wrap
+  | Case  of fullstatement * expression wrap
+  | Default of fullstatement * unit wrap
 
-  | Continue of statement * unit wrap
-  | Break    of statement * unit wrap
+  | Continue of fullstatement * unit wrap
+  | Break    of fullstatement * unit wrap
 
   (* no counter part in cocci *)
   | CaseRange of fullstatement * (expression * expression) wrap
@@ -233,8 +233,8 @@ type node = node1 * string
   | Goto of fullstatement * name * unit wrap (* goto *)
 
 
-  | Asm of statement * asmbody wrap
-  | MacroStmt of statement * unit wrap
+  | Asm of fullstatement * asmbody wrap
+  | MacroStmt of fullstatement * unit wrap
 
   (* ------------------------ *)
   (* some control nodes *)
similarity index 91%
rename from parsing_c/ast_to_flow.ml
rename to parsing_c/control_flow_c_build.ml
index 6bd0826..588efbf 100644 (file)
@@ -20,6 +20,12 @@ open Ograph_extended
 open Oassoc
 open Oassocb
 
+module Lib = Lib_parsing_c
+
+(*****************************************************************************)
+(* Wrappers *)
+(*****************************************************************************)
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_cfg
 
 (*****************************************************************************)
 (* todo?: compute target level with goto (but rare that different I think)
@@ -47,6 +53,7 @@ type error =
   | DeadCode          of Common.parse_info option
   | CaseNoSwitch      of Common.parse_info
   | OnlyBreakInSwitch of Common.parse_info
+  | WeirdSwitch       of Common.parse_info
   | NoEnclosingLoop   of Common.parse_info
   | GotoCantFindLabel of string * Common.parse_info
   | NoExit of Common.parse_info
@@ -173,8 +180,9 @@ let compute_labels_and_create_them st =
   begin
     st +> Visitor_c.vk_statement { Visitor_c.default_visitor_c with 
       Visitor_c.kstatement = (fun (k, bigf) st -> 
-        match st with
-        | Labeled (Ast_c.Label (name, _st)),ii -> 
+        match Ast_c.unwrap_st st with
+        | Labeled (Ast_c.Label (name, _st)) -> 
+            let ii = Ast_c.get_ii_st_take_care st in
             (* at this point I put a lbl_0, but later I will put the
              * good labels. *)
             let s = Ast_c.str_of_name name in
@@ -187,7 +195,7 @@ let compute_labels_and_create_them st =
               (* not k _st !!! otherwise in lbl1: lbl2: i++; we miss lbl2 *)
               k st; 
             end
-        | st -> k st
+        | _st -> k st
       )
     };
     !h;
@@ -282,12 +290,13 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
       compound_caller = Statement;
     } 
   in
-      
+  let ii = Ast_c.get_ii_st_take_care stmt in
+
   (* ------------------------- *)        
-  match stmt with
+  match Ast_c.unwrap_st stmt with
 
   (*  coupling: the Switch case copy paste parts of the Compound case *)
-  | Ast_c.Compound statxs, ii -> 
+  | Ast_c.Compound statxs -> 
       (* flow_to_ast: *)
       let (i1, i2) = tuple_of_list2 ii in
 
@@ -344,7 +353,7 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
 
 
    (* ------------------------- *)        
-  | Labeled (Ast_c.Label (name, st)), ii -> 
+  | Labeled (Ast_c.Label (name, st)) -> 
       let s = Ast_c.str_of_name name in
       let ilabel = xi.labels_assoc#find s in
       let node = mk_node (unwrap (!g#nodes#find ilabel)) lbl [] (s ^ ":") in
@@ -353,8 +362,8 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
       aux_statement (Some ilabel, xi_lbl) st
 
 
-  | Jump (Ast_c.Goto name), ii -> 
-      let s = Ast_c.str_of_name name in
+  | Jump (Ast_c.Goto name) -> 
+     let s = Ast_c.str_of_name name in
      (* special_cfg_ast: *)
      let newi = !g +> add_node (Goto (stmt, name, ((),ii))) lbl ("goto "^s^":")
      in
@@ -378,32 +387,38 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
      !g#add_arc ((newi, ilabel), Direct);
      None
       
-  | Jump (Ast_c.GotoComputed e), ii -> 
+  | Jump (Ast_c.GotoComputed e) -> 
       raise (Error (ComputedGoto))
       
    (* ------------------------- *)        
-  | Ast_c.ExprStatement opte, ii -> 
+  | Ast_c.ExprStatement opte -> 
       (* flow_to_ast:   old: when opte = None, then do not add in CFG. *)
       let s = 
         match opte with
         | None -> "empty;"
         | Some e -> 
-            let ((unwrap_e, typ), ii) = e in
-            (match unwrap_e with
-            | FunCall (((Ident (namef), _typ), _ii), _args) -> 
-                Ast_c.str_of_name namef ^ "(...)"
-            | Assignment (((Ident (namevar), _typ), _ii), SimpleAssign, e) -> 
-                Ast_c.str_of_name namevar ^ " = ... ;"
-            | Assignment 
-                (((RecordAccess (((Ident (namevar), _typ), _ii), field), _typ2),
-                  _ii2),
-                 SimpleAssign, 
-                 e) -> 
-                let sfield = Ast_c.str_of_name field in
-                Ast_c.str_of_name namevar ^ "." ^ sfield ^ " = ... ;"
-                   
+            (match Ast_c.unwrap_expr e with
+            | FunCall (e, _args) -> 
+                (match Ast_c.unwrap_expr e with
+                | Ident namef -> 
+                    Ast_c.str_of_name namef ^ "(...)"
+                | _ -> "statement"
+                )
+            | Assignment (e1, SimpleAssign, e2) -> 
+                (match Ast_c.unwrap_expr e1 with
+                | Ident namevar ->
+                    Ast_c.str_of_name namevar ^ " = ... ;"
+                | RecordAccess(e, field) -> 
+                    (match Ast_c.unwrap_expr e with
+                    | Ident namevar -> 
+                        let sfield = Ast_c.str_of_name field in
+                        Ast_c.str_of_name namevar ^ "." ^ sfield ^ " = ... ;"
+                    | _ -> "statement"
+                    )
+                | _ -> "statement"
+                )
             | _ -> "statement"
-        )
+            )
       in
       let newi = !g +> add_node (ExprStatement (stmt, (opte, ii))) lbl s in
       !g +> add_arc_opt (starti, newi);
@@ -411,7 +426,11 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
       
 
    (* ------------------------- *)        
-  | Selection  (Ast_c.If (e, st1, (Ast_c.ExprStatement (None), []))), ii ->
+  | Selection  (Ast_c.If (e, st1, st2)) ->
+
+    let iist2 = Ast_c.get_ii_st_take_care st2 in
+    (match Ast_c.unwrap_st st2 with
+    | Ast_c.ExprStatement (None) when null iist2 -> 
       (* sometome can have ExprStatement None but it is a if-then-else,
        * because something like   if() xx else ;
        * so must force to have [] in the ii associated with ExprStatement 
@@ -448,8 +467,7 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
       !g +> add_arc_opt (finalthen, lasti);
       Some lasti
 
-      
-  | Selection  (Ast_c.If (e, st1, st2)), ii -> 
+    | _unwrap_st2 -> 
      (* starti -> newi --->   newfakethen -> ... -> finalthen --> lasti
       *                 |                                      |
       *                 |->   newfakeelse -> ... -> finalelse -|
@@ -489,10 +507,10 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
               !g +> add_arc_opt (finalelse, lasti);
               Some lasti
            end)
-        
+    )        
       
    (* ------------------------- *)        
-  | Selection  (Ast_c.Switch (e, st)), ii -> 
+  | Selection  (Ast_c.Switch (e, st)) -> 
       let (i1,i2,i3, iifakeend) = tuple_of_list4 ii in
       let ii = [i1;i2;i3] in
 
@@ -510,9 +528,10 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
         * information build inside the compound case: the nodei of {
         *)
        let finalthen = 
-         match st with
-         | Ast_c.Compound statxs, ii -> 
-             let statxs = Ast_c.stmt_elems_of_sequencable statxs in
+         match Ast_c.unwrap_st st with
+         | Ast_c.Compound statxs -> 
+
+             let statxs = Lib.stmt_elems_of_sequencable statxs in
              
              (* todo? we should not allow to match a stmt that corresponds
               * to a compound of a switch, so really SeqStart (stmt, ...)
@@ -530,9 +549,10 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
                 * between start to end.
                 * todo? except if the case[range] coverthe whole spectrum 
                 *)
-               if not (statxs +> List.exists (function 
-               | (Labeled (Ast_c.Default _), _) -> true
-               | _ -> false
+               if not (statxs +> List.exists (fun x -> 
+                 match Ast_c.unwrap_st x with
+                 | Labeled (Ast_c.Default _) -> true
+                 | _ -> false
                ))
                then begin
                  (* when there is no default, then a valid path is 
@@ -555,7 +575,15 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
              } 
              in
              aux_statement (None (* no starti *), newxi) st
-         | x -> raise Impossible
+         | _x -> 
+             (* apparently gcc allows some switch body such as 
+              *   switch (i) case 0 : printf("here\n");
+              *   cf tests-bis/switch_no_body.c
+              * but I don't think it's worthwile to handle
+              * such pathological and rare case. Not worth
+              * the complexity. Safe to assume a coumpound.
+              *)
+             raise (Error (WeirdSwitch (pinfo_of_ii [i1])))
        in
        !g +> add_arc_opt (finalthen, newendswitch);
 
@@ -596,13 +624,13 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
        res
        
 
-  | Labeled (Ast_c.Case  (_, _)), ii
-  | Labeled (Ast_c.CaseRange  (_, _, _)), ii -> 
+  | Labeled (Ast_c.Case  (_, _))
+  | Labeled (Ast_c.CaseRange  (_, _, _)) -> 
 
       incr counter_for_switch;
       let switchrank = !counter_for_switch in
       let node, st = 
-        match stmt with 
+        match Ast_c.get_st_and_ii stmt with 
         | Labeled (Ast_c.Case  (e, st)), ii -> 
             (Case (stmt, (e, ii))),  st
         | Labeled (Ast_c.CaseRange  (e, e2, st)), ii -> 
@@ -636,7 +664,7 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
       aux_statement (Some newi, xi_lbl) st
       
 
-  | Labeled (Ast_c.Default st), ii -> 
+  | Labeled (Ast_c.Default st) -> 
       incr counter_for_switch;
       let switchrank = !counter_for_switch in
 
@@ -659,7 +687,7 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
 
 
    (* ------------------------- *)        
-  | Iteration  (Ast_c.While (e, st)), ii -> 
+  | Iteration  (Ast_c.While (e, st)) -> 
      (* starti -> newi ---> newfakethen -> ... -> finalthen -
       *             |---|-----------------------------------|
       *                 |-> newfakelse 
@@ -694,13 +722,13 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
    * (whereas While cant return None). But if return None, certainly 
    * some deadcode.
    *)
-  | Iteration  (Ast_c.DoWhile (st, e)), ii -> 
+  | Iteration  (Ast_c.DoWhile (st, e)) -> 
      (* starti -> doi ---> ... ---> finalthen (opt) ---> whiletaili
       *             |--------- newfakethen ---------------|  |---> newfakelse
       *)
       let is_zero = 
         match Ast_c.unwrap_expr e with
-        | Constant (Int "0") -> true
+        | Constant (Int ("0",_)) -> true
         | _ -> false
       in
 
@@ -750,7 +778,7 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
           
 
 
-  | Iteration  (Ast_c.For (e1opt, e2opt, e3opt, st)), ii -> 
+  | Iteration  (Ast_c.For (e1opt, e2opt, e3opt, st)) -> 
       let (i1,i2,i3, iifakeend) = tuple_of_list4 ii in
       let ii = [i1;i2;i3] in
 
@@ -785,7 +813,7 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
    * lexer, now they are returned as Twhile so less pbs. But not perfect.
    * update: now I recognize the list_for_each macro so no more problems.
    *)
-  | Iteration  (Ast_c.MacroIteration (s, es, st)), ii -> 
+  | Iteration  (Ast_c.MacroIteration (s, es, st)) -> 
       let (i1,i2,i3, iifakeend) = tuple_of_list4 ii in
       let ii = [i1;i2;i3] in
 
@@ -814,7 +842,7 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
 
 
    (* ------------------------- *)        
-  | Jump ((Ast_c.Continue|Ast_c.Break) as x),ii ->  
+  | Jump ((Ast_c.Continue|Ast_c.Break) as x) ->  
       let context_info =
        match xi.ctx with
          SwitchInfo (startbrace, loopendi, braces, parent_lbl) -> 
@@ -883,7 +911,7 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
       | NoInfo -> raise Impossible
       )
 
-  | Jump ((Ast_c.Return | Ast_c.ReturnExpr _) as kind), ii -> 
+  | Jump ((Ast_c.Return | Ast_c.ReturnExpr _) as kind) -> 
      (match xi.exiti, xi.errorexiti with
      | None, None -> raise (Error (NoExit (pinfo_of_ii ii)))
      | Some exiti, Some errorexiti -> 
@@ -917,7 +945,7 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
 
 
   (* ------------------------- *)        
-  | Ast_c.Decl decl, ii -> 
+  | Ast_c.Decl decl -> 
      let s = 
        match decl with
        | (Ast_c.DeclList 
@@ -931,19 +959,19 @@ let rec (aux_statement: (nodei option * xinfo) -> statement -> nodei option) =
      Some newi
       
   (* ------------------------- *)        
-  | Ast_c.Asm body, ii -> 
+  | Ast_c.Asm body -> 
       let newi = !g +> add_node (Asm (stmt, ((body,ii)))) lbl "asm;" in
       !g +> add_arc_opt (starti, newi);
       Some newi
 
-  | Ast_c.MacroStmt, ii -> 
+  | Ast_c.MacroStmt -> 
       let newi = !g +> add_node (MacroStmt (stmt, ((),ii))) lbl "macro;" in
       !g +> add_arc_opt (starti, newi);
       Some newi
 
 
   (* ------------------------- *)        
-  | Ast_c.NestedFunc def, ii -> 
+  | Ast_c.NestedFunc def -> 
       raise (Error NestedFunc)
       
 
@@ -1028,7 +1056,7 @@ let (aux_definition: nodei -> definition -> unit) = fun topi funcdef ->
     )
   in
 
-  let topstatement = Ast_c.Compound compound, iicompound in
+  let topstatement = Ast_c.mk_st (Ast_c.Compound compound) iicompound in
 
   let headi = !g +> add_node 
     (FunHeader ({ 
@@ -1072,13 +1100,15 @@ let (aux_definition: nodei -> definition -> unit) = fun topi funcdef ->
  * the toplevel macro statement as in @@ toplevel_declarator MACRO_PARAM;@@
  * and so I would not need this hack and instead I would to a cleaner
  * match in cocci_vs_c_3.ml of a A.MacroTop vs B.MacroTop
+ * 
+ * todo: update: now I do what I just described, so can remove this code ?
  *)
 let specialdeclmacro_to_stmt (s, args, ii) =
   let (iis, iiopar, iicpar, iiptvirg) = tuple_of_list4 ii in
   let ident = Ast_c.RegularName (s, [iis]) in
-  let identfinal = (Ast_c.Ident (ident), Ast_c.noType()), [] in
-  let f = (Ast_c.FunCall (identfinal, args), Ast_c.noType()), [iiopar;iicpar] in
-  let stmt = Ast_c.ExprStatement (Some f), [iiptvirg] in
+  let identfinal = Ast_c.mk_e (Ast_c.Ident (ident)) Ast_c.noii in
+  let f = Ast_c.mk_e (Ast_c.FunCall (identfinal, args)) [iiopar;iicpar] in
+  let stmt = Ast_c.mk_st (Ast_c.ExprStatement (Some f)) [iiptvirg] in
   stmt,  (f, [iiptvirg])
 
 
@@ -1187,6 +1217,18 @@ let ast_to_control_flow e =
           raise (Error(Define(pinfo_of_ii ii)))
       | Ast_c.DefineTodo -> 
           raise (Error(Define(pinfo_of_ii ii)))
+
+(* old:
+      | Ast_c.DefineText (s, ii) -> 
+          let endi = !g +> add_node EndNode lbl_0 "[end]" in
+          !g#add_arc ((headeri, endi),Direct);
+      | Ast_c.DefineInit _ -> 
+          let endi = !g +> add_node EndNode lbl_0 "[end]" in
+          !g#add_arc ((headeri, endi),Direct);
+      | Ast_c.DefineTodo -> 
+          let endi = !g +> add_node EndNode lbl_0 "[end]" in
+          !g#add_arc ((headeri, endi),Direct);
+*)
       );
 
       Some !g
@@ -1256,7 +1298,9 @@ let deadcode_detection g =
       | SeqEnd _ -> () (* todo?: certaines '}' deviennent orphelins *)
       | x -> 
           (match Control_flow_c.extract_fullstatement node with
-          | Some (st, ii) -> raise (Error (DeadCode (Some (pinfo_of_ii ii))))
+          | Some st -> 
+              let ii = Ast_c.get_ii_st_take_care st in
+              raise (Error (DeadCode (Some (pinfo_of_ii ii))))
           | _ -> pr2 "CFG: orphelin nodes, maybe something weird happened"
           )
       )
@@ -1358,6 +1402,8 @@ let report_error error =
       pr2 ("FLOW: case without corresponding switch: " ^ error_from_info info)
   | OnlyBreakInSwitch info -> 
       pr2 ("FLOW: only break are allowed in switch: " ^ error_from_info info)
+  | WeirdSwitch info -> 
+      pr2 ("FLOW: weird switch: " ^ error_from_info info)
   | NoEnclosingLoop   (info) -> 
       pr2 ("FLOW: can't find enclosing loop: " ^ error_from_info info)
   | GotoCantFindLabel (s, info) ->
@@ -1365,7 +1411,7 @@ let report_error error =
   | NoExit info -> 
       pr2 ("FLOW: can't find exit or error exit: " ^ error_from_info info)
   | DuplicatedLabel s -> 
-      pr2 ("FLOW: duplicate label" ^ s)
+      pr2 ("FLOW: duplicate label " ^ s)
   | NestedFunc  -> 
       pr2 ("FLOW: not handling yet nested function")
   | ComputedGoto -> 
similarity index 94%
rename from parsing_c/ast_to_flow.mli
rename to parsing_c/control_flow_c_build.mli
index 52b2ffa..2b84821 100644 (file)
@@ -10,6 +10,7 @@ type error =
   | DeadCode          of Common.parse_info option
   | CaseNoSwitch      of Common.parse_info
   | OnlyBreakInSwitch of Common.parse_info
+  | WeirdSwitch       of Common.parse_info
   | NoEnclosingLoop   of Common.parse_info
   | GotoCantFindLabel of string * Common.parse_info
   | NoExit of Common.parse_info
index af246f2..ae2ce2c 100644 (file)
@@ -15,6 +15,13 @@ open Common
 
 open Ast_c
 
+(*****************************************************************************)
+(* Wrappers *)
+(*****************************************************************************)
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_cpp_ast
+let pr2_debug,pr2_debug_once = 
+  Common.mk_pr2_wrappers Flag_parsing_c.debug_cpp_ast
+
 (*****************************************************************************)
 (* Cpp Ast Manipulations *)
 (*****************************************************************************)
@@ -103,7 +110,7 @@ let init_adjust_candidate_header_files dir =
 
   files +> List.iter (fun file -> 
     let base = Filename.basename file in
-    pr2 file;
+    pr2_debug file;
     Hashtbl.add _hcandidates base file;
   );
   ()
@@ -144,7 +151,7 @@ let find_header_file2 inc_file =
       let res = Hashtbl.find_all _hcandidates base in
       (match res with
       | [file] -> 
-          pr2 ("CPPAST: find header in other dir: " ^ file);
+          pr2_debug ("CPPAST: find header in other dir: " ^ file);
           res
       | [] -> 
           []
@@ -166,7 +173,7 @@ let find_header_file cppopts dirname inc_file =
 
 (* ---------------------------------------------------------------------- *)
 let trace_cpp_process depth mark inc_file =
-  pr2 (spf "%s>%s %s" 
+  pr2_debug (spf "%s>%s %s" 
           (Common.repeat "-" depth +> Common.join "")
           mark
           (s_of_inc_file_bis inc_file));
@@ -221,7 +228,9 @@ let (cpp_expand_include2:
  cpp_option list -> Common.dirname -> Ast_c.program -> Ast_c.program) =
  fun ?(depth_limit=None) iops dirname ast -> 
 
-  pr2_xxxxxxxxxxxxxxxxx();
+  if !Flag_parsing_c.debug_cpp_ast
+  then pr2_xxxxxxxxxxxxxxxxx();
+
   let already_included = ref [] in
 
   let rec aux stack dirname ast = 
diff --git a/parsing_c/cpp_token_c.ml b/parsing_c/cpp_token_c.ml
new file mode 100644 (file)
index 0000000..5ad5de6
--- /dev/null
@@ -0,0 +1,639 @@
+(* Yoann Padioleau
+ * 
+ * Copyright (C) 2007, 2008 Ecole des Mines de Nantes
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License (GPL)
+ * version 2 as published by the Free Software Foundation.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * file license.txt for more details.
+ *)
+
+open Common
+
+module TH = Token_helpers
+
+open Parser_c
+open Token_views_c
+
+(*****************************************************************************)
+(* Prelude *)
+(*****************************************************************************)
+
+(* cpp functions working at the token level. Cf cpp_ast_c for cpp functions
+ * working at the AST level (which is very unusual but makes sense in 
+ * the coccinelle context for instance).
+ *  
+ * Note that as I use a single lexer  to work both at the C and cpp level
+ * there are some inconveniencies. 
+ * For instance 'for' is a valid name for a macro parameter and macro 
+ * body, but is interpreted in a special way by our single lexer, and 
+ * so at some places where I expect a TIdent I need also to
+ * handle special cases and accept Tfor, Tif, etc at those places.
+ * 
+ * There are multiple issues related to those keywords incorrect tokens.
+ * Those keywords can be:
+ *   - (1) in the name of the macro as  in  #define inline
+ *   - (2) in a parameter of the macro as in #define foo(char)   char x;
+ *   - (3) in an argument to a macro call as in   IDENT(if);
+ * Case 1 is easy to fix in define_ident.
+ * Case 2 is easy to fix in define_parse where detect such toks in 
+ * the parameter and then replace their occurence in the body in a Tident.
+ * Case 3 is only an issue when the expanded token is not really use 
+ * as usual but use for instance in concatenation as in  a ## if
+ * when expanded. In the case the grammar this time will not be happy
+ * so this is also easy to fix in cpp_engine.
+ * 
+ *)
+
+(*****************************************************************************)
+(* Wrappers *)
+(*****************************************************************************)
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_parsing 
+
+(*****************************************************************************)
+(* Types *)
+(*****************************************************************************)
+
+
+(* ------------------------------------------------------------------------- *)
+(* mimic standard.h *)
+(* ------------------------------------------------------------------------- *)
+
+type define_def = string * define_param * define_body 
+ and define_param = 
+   | NoParam
+   | Params of string list
+ and define_body = 
+   | DefineBody of Parser_c.token list
+   | DefineHint of parsinghack_hint
+
+   and parsinghack_hint = 
+     | HintIterator
+     | HintDeclarator
+     | HintMacroString
+     | HintMacroStatement
+     | HintAttribute
+     | HintMacroIdentBuilder
+
+
+
+(* cf also data/test.h *)
+let assoc_hint_string = [
+  "YACFE_ITERATOR"   , HintIterator;
+  "YACFE_DECLARATOR" , HintDeclarator;
+  "YACFE_STRING"     , HintMacroString;
+  "YACFE_STATEMENT"  , HintMacroStatement;
+  "YACFE_ATTRIBUTE"  , HintAttribute;
+  "YACFE_IDENT_BUILDER"  , HintMacroIdentBuilder;
+
+  "MACROSTATEMENT"   , HintMacroStatement; (* backward compatibility *)
+]
+
+
+let (parsinghack_hint_of_string: string -> parsinghack_hint option) = fun s -> 
+  Common.assoc_option s assoc_hint_string
+
+let (is_parsinghack_hint: string -> bool) = fun s -> 
+  parsinghack_hint_of_string s <> None
+
+let (token_from_parsinghack_hint: 
+     (string * Ast_c.info) -> parsinghack_hint -> Parser_c.token) = 
+ fun (s,ii) hint ->
+   match hint with
+   | HintIterator -> 
+       Parser_c.TMacroIterator (s, ii)
+   | HintDeclarator -> 
+       Parser_c.TMacroDecl (s, ii)
+   | HintMacroString -> 
+       Parser_c.TMacroString (s, ii)
+   | HintMacroStatement -> 
+       Parser_c.TMacroStmt (s, ii)
+   | HintAttribute -> 
+       Parser_c.TMacroAttr (s, ii)
+   | HintMacroIdentBuilder -> 
+       Parser_c.TMacroIdentBuilder (s, ii)
+  
+
+
+
+
+
+(*****************************************************************************)
+(* Expansion helpers *)
+(*****************************************************************************)
+
+(* In some cases we can have macros like IDENT(if) that expands to some 
+ * 'int xxx_if(void)', but as the lexer will currently generate a Tif for 
+ * the expanded code, that may not be accepted as a token after a ##
+ * in the grammar. Hence this function to remap some tokens. This is because
+ * we should not use a single lexer for both working at the C level and
+ * cpp level.
+ * 
+ * update: it can also rename some TypedefIdent into TIdent, possibly 
+ * because of bad interaction with add_typedef_root in parsing_hacks.
+ *)
+let rec remap_keyword_tokens xs = 
+  match xs with
+  | [] -> []
+  | [x] -> [x]
+  | x::y::xs -> 
+      (match x, y with
+      | Parser_c.TCppConcatOp _, Parser_c.TIdent _ -> 
+          x::y::remap_keyword_tokens xs
+      | Parser_c.TIdent _, Parser_c.TCppConcatOp _ -> 
+          x::y::remap_keyword_tokens xs
+
+      | Parser_c.TCppConcatOp (i1),   y -> 
+
+          let s = TH.str_of_tok y in
+          let ii = TH.info_of_tok y in
+          if s ==~ Common.regexp_alpha
+          then begin
+            pr2 (spf "remaping: %s to an ident in expanded code" s);
+            x::(Parser_c.TIdent (s, ii))::remap_keyword_tokens xs
+          end
+          else 
+            x::y::remap_keyword_tokens xs
+
+      | x, Parser_c.TCppConcatOp (i1) -> 
+          let s = TH.str_of_tok x in
+          let ii = TH.info_of_tok x in
+          if s ==~ Common.regexp_alpha
+          then begin
+            pr2 (spf "remaping: %s to an ident in expanded code" s);
+            (Parser_c.TIdent (s, ii))::remap_keyword_tokens (y::xs)
+          end
+          else 
+            x::y::remap_keyword_tokens xs
+
+      | _, _ -> 
+          x::remap_keyword_tokens (y::xs)
+      )
+              
+          
+
+(* To expand the parameter of the macro. The env corresponds to the actual
+ * code that is binded to the parameters of the macro.
+ * Recurse ? fixpoint ? the expansion may also contain macro.
+ * Or to macro expansion in a strict manner, that is process first
+ * the parameters, expands macro in params, and then process enclosing
+ * macro call.
+ * 
+ * note: do the concatenation job of a##b here ?
+ * normally this should be done in the grammar. Here just expand
+ * tokens. The only thing we handle here is we may have to remap
+ * some tokens.
+ * 
+ * todo: handle stringification here ? if #n
+ * 
+ * todo? but could parsing_hacks then pass over the remapped tokens, 
+ * for instance transform some of the back into some TypedefIdent
+ * so cpp_engine may be fooled?
+ *)
+let rec (cpp_engine: (string , Parser_c.token list) assoc -> 
+          Parser_c.token list -> Parser_c.token list) = 
+ fun env xs ->
+  xs +> List.map (fun tok -> 
+    (* expand only TIdent ? no cos the parameter of the macro
+     * can actually be some 'register' so may have to look for 
+     * any tokens candidates for the expansion.
+     * Only subtelity is maybe dont expand the TDefineIdent.
+     * update: in fact now the caller (define_parse) will have done 
+     * the job right and already replaced the macro parameter with a TIdent.
+     *)
+    match tok with
+    | TIdent (s,i1) when List.mem_assoc s env -> Common.assoc s env
+    | x -> [x]
+  )
+  +> List.flatten
+  +> remap_keyword_tokens
+
+
+
+(* ------------------------------------------------------------------------- *)
+(* apply macro, using standard.h or other defs *)
+(* ------------------------------------------------------------------------- *)
+
+(* Thanks to this function many stuff are not anymore hardcoded in ocaml code.
+ * At some point there were hardcoded in a standard.h file but now I 
+ * can even generate them on the fly on demand when there is actually
+ * a parsing problem.
+ * 
+ * No need to take care to not substitute the macro name itself
+ * that occurs in the macro definition because the macro name is
+ * after fix_token_define a TDefineIdent, no more a TIdent.
+ *)
+
+let rec apply_macro_defs 
+ ~msg_apply_known_macro 
+ ~msg_apply_known_macro_hint 
+ defs xs = 
+ let rec apply_macro_defs xs = 
+  match xs with
+  | [] -> ()
+
+  (* old: "but could do more, could reuse same original token
+   * so that have in the Ast a Dbg, not a MACROSTATEMENT"
+   * 
+   *   | PToken ({tok = TIdent (s,i1)} as id)::xs 
+   *     when s = "MACROSTATEMENT" -> 
+   * 
+   *     msg_macro_statement_hint s;
+   *     id.tok <- TMacroStmt(TH.info_of_tok id.tok);
+   *     find_macro_paren xs
+   * 
+   *  let msg_macro_statement_hint s = 
+   *    incr Stat.nMacroHint;
+   *   ()
+   * 
+   *)
+
+  (* recognized macro of standard.h (or other) *)
+  | PToken ({tok = TIdent (s,i1)} as id)::Parenthised (xxs,info_parens)::xs 
+      when Hashtbl.mem defs s -> 
+      
+      msg_apply_known_macro s;
+      let (s, params, body) = Hashtbl.find defs s in
+
+      (match params with
+      | NoParam -> 
+          pr2 ("WEIRD: macro without param used before parenthize: " ^ s);
+          (* ex: PRINTP("NCR53C400 card%s detected\n" ANDP(((struct ... *)
+
+          (match body with
+          | DefineBody bodymacro -> 
+              set_as_comment (Token_c.CppMacro) id;
+              id.new_tokens_before <- bodymacro;
+          | DefineHint hint -> 
+              msg_apply_known_macro_hint s;
+              id.tok <- token_from_parsinghack_hint (s,i1) hint;
+          )
+      | Params params -> 
+          (match body with
+          | DefineBody bodymacro -> 
+
+              (* bugfix: better to put this that before the match body, 
+               * cos our macrostatement hint can have variable number of
+               * arguments and so it's ok if it does not match exactly
+               * the number of arguments. *)
+              if List.length params != List.length xxs
+              then begin 
+                pr2_once ("WEIRD: macro with wrong number of arguments: " ^ s);
+                (* old: id.new_tokens_before <- bodymacro; *)
+
+                (* update: if wrong number, then I just pass this macro *)
+                [Parenthised (xxs, info_parens)] +> 
+                  iter_token_paren (set_as_comment Token_c.CppMacro);
+                set_as_comment Token_c.CppMacro id;
+
+                ()
+              end
+              else 
+
+                let xxs' = xxs +> List.map (fun x -> 
+                  (tokens_of_paren_ordered x) +> List.map (fun x -> 
+                    TH.visitor_info_of_tok Ast_c.make_expanded x.tok
+                  )
+                ) in
+                id.new_tokens_before <-
+                  (* !!! cpp expansion job here  !!! *)
+                  cpp_engine (Common.zip params xxs') bodymacro;
+
+                (* important to do that after have apply the macro, otherwise
+                 * will pass as argument to the macro some tokens that
+                 * are all TCommentCpp
+                 *)
+                [Parenthised (xxs, info_parens)] +> 
+                  iter_token_paren (set_as_comment Token_c.CppMacro);
+                set_as_comment Token_c.CppMacro id;
+
+            | DefineHint (HintMacroStatement as hint) -> 
+                (* important to do that after have apply the macro, otherwise
+                 * will pass as argument to the macro some tokens that
+                 * are all TCommentCpp
+                 * 
+                 * note: such macrostatement can have a variable number of
+                 * arguments but here we don't care, we just pass all the
+                 * parameters.
+                 *)
+
+                (match xs with
+                | PToken ({tok = TPtVirg _} as id2)::_ -> 
+                    pr2_once 
+                      ("macro stmt with trailing ';', passing also ';' for: "^
+                       s);
+                    (* sometimes still want pass its params ... as in
+                     *  DEBUGPOLL(static unsigned int prev_mask = 0);
+                     *)
+
+                    msg_apply_known_macro_hint s;
+                    id.tok <- token_from_parsinghack_hint (s,i1) hint;
+                    [Parenthised (xxs, info_parens)] +> 
+                      iter_token_paren (set_as_comment Token_c.CppMacro);
+                    set_as_comment Token_c.CppMacro id2;
+
+                | _ ->
+                    msg_apply_known_macro_hint s;
+                    id.tok <- token_from_parsinghack_hint (s,i1) hint;
+                    [Parenthised (xxs, info_parens)] +> 
+                      iter_token_paren (set_as_comment Token_c.CppMacro);
+                )
+                
+
+            | DefineHint hint -> 
+                msg_apply_known_macro_hint s;
+                id.tok <- token_from_parsinghack_hint (s,i1) hint;
+            )
+      );
+      apply_macro_defs xs
+
+  | PToken ({tok = TIdent (s,i1)} as id)::xs 
+      when Hashtbl.mem defs s -> 
+
+      msg_apply_known_macro s;
+      let (_s, params, body) = Hashtbl.find defs s in
+
+      (match params with
+      | Params params -> 
+          pr2 ("WEIRD: macro with params but no parens found: " ^ s);
+          (* dont apply the macro, perhaps a redefinition *)
+          ()
+      | NoParam -> 
+          (match body with
+          | DefineBody [newtok] -> 
+             (* special case when 1-1 substitution, we reuse the token *)
+              id.tok <- (newtok +> TH.visitor_info_of_tok (fun _ -> 
+                TH.info_of_tok id.tok))
+          | DefineBody bodymacro -> 
+              set_as_comment Token_c.CppMacro id;
+              id.new_tokens_before <- bodymacro;
+          | DefineHint hint -> 
+                msg_apply_known_macro_hint s;
+                id.tok <- token_from_parsinghack_hint (s,i1) hint;
+          )
+      );
+      apply_macro_defs xs
+
+
+
+
+  (* recurse *)
+  | (PToken x)::xs -> apply_macro_defs xs 
+  | (Parenthised (xxs, info_parens))::xs -> 
+      xxs +> List.iter apply_macro_defs;
+      apply_macro_defs xs
+ in
+ apply_macro_defs xs
+
+
+
+
+(*****************************************************************************)
+(* The parsing hack for #define *)
+(*****************************************************************************)
+
+(* To parse macro definitions I need to do some tricks 
+ * as some information can be get only at the lexing level. For instance
+ * the space after the name of the macro in '#define foo (x)' is meaningful
+ * but the grammar can not get this information. So define_ident below
+ * look at such space and generate a special TOpardefine. In a similar
+ * way macro definitions can contain some antislash and newlines
+ * and the grammar need to know where the macro ends (which is 
+ * a line-level and so low token-level information). Hence the 
+ * function 'define_line' below and the TDefEol.
+ * 
+ * update: TDefEol is handled in a special way at different places, 
+ * a little bit like EOF, especially for error recovery, so this
+ * is an important token that should not be retagged!
+ * 
+ * 
+ * ugly hack, a better solution perhaps would be to erase TDefEOL 
+ * from the Ast and list of tokens in parse_c. 
+ * 
+ * note: I do a +1 somewhere, it's for the unparsing to correctly sync.
+ * 
+ * note: can't replace mark_end_define by simply a fakeInfo(). The reason
+ * is where is the \n TCommentSpace. Normally there is always a last token
+ * to synchronize on, either EOF or the token of the next toplevel.
+ * In the case of the #define we got in list of token 
+ * [TCommentSpace "\n"; TDefEOL] but if TDefEOL is a fakeinfo then we will
+ * not synchronize on it and so we will not print the "\n".
+ * A solution would be to put the TDefEOL before the "\n".
+ * 
+ * todo?: could put a ExpandedTok for that ? 
+ *)
+let mark_end_define ii = 
+  let ii' = 
+    { Ast_c.pinfo = Ast_c.OriginTok { (Ast_c.parse_info_of_info ii) with 
+        Common.str = ""; 
+        Common.charpos = Ast_c.pos_of_info ii + 1
+      };
+      cocci_tag = ref Ast_c.emptyAnnot;
+      comments_tag = ref Ast_c.emptyComments;
+    } 
+  in
+  TDefEOL (ii')
+
+(* put the TDefEOL at the good place *)
+let rec define_line_1 acc xs = 
+  match xs with
+  | [] -> List.rev acc
+  | TDefine ii::xs ->
+      let line = Ast_c.line_of_info ii in
+      let acc = (TDefine ii) :: acc in
+      define_line_2 acc line ii xs
+  | TCppEscapedNewline ii::xs ->
+      pr2 "WEIRD: a \\ outside a #define";
+      let acc = (TCommentSpace ii) :: acc in
+      define_line_1 acc xs
+  | x::xs -> define_line_1 (x::acc) xs
+
+and define_line_2 acc line lastinfo xs = 
+  match xs with 
+  | [] -> 
+      (* should not happened, should meet EOF before *)
+      pr2 "PB: WEIRD";   
+      List.rev (mark_end_define lastinfo::acc)
+  | x::xs -> 
+      let line' = TH.line_of_tok x in
+      let info = TH.info_of_tok x in
+
+      (match x with
+      | EOF ii -> 
+         let acc = (mark_end_define lastinfo) :: acc in
+         let acc = (EOF ii) :: acc in
+          define_line_1 acc xs
+      | TCppEscapedNewline ii -> 
+          if (line' <> line) then pr2 "PB: WEIRD: not same line number";
+         let acc = (TCommentSpace ii) :: acc in
+          define_line_2 acc (line+1) info xs
+      | x -> 
+          if line' =|= line
+          then define_line_2 (x::acc) line info xs 
+          else define_line_1 (mark_end_define lastinfo::acc) (x::xs)
+      )
+
+let rec define_ident acc xs = 
+  match xs with
+  | [] -> List.rev acc
+  | TDefine ii::xs -> 
+      let acc = TDefine ii :: acc in
+      (match xs with
+      | TCommentSpace i1::TIdent (s,i2)::TOPar (i3)::xs -> 
+          (* Change also the kind of TIdent to avoid bad interaction
+           * with other parsing_hack tricks. For instant if keep TIdent then
+           * the stringication algo can believe the TIdent is a string-macro.
+           * So simpler to change the kind of the ident too.
+           *)
+          (* if TOParDefine sticked to the ident, then 
+           * it's a macro-function. Change token to avoid ambiguity
+           * between #define foo(x)  and   #define foo   (x)
+           *)
+         let acc = (TCommentSpace i1) :: acc in
+         let acc = (TIdentDefine (s,i2)) :: acc in
+         let acc = (TOParDefine i3) :: acc in
+          define_ident acc xs
+
+      | TCommentSpace i1::TIdent (s,i2)::xs -> 
+         let acc = (TCommentSpace i1) :: acc in
+         let acc = (TIdentDefine (s,i2)) :: acc in
+          define_ident acc xs
+
+      (* bugfix: ident of macro (as well as params, cf below) can be tricky
+       * note, do we need to subst in the body of the define ? no cos
+       * here the issue is the name of the macro, as in #define inline,
+       * so obviously the name of this macro will not be used in its 
+       * body (it would be a recursive macro, which is forbidden).
+       *)
+       
+      | TCommentSpace i1::t::xs -> 
+
+          let s = TH.str_of_tok t in
+          let ii = TH.info_of_tok t in
+          if s ==~ Common.regexp_alpha
+          then begin
+            pr2 (spf "remaping: %s to an ident in macro name" s);
+           let acc = (TCommentSpace i1) :: acc in
+           let acc = (TIdentDefine (s,ii)) :: acc in
+            define_ident acc xs
+          end
+          else begin
+            pr2 "WEIRD: weird #define body"; 
+            define_ident acc xs
+          end
+
+      | _ -> 
+          pr2 "WEIRD: weird #define body"; 
+          define_ident acc xs
+      )
+  | x::xs ->
+      let acc = x :: acc in
+      define_ident acc xs
+  
+
+
+let fix_tokens_define2 xs = 
+  define_ident [] (define_line_1 [] xs)
+
+let fix_tokens_define a = 
+  Common.profile_code "C parsing.fix_define" (fun () -> fix_tokens_define2 a)
+      
+
+
+(*****************************************************************************)
+(* for the cpp-builtin, standard.h, part 0 *)
+(*****************************************************************************)
+
+let macro_body_to_maybe_hint body = 
+  match body with
+  | [] -> DefineBody body
+  | [TIdent (s,i1)] -> 
+      (match parsinghack_hint_of_string s with
+      | Some hint -> DefineHint hint
+      | None -> DefineBody body
+      )
+  | xs -> DefineBody body
+
+
+let rec define_parse xs = 
+  match xs with
+  | [] -> []
+  | TDefine i1::TIdentDefine (s,i2)::TOParDefine i3::xs -> 
+      (* note: the macro could be badly written and have no closing ')' for
+       * its param, which would make us go too far away, but I don't think
+       * it's important to handle such an error *)
+      let (tokparams, _, xs) = 
+        xs +> Common.split_when (function TCPar _ -> true | _ -> false) in
+      let (body, _, xs) = 
+        xs +> Common.split_when (function TDefEOL _ -> true | _ -> false) in
+      let params = 
+        tokparams +> Common.map_filter (function
+        | TComma _ -> None
+        | TIdent (s, _) -> Some s
+
+        (* TODO *)
+        | TDefParamVariadic (s, _) -> Some s 
+        (* TODO *)
+        | TEllipsis _ -> Some "..." 
+
+        | x -> 
+            (* bugfix: param of macros can be tricky *)
+            let s = TH.str_of_tok x in
+            if s ==~ Common.regexp_alpha
+            then begin
+              pr2 (spf "remaping: %s to a macro parameter" s);
+              Some s
+            end
+            else 
+              error_cant_have x
+        ) in
+      (* bugfix: also substitute to ident in body so cpp_engine will 
+       * have an easy job.
+       *)
+      let body = body +> List.map (fun tok -> 
+        match tok with
+        | TIdent _ -> tok
+        | _ -> 
+            let s = TH.str_of_tok tok in
+            let ii = TH.info_of_tok tok in 
+            if s ==~ Common.regexp_alpha && List.mem s params
+            then begin
+              pr2 (spf "remaping: %s to an ident in macro body" s);
+              TIdent (s, ii)
+            end
+            else tok
+      ) +> List.map (TH.visitor_info_of_tok Ast_c.make_expanded) in
+      let def = (s, (s, Params params, macro_body_to_maybe_hint body)) in
+      def::define_parse xs
+
+  | TDefine i1::TIdentDefine (s,i2)::xs -> 
+      let (body, _, xs) = 
+        xs +> Common.split_when (function TDefEOL _ -> true | _ -> false) in
+      let body = body +> List.map 
+        (TH.visitor_info_of_tok Ast_c.make_expanded) in
+      let def = (s, (s, NoParam, macro_body_to_maybe_hint body)) in
+      def::define_parse xs
+
+  (* cf tests-bis/define_plus.c *)
+  | TDefine i1::xs -> 
+      let line = Ast_c.line_of_info i1 in
+      pr2 (spf "WEIRD: no ident in define at line %d" line);
+      define_parse xs
+        
+  | x::xs -> define_parse xs 
+      
+
+
+let extract_cpp_define xs = 
+  let cleaner = xs +> List.filter (fun x -> 
+    not (TH.is_comment x)
+  ) in
+  define_parse cleaner
+  
+
+
+
diff --git a/parsing_c/cpp_token_c.mli b/parsing_c/cpp_token_c.mli
new file mode 100644 (file)
index 0000000..6d5cb99
--- /dev/null
@@ -0,0 +1,46 @@
+(*
+ * Do stuff involving cpp macros, like expanding some macros, 
+ * or try to parse well the body of the define by finding the end of
+ * define virtual end-of-line token.
+ *)
+
+(* corresponds to what is in the yacfe configuration file (e.g. standard.h) *)
+type define_def = string * define_param * define_body 
+ and define_param = 
+   | NoParam
+   | Params of string list
+ and define_body = 
+   | DefineBody of Parser_c.token list
+   | DefineHint of parsinghack_hint
+
+   (* strongly corresponds to the TMacroXxx in the grammar and lexer and the
+    * MacroXxx in the ast.
+    *)
+   and parsinghack_hint = 
+     | HintIterator
+     | HintDeclarator
+     | HintMacroString
+     | HintMacroStatement
+     | HintAttribute
+     | HintMacroIdentBuilder
+
+(* This function work by side effect and may generate new tokens
+ * in the new_tokens_before field of the token_extended in the
+ * paren_grouped list. So don't forget to recall 
+ * Token_views_c.rebuild_tokens_extented after this call, as well
+ * as probably parsing_hacks.insert_virtual_positions as new tokens
+ * are generated.
+ *)
+val apply_macro_defs: 
+  msg_apply_known_macro:(string -> unit) ->
+  msg_apply_known_macro_hint:(string -> unit) ->
+  (string, define_def) Hashtbl.t ->
+  Token_views_c.paren_grouped list -> unit
+
+(* generate virtual end-of-line token *)
+val fix_tokens_define : 
+  Parser_c.token list -> Parser_c.token list
+
+val extract_cpp_define : 
+  Parser_c.token list -> (string, define_def) Common.assoc
+
index 2ee65f7..cfdeceb 100644 (file)
@@ -1,17 +1,28 @@
 (*****************************************************************************)
-(* convenient globals to pass to parse_c.init_defs *)
+(* convenient globals. *)
 (*****************************************************************************)
 let path = ref 
   (try (Sys.getenv "YACFE_HOME")
     with Not_found-> "/home/pad/c-yacfe"
   )
-let std_h   = ref (Filename.concat !path "data/standard.h")
-let common_h   = ref (Filename.concat !path "data/common_macros.h")
+
+(*****************************************************************************)
+(* macros *)
+(*****************************************************************************)
+
+let macro_dir = "config/macros/" 
+let mk_macro_path ~cocci_path file = 
+  Filename.concat cocci_path (macro_dir ^ file) 
+
+
+(* to pass to parse_c.init_defs *)
+let std_h   = ref (mk_macro_path ~cocci_path:!path "standard.h")
+let common_h   = ref (mk_macro_path ~cocci_path:!path "common_macros.h")
 
 
 let cmdline_flags_macrofile () = 
   [
-    "-macro_file", Arg.Set_string std_h,
+    "-macro_file_builtins", Arg.Set_string std_h,
     " <file> (default=" ^ !std_h ^ ")";
   ]
 
@@ -40,6 +51,11 @@ let cmdline_flags_envfile () =
     " <file> (default=" ^ !std_envir ^ ")";
   ]
 
+(*****************************************************************************)
+(* show *)
+(*****************************************************************************)
+
+let show_parsing_error = ref true
 
 (*****************************************************************************)
 (* verbose *)
@@ -48,7 +64,11 @@ let cmdline_flags_envfile () =
 let verbose_lexing = ref true
 let verbose_parsing = ref true
 let verbose_type    = ref true
+let verbose_cfg    = ref true
 let verbose_annotater = ref true
+let verbose_unparsing = ref true
+let verbose_visit = ref true
+let verbose_cpp_ast = ref true
 
 let filter_msg = ref false
 let filter_msg_define_error = ref false
@@ -59,6 +79,7 @@ let filter_passed_level = ref 0
 
 let pretty_print_type_info = ref false
 let pretty_print_comment_info = ref false
+let pretty_print_typedef_value = ref false
 
 (* cocci specific *)
 let show_flow_labels = ref true
@@ -94,6 +115,8 @@ let debug_etdt    = ref false
 let debug_typedef = ref false
 let debug_cpp     = ref false
 
+let debug_cpp_ast  = ref false
+
 let debug_unparsing = ref false
 
 let debug_cfg = ref false
@@ -140,7 +163,7 @@ let cmdline_flags_algos () =
 let cpp_directive_passing = ref false
 let ifdef_directive_passing = ref false 
 
-let disable_two_pass = ref false
+let disable_multi_pass = ref false
 let disable_add_typedef = ref false
 
 let if0_passing = ref true
@@ -158,7 +181,7 @@ let cmdline_flags_parsing_algos () = [
     "-noadd_typedef_root",   Arg.Clear add_typedef_root, " ";
     "-noadd_typedef",   Arg.Set disable_add_typedef, " ";
 
-    "-disable_two_pass", Arg.Set disable_two_pass, " ";
+    "-disable_multi_pass", Arg.Set disable_multi_pass, " ";
 ]
 
 (*****************************************************************************)
@@ -181,3 +204,49 @@ let cmdline_flags_other () =
   ]
 
 (*****************************************************************************)
+(* for lexing of integer constants *)
+(*****************************************************************************)
+
+let int_thresholds =
+  ref (None :
+        (int (*int_sz*) * int (*long_sz*) *
+           Big_int.big_int (*uint threshold*) *
+           Big_int.big_int (*long threshold*) *
+           Big_int.big_int (*ulong threshold*)) option)
+
+let set_int_bits n =
+  match !int_thresholds with
+    None ->
+      (*assume long is 2*int; this can be corrected by a subsequent long_bits*)
+      let uint_threshold  = Big_int.power_int_positive_int 2 (n-1) in
+      let long_threshold  = Big_int.power_int_positive_int 2 n in
+      let ulong_threshold = Big_int.power_int_positive_int 2 ((2*n)-1) in
+      int_thresholds :=
+       Some (n,2*n,uint_threshold,long_threshold,ulong_threshold)
+  | Some(int_sz,long_sz,uint_threshold,long_threshold,ulong_threshold) ->
+      let uint_threshold = Big_int.power_int_positive_int 2 (n-1) in
+      let long_threshold = Big_int.power_int_positive_int 2 n in
+      int_thresholds :=
+       Some (n,long_sz,uint_threshold,long_threshold,ulong_threshold)
+
+let set_long_bits n =
+  match !int_thresholds with
+    None ->
+      (*assume int is 1/2*int; this can be corrected by a subsequent int_bits*)
+      set_int_bits (n/2)
+  | Some(int_sz,long_sz,uint_threshold,long_threshold,ulong_threshold) ->
+      let ulong_threshold = Big_int.power_int_positive_int 2 (n-1) in
+      int_thresholds :=
+       Some (int_sz,n,uint_threshold,long_threshold,ulong_threshold)
+
+(*****************************************************************************)
+(* unparsing strategy *)
+(*****************************************************************************)
+
+type spacing = LINUX | SMPL
+let spacing = ref LINUX
+
+let set_linux_spacing _ = spacing := LINUX (*follow the conventions of Linux*)
+let set_smpl_spacing _ = spacing := SMPL   (*use spacing from the SP*)
+
+(*****************************************************************************)
index 6a18e2e..9dacf58 100644 (file)
@@ -45,9 +45,7 @@ open Ast_c (* to factorise tokens, OpAssign, ... *)
 (*****************************************************************************)
 (* Wrappers *)
 (*****************************************************************************)
-let pr2 s = 
-  if !Flag_parsing_c.verbose_lexing 
-  then Common.pr2 s
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_lexing 
 
 (*****************************************************************************)
 
@@ -160,6 +158,59 @@ let keyword_table = Common.hash_of_list [
 let error_radix s = 
   ("numeric " ^ s ^ " constant contains digits beyond the radix:")
 
+(* functions for figuring out the type of integers *)
+
+let is_long_dec s int uint long ulong =
+  match !Flag_parsing_c.int_thresholds with
+    None -> int
+  | Some (_,_,uint_threshold,long_threshold,ulong_threshold) ->
+      let bn = Big_int.big_int_of_string s in
+      if Big_int.ge_big_int bn ulong_threshold
+      then ulong
+      else
+       if Big_int.ge_big_int bn long_threshold
+       then long
+       else
+         if Big_int.ge_big_int bn uint_threshold
+         then long
+         else int
+
+let is_long_ho s int uint long ulong drop bpd count =
+  match !Flag_parsing_c.int_thresholds with
+    None -> int
+  | Some (uint_sz,ulong_sz,_,_,_) ->
+      let len = String.length s in
+      (* this assumes that all of the hex/oct digits are significant *)
+      (* drop is 2 for hex (0x) and 1 for oct (0) *)
+      let s = String.sub s drop (len - drop) in
+      let len =
+       ((len-drop) * bpd) -
+         (count (int_of_string("0x"^(String.sub s 0 1)))) in
+      if len < uint_sz
+      then int
+      else
+       if len = uint_sz
+       then uint
+       else
+         if len < ulong_sz
+         then long
+         else ulong
+
+let is_long_oct s int uint long ulong =
+  is_long_ho s int uint long ulong 1 3
+    (* stupid, but probably more efficient than taking logs *)
+    (function 0 -> 3 | 1 -> 2 | n when n < 4 -> 1 | _ -> 0)
+let is_long_hex s int uint long ulong =
+  is_long_ho s int uint long ulong 2 4
+    (* stupid, but probably more efficient than taking logs *)
+    (function 0 -> 4 | 1 -> 3 | n when n < 4 -> 2 | n when n < 8 -> 1
+      | _ -> 0)
+
+let sint = (Signed,CInt)
+let uint = (UnSigned,CInt)
+let slong = (Signed,CLong)
+let ulong = (UnSigned,CLong)
+
 }
 
 (*****************************************************************************)
@@ -635,23 +686,36 @@ rule token = parse
       }
 
 
-  (* Take care of the order ? No because lex try the longest match. The
+  (* Take care of the order ? No because lex tries the longest match. The
    * strange diff between decimal and octal constant semantic is not
    * understood too by refman :) refman:11.1.4, and ritchie.
-   * 
-   * todo: attach type info to constant, like for float
    *)
 
-  | (( decimal | hexa | octal) 
-        ( ['u' 'U'] 
-        | ['l' 'L']  
-        | (['l' 'L'] ['u' 'U'])
-        | (['u' 'U'] ['l' 'L'])
-        | (['u' 'U'] ['l' 'L'] ['l' 'L'])
-        | (['l' 'L'] ['l' 'L'])
-        )?
-    ) as x { TInt (x, tokinfo lexbuf) }
-
+  | decimal as x
+      { TInt ((x, is_long_dec x sint slong slong ulong), tokinfo lexbuf) }
+  | hexa as x
+      { TInt ((x, is_long_hex x sint uint slong ulong), tokinfo lexbuf) }
+  | octal as x
+      { TInt ((x, is_long_oct x sint uint slong ulong), tokinfo lexbuf) }
+  | ((decimal as s) ['u' 'U']) as x
+      { TInt ((x, is_long_dec s uint uint ulong ulong), tokinfo lexbuf) }
+  | ((hexa as s) ['u' 'U']) as x
+      { TInt ((x, is_long_hex s uint uint ulong ulong), tokinfo lexbuf) }
+  | ((octal as s) ['u' 'U']) as x
+      { TInt ((x, is_long_oct s uint uint ulong ulong), tokinfo lexbuf) }
+  | (( decimal as s) ['l' 'L']) as x
+      { TInt ((x, is_long_dec s slong slong slong ulong), tokinfo lexbuf) }
+  | ((hexa as s) ['l' 'L']) as x
+      { TInt ((x, is_long_hex s slong slong slong ulong), tokinfo lexbuf) }
+  | ((octal as s) ['l' 'L']) as x
+      { TInt ((x, is_long_oct s slong slong slong ulong), tokinfo lexbuf) }
+  | ((( decimal | hexa | octal) ['l' 'L'] ['u' 'U'])
+  | (( decimal | hexa | octal) ['u' 'U'] ['l' 'L'])) as x
+      { TInt ((x, (UnSigned,CLong)), tokinfo lexbuf) }
+  | (( decimal | hexa | octal) ['l' 'L'] ['l' 'L']) as x
+      { TInt ((x, (Signed,CLongLong)), tokinfo lexbuf) }
+  | (( decimal | hexa | octal) ['u' 'U'] ['l' 'L'] ['l' 'L']) as x
+      { TInt ((x, (UnSigned,CLongLong)), tokinfo lexbuf) }
 
   | (real ['f' 'F']) as x { TFloat ((x, CFloat),      tokinfo lexbuf) }
   | (real ['l' 'L']) as x { TFloat ((x, CLongDouble), tokinfo lexbuf) }
@@ -769,6 +833,7 @@ and comment = parse
   (* noteopti: *)
   | [^ '*']+ { let s = tok lexbuf in s ^ comment lexbuf }
   | [ '*']   { let s = tok lexbuf in s ^ comment lexbuf }
+  | eof { pr2 "LEXER: end of file in comment"; "*/"}
   | _  
       { let s = tok lexbuf in
         pr2 ("LEXER: unrecognised symbol in comment:"^s);
index c54b786..08624e8 100644 (file)
@@ -34,6 +34,8 @@ open Common
 (* parse_typedef_fix *)
 let _handle_typedef = ref true
 
+let _always_look_typedef = ref false
+
 (* parse_typedef_fix2 *)
 let enable_typedef ()  = _handle_typedef := true
 let disable_typedef () = _handle_typedef := false
@@ -54,7 +56,7 @@ type identkind = TypeDefI | IdentI
 let (_typedef : (string, identkind) Common.scoped_h_env ref) = 
   ref (Common.empty_scoped_h_env ())
    
-let is_typedef s  = if !_handle_typedef then
+let is_typedef s  = if !_handle_typedef || !_always_look_typedef then
   (match (Common.optionise (fun () -> Common.lookup_h_env s !_typedef)) with
   | Some TypeDefI -> true
   | Some IdentI -> false
index 3b4357b..577ef14 100644 (file)
  *)
 open Common
 
+(*****************************************************************************)
+(* Wrappers *)
+(*****************************************************************************)
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_parsing
+
 (*****************************************************************************)
 (* Abstract line *)
 (*****************************************************************************)
@@ -32,7 +37,7 @@ let strip_info_visitor _ =
     function i -> ctr := !ctr + 1; Ast_c.al_info_cpp !ctr i));
 
     Visitor_c.kexpr_s = (fun (k,_) e -> 
-      let (e', ty),ii' = k e in
+      let (e', ty), ii' = k e in
       (e', Ast_c.noType()(*ref !ty*)), ii' (* keep type - jll *)
     );
 
@@ -238,3 +243,26 @@ let names_of_parameters_in_macro xs =
     let (s, ii2) = xx in
     s
   )
+
+
+
+(* only used in ast_to_flow, so move it ? *)
+let rec stmt_elems_of_sequencable xs = 
+  xs +> Common.map (fun x -> 
+    match x with
+    | Ast_c.StmtElem e -> [e]
+    | Ast_c.CppDirectiveStmt _
+    | Ast_c.IfdefStmt _ 
+        -> 
+        pr2_once ("stmt_elems_of_sequencable: filter a directive");
+        []
+    | Ast_c.IfdefStmt2 (_ifdef, xxs) -> 
+        pr2 ("stmt_elems_of_sequencable: IfdefStm2 TODO?");
+        xxs +> List.map (fun xs -> 
+          let xs' = stmt_elems_of_sequencable xs in
+          xs'
+        ) +> List.flatten
+  ) +> List.flatten
+        
+  
+
index 6e0b505..20910aa 100644 (file)
@@ -22,13 +22,7 @@ module Stat = Parsing_stat
 (*****************************************************************************)
 (* Wrappers *)
 (*****************************************************************************)
-let pr2 s = 
-  if !Flag_parsing_c.verbose_parsing 
-  then Common.pr2 s
-
-let pr2_once s = 
-  if !Flag_parsing_c.verbose_parsing 
-  then Common.pr2_once s
+let pr2_err, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_parsing 
     
 (*****************************************************************************)
 (* Helpers *)
@@ -45,7 +39,7 @@ let error_msg_tok tok =
   let file = TH.file_of_tok tok in
   if !Flag_parsing_c.verbose_parsing
   then Common.error_message file (token_to_strpos tok) 
-  else ("error in " ^ file  ^ "set verbose_parsing for more info")
+  else ("error in " ^ file  ^ "set verbose_parsing for more info")
 
 
 let print_bad line_error (start_line, end_line) filelines  = 
@@ -204,7 +198,7 @@ let print_commentized xs =
 
 (* called by parse_print_error_heuristic *)
 let tokens2 file = 
- let table     = Common.full_charpos_to_pos file in
+ let table     = Common.full_charpos_to_pos_large file in
 
  Common.with_open_infile file (fun chan -> 
   let lexbuf = Lexing.from_channel chan in
@@ -217,9 +211,9 @@ let tokens2 file =
           (* could assert pinfo.filename = file ? *)
          match Ast_c.pinfo_of_info ii with
            Ast_c.OriginTok pi ->
-              Ast_c.OriginTok (Common.complete_parse_info file table pi)
+              Ast_c.OriginTok (Common.complete_parse_info_large file table pi)
          | Ast_c.ExpandedTok (pi,vpi) ->
-              Ast_c.ExpandedTok((Common.complete_parse_info file table pi),vpi)
+              Ast_c.ExpandedTok((Common.complete_parse_info_large file table pi),vpi)
          | Ast_c.FakeTok (s,vpi) -> Ast_c.FakeTok (s,vpi)
          | Ast_c.AbstractLineTok pi -> failwith "should not occur"
       })
@@ -329,7 +323,7 @@ let parse_gen parsefunc s =
   let lexer_function = 
     (fun _ -> 
       if TH.is_eof !cur_tok
-      then (pr2 "LEXER: ALREADY AT END"; !cur_tok)
+      then (pr2_err "LEXER: ALREADY AT END"; !cur_tok)
       else
         let v = Common.pop2 all_tokens in
         cur_tok := v;
@@ -397,8 +391,8 @@ type class_token =
   | CReservedKwd (type | decl | qualif | flow | misc | attr)
 *)
 
-let ident_to_typename ident =
-  (Ast_c.nQ, (Ast_c.TypeName  (ident, Ast_c.noTypedefDef()), Ast_c.noii))
+let ident_to_typename ident : Ast_c.fullType =
+  Ast_c.mk_ty (Ast_c.TypeName  (ident, Ast_c.noTypedefDef())) Ast_c.noii
                   
 
 (* parse_typedef_fix4 *)
@@ -446,7 +440,7 @@ let consistency_checking2 xs =
     let xs = Common.hash_to_list v in
     if List.length xs >= 2
     then begin 
-      pr2 ("CONFLICT:" ^ k);
+      pr2_err ("CONFLICT:" ^ k);
       let sorted = xs +> List.sort (fun (ka,va) (kb,vb) -> 
         if !va =|= !vb then
           (match ka, kb with
@@ -459,10 +453,10 @@ let consistency_checking2 xs =
       let sorted = List.rev sorted in
       match sorted with
       | [CTypedef, i1;CIdent, i2] -> 
-          pr2 ("transforming some ident in typedef");
+          pr2_err ("transforming some ident in typedef");
           push2 k ident_to_type;
       | _ -> 
-          pr2 ("TODO:other transforming?");
+          pr2_err ("TODO:other transforming?");
       
     end
   );
@@ -479,8 +473,8 @@ let consistency_checking2 xs =
       Visitor_c.kdefineval_s = (fun (k,bigf) x -> 
         match x with
         | Ast_c.DefineExpr e -> 
-            (match e with
-            | (Ast_c.Ident (ident), _), _ii  -> 
+            (match Ast_c.unwrap_expr e with
+            | Ast_c.Ident (ident)  -> 
                 let s = Ast_c.str_of_name ident in 
                 if List.mem s !ident_to_type
                 then
@@ -492,20 +486,20 @@ let consistency_checking2 xs =
         | _ -> k x
       );
       Visitor_c.kexpr_s = (fun (k, bigf) x -> 
-        match x with
+        match Ast_c.get_e_and_ii x with
         | (Ast_c.SizeOfExpr e, tref), isizeof -> 
             let i1 = tuple_of_list1 isizeof in
-            (match e with
+            (match Ast_c.get_e_and_ii e with
             | (Ast_c.ParenExpr e, _), iiparen -> 
-                (match e with
+                let (i2, i3) = tuple_of_list2 iiparen in
+                (match Ast_c.get_e_and_ii e with
                 | (Ast_c.Ident (ident), _), _ii  -> 
 
                     let s = Ast_c.str_of_name ident in 
                     if List.mem s !ident_to_type
                     then
                       let t = ident_to_typename ident in
-                      let (i2, i3) = tuple_of_list2 iiparen in
-                      (Ast_c.SizeOfType t, tref), [i1;i2;i3]
+                      (Ast_c.SizeOfType t, tref),[i1;i2;i3]
                     else  k x
                 | _ -> k x
                 )
@@ -528,6 +522,29 @@ let consistency_checking a  =
 (* Error recovery *)
 (*****************************************************************************)
 
+let is_define_passed passed =
+  let xs = passed +> List.rev +> List.filter TH.is_not_comment in
+  if List.length xs >= 2 
+  then 
+    (match Common.head_middle_tail xs with
+    | Parser_c.TDefine _, _, Parser_c.TDefEOL _ -> 
+        true
+    | _ -> false
+    )
+  else begin
+    pr2_err "WEIRD: length list of error recovery tokens < 2 ";
+    false 
+  end
+
+let is_defined_passed_bis last_round = 
+  let xs = last_round +> List.filter TH.is_not_comment in
+  match xs with
+  | Parser_c.TDefine _::_ -> true
+  | _ -> false
+
+(* ---------------------------------------------------------------------- *)
+
+
 (* todo: do something if find Parser_c.Eof ? *)
 let rec find_next_synchro next already_passed =
 
@@ -549,13 +566,7 @@ let rec find_next_synchro next already_passed =
    * first { I found, so quite sure we will not loop. *)
 
   let last_round = List.rev already_passed in
-  let is_define = 
-    let xs = last_round +> List.filter TH.is_not_comment in
-    match xs with
-    | Parser_c.TDefine _::_ -> true
-    | _ -> false
-  in
-  if is_define 
+  if is_defined_passed_bis last_round 
   then find_next_synchro_define (last_round ++ next) []
   else 
 
@@ -577,10 +588,10 @@ let rec find_next_synchro next already_passed =
 and find_next_synchro_define next already_passed =
   match next with
   | [] ->  
-      pr2 "ERROR-RECOV: end of file while in recovery mode"; 
+      pr2_err "ERROR-RECOV: end of file while in recovery mode"; 
       already_passed, []
   | (Parser_c.TDefEOL i as v)::xs  -> 
-      pr2 ("ERROR-RECOV: found sync end of #define, line "^i_to_s(TH.line_of_tok v));
+      pr2_err ("ERROR-RECOV: found sync end of #define, line "^i_to_s(TH.line_of_tok v));
       v::already_passed, xs
   | v::xs -> 
       find_next_synchro_define xs (v::already_passed)
@@ -591,28 +602,28 @@ and find_next_synchro_define next already_passed =
 and find_next_synchro_orig next already_passed =
   match next with
   | [] ->  
-      pr2 "ERROR-RECOV: end of file while in recovery mode"; 
+      pr2_err "ERROR-RECOV: end of file while in recovery mode"; 
       already_passed, []
 
   | (Parser_c.TCBrace i as v)::xs when TH.col_of_tok v =|= 0 -> 
-      pr2 ("ERROR-RECOV: found sync '}' at line "^i_to_s (TH.line_of_tok v));
+      pr2_err ("ERROR-RECOV: found sync '}' at line "^i_to_s (TH.line_of_tok v));
 
       (match xs with
       | [] -> raise Impossible (* there is a EOF token normally *)
 
       (* still useful: now parser.mly allow empty ';' so normally no pb *)
       | Parser_c.TPtVirg iptvirg::xs -> 
-          pr2 "ERROR-RECOV: found sync bis, eating } and ;";
+          pr2_err "ERROR-RECOV: found sync bis, eating } and ;";
           (Parser_c.TPtVirg iptvirg)::v::already_passed, xs
 
       | Parser_c.TIdent x::Parser_c.TPtVirg iptvirg::xs -> 
-          pr2 "ERROR-RECOV: found sync bis, eating ident, }, and ;";
+          pr2_err "ERROR-RECOV: found sync bis, eating ident, }, and ;";
           (Parser_c.TPtVirg iptvirg)::(Parser_c.TIdent x)::v::already_passed, 
           xs
             
       | Parser_c.TCommentSpace sp::Parser_c.TIdent x::Parser_c.TPtVirg iptvirg
         ::xs -> 
-          pr2 "ERROR-RECOV: found sync bis, eating ident, }, and ;";
+          pr2_err "ERROR-RECOV: found sync bis, eating ident, }, and ;";
           (Parser_c.TCommentSpace sp)::
             (Parser_c.TPtVirg iptvirg)::
             (Parser_c.TIdent x)::
@@ -622,7 +633,7 @@ and find_next_synchro_orig next already_passed =
             
       | Parser_c.TCommentNewline sp::Parser_c.TIdent x::Parser_c.TPtVirg iptvirg
         ::xs -> 
-          pr2 "ERROR-RECOV: found sync bis, eating ident, }, and ;";
+          pr2_err "ERROR-RECOV: found sync bis, eating ident, }, and ;";
           (Parser_c.TCommentNewline sp)::
             (Parser_c.TPtVirg iptvirg)::
             (Parser_c.TIdent x)::
@@ -634,13 +645,99 @@ and find_next_synchro_orig next already_passed =
           v::already_passed, xs
       )
   | v::xs when TH.col_of_tok v =|= 0 && TH.is_start_of_something v  -> 
-      pr2 ("ERROR-RECOV: found sync col 0 at line "^ i_to_s(TH.line_of_tok v));
+      pr2_err ("ERROR-RECOV: found sync col 0 at line "^ i_to_s(TH.line_of_tok v));
       already_passed, v::xs
         
   | v::xs -> 
       find_next_synchro_orig xs (v::already_passed)
 
-      
+
+(*****************************************************************************)
+(* Macro problem recovery *)
+(*****************************************************************************)
+module TV = Token_views_c
+
+let candidate_macros_in_passed2 passed defs_optional = 
+  let res = ref [] in
+  let res2 = ref [] in
+
+  passed +> List.iter (function
+  | Parser_c.TIdent (s,_)
+   (* bugfix: may have to undo some infered things *)
+  | Parser_c.TMacroIterator (s,_)
+  | Parser_c.TypedefIdent (s,_)
+    -> 
+      (match Common.hfind_option s defs_optional with
+      | Some def -> 
+          if s ==~ Parsing_hacks.regexp_macro 
+          then
+            (* pr2 (spf "candidate: %s" s); *)
+            Common.push2 (s, def) res 
+          else 
+            Common.push2 (s, def) res2
+        | None -> ()
+        )
+
+  | _ -> ()
+  );
+  if null !res 
+  then !res2 
+  else !res
+
+let candidate_macros_in_passed a b = 
+  Common.profile_code "MACRO managment" (fun () -> 
+    candidate_macros_in_passed2 a b)
+  
+
+
+let find_optional_macro_to_expand2 ~defs toks =
+
+  let defs = Common.hash_of_list defs in
+
+  let toks = toks +> Common.map (function
+
+    (* special cases to undo *)
+    | Parser_c.TMacroIterator (s, ii) -> 
+        if Hashtbl.mem defs s
+        then Parser_c.TIdent (s, ii)
+        else Parser_c.TMacroIterator (s, ii)
+
+    | Parser_c.TypedefIdent (s, ii) -> 
+        if Hashtbl.mem defs s
+        then Parser_c.TIdent (s, ii)
+        else Parser_c.TypedefIdent (s, ii)
+
+    | x -> x
+  ) in
+
+  let tokens = toks in
+  Parsing_hacks.fix_tokens_cpp ~macro_defs:defs tokens
+
+  (* just calling apply_macro_defs and having a specialized version
+   * of the code in fix_tokens_cpp is not enough as some work such 
+   * as the passing of the body of attribute in Parsing_hacks.find_macro_paren
+   * will not get the chance to be run on the new expanded tokens.
+   * Hence even if it's expensive, it's currently better to 
+   * just call directly fix_tokens_cpp again here.
+
+  let tokens2 = ref (tokens +> Common.acc_map TV.mk_token_extended) in
+  let cleaner = !tokens2 +> Parsing_hacks.filter_cpp_stuff in
+  let paren_grouped = TV.mk_parenthised  cleaner in
+  Cpp_token_c.apply_macro_defs
+    ~msg_apply_known_macro:(fun s -> pr2 (spf "APPLYING: %s" s))
+    ~msg_apply_known_macro_hint:(fun s -> pr2 "hint")
+    defs paren_grouped;
+  (* because the before field is used by apply_macro_defs *)
+  tokens2 := TV.rebuild_tokens_extented !tokens2; 
+  Parsing_hacks.insert_virtual_positions 
+    (!tokens2 +> Common.acc_map (fun x -> x.TV.tok))
+  *)
+let find_optional_macro_to_expand ~defs a = 
+    Common.profile_code "MACRO managment" (fun () -> 
+      find_optional_macro_to_expand2 ~defs a)
+  
+
+
 (*****************************************************************************)
 (* Include/Define hacks *)
 (*****************************************************************************)
@@ -679,7 +776,9 @@ let new_info posadd str ii =
 
 let rec comment_until_defeol xs = 
   match xs with
-  | [] -> failwith "cant find end of define token TDefEOL"
+  | [] -> 
+      (* job not done in Cpp_token_c.define_parse ? *)
+      failwith "cant find end of define token TDefEOL"
   | x::xs -> 
       (match x with
       | Parser_c.TDefEOL i -> 
@@ -716,22 +815,43 @@ let tokens_include (info, includes, filename, inifdef) =
 (*****************************************************************************)
 
 let parse_cpp_define_file2 file = 
-  let toks = tokens ~profile:false file in
-  let toks = Parsing_hacks.fix_tokens_define toks in
-  Parsing_hacks.extract_cpp_define toks
+  Common.save_excursion Flag_parsing_c.verbose_lexing (fun () -> 
+    Flag_parsing_c.verbose_lexing := false;
+    let toks = tokens ~profile:false file in
+    let toks = Cpp_token_c.fix_tokens_define toks in
+    Cpp_token_c.extract_cpp_define toks
+  )
 
 let parse_cpp_define_file a = 
   Common.profile_code_exclusif "HACK" (fun () -> parse_cpp_define_file2 a)
 
+
+
+let (_defs : (string, Cpp_token_c.define_def) Hashtbl.t ref)  = 
+  ref (Hashtbl.create 101)
+
+let (_defs_builtins : (string, Cpp_token_c.define_def) Hashtbl.t ref)  = 
+  ref (Hashtbl.create 101)
+
+
 (* can not be put in parsing_hack, cos then mutually recursive problem as
  * we also want to parse the standard.h file.
  *)
-let init_defs std_h =     
+let init_defs_macros std_h =     
   if not (Common.lfile_exists std_h)
   then pr2 ("warning: Can't find default macro file: " ^ std_h)
   else begin
     pr2 ("init_defs: " ^ std_h);
-    Parsing_hacks._defs := Common.hash_of_list (parse_cpp_define_file std_h);
+    _defs := Common.hash_of_list (parse_cpp_define_file std_h);
+  end
+
+let init_defs_builtins file_h =     
+  if not (Common.lfile_exists file_h)
+  then pr2 ("warning: Can't find macro file: " ^ file_h)
+  else begin
+    pr2 ("init_defs_builtins: " ^ file_h);
+    _defs_builtins := 
+      Common.hash_of_list (parse_cpp_define_file file_h);
   end
 
 
@@ -804,14 +924,26 @@ type tokens_state = {
   mutable passed :       Parser_c.token list;
   mutable passed_clean : Parser_c.token list;
 }
-let clone_tokens_stat tr = 
+
+let mk_tokens_state toks = 
+  { 
+    rest       = toks;
+    rest_clean = (toks +> List.filter TH.is_not_comment);
+    current    = (List.hd toks);
+    passed = []; 
+    passed_clean = [];
+  }
+
+
+
+let clone_tokens_state tr = 
   { rest = tr.rest;
     rest_clean = tr.rest_clean;
     current = tr.current;
     passed = tr.passed;
     passed_clean = tr.passed_clean;
   }
-let copy_tokens_stat ~src ~dst = 
+let copy_tokens_state ~src ~dst = 
   dst.rest <- src.rest;
   dst.rest_clean <- src.rest_clean;
   dst.current <- src.current;
@@ -819,6 +951,7 @@ let copy_tokens_stat ~src ~dst =
   dst.passed_clean <-  src.passed_clean;
   ()
 
+(* todo? agglomerate the x##b ? *)
 let rec filter_noise n xs =
   match n, xs with
   | _, [] -> []
@@ -845,7 +978,7 @@ let clean_for_lookahead xs =
  *)
 let rec lexer_function ~pass tr = fun lexbuf -> 
   match tr.rest with
-  | [] -> pr2 "ALREADY AT END"; tr.current
+  | [] -> pr2_err "ALREADY AT END"; tr.current
   | v::xs -> 
     tr.rest <- xs;
     tr.current <- v;
@@ -873,7 +1006,7 @@ let rec lexer_function ~pass tr = fun lexbuf ->
        *)
       | Parser_c.TDefine (tok) -> 
           if not (LP.current_context () =*= LP.InTopLevel) && 
-            (!Flag_parsing_c.cpp_directive_passing || (pass =|= 2))
+            (!Flag_parsing_c.cpp_directive_passing || (pass >= 2))
           then begin
             incr Stat.nDefinePassing;
             pr2_once ("CPP-DEFINE: inside function, I treat it as comment");
@@ -892,7 +1025,7 @@ let rec lexer_function ~pass tr = fun lexbuf ->
             
       | Parser_c.TInclude (includes, filename, inifdef, info) -> 
           if not (LP.current_context () =*= LP.InTopLevel)  &&
-            (!Flag_parsing_c.cpp_directive_passing || (pass =|= 2))
+            (!Flag_parsing_c.cpp_directive_passing || (pass >= 2))
           then begin
             incr Stat.nIncludePassing;
             pr2_once ("CPP-INCLUDE: inside function, I treat it as comment");
@@ -945,11 +1078,13 @@ let rec lexer_function ~pass tr = fun lexbuf ->
     end
 
 
+let max_pass = 4
+
 
 let get_one_elem ~pass tr (file, filelines) = 
 
   if not (LP.is_enabled_typedef()) && !Flag_parsing_c.debug_typedef
-  then pr2 "TYPEDEF:_handle_typedef=false. Not normal if dont come from exn";
+  then pr2_err "TYPEDEF:_handle_typedef=false. Not normal if dont come from exn";
 
   (* normally have to do that only when come from an exception in which
    * case the dt() may not have been done 
@@ -971,25 +1106,14 @@ let get_one_elem ~pass tr (file, filelines) =
       Common.profile_code_exclusif "YACC" (fun () -> 
         Left (Parser_c.celem (lexer_function ~pass tr) lexbuf_fake)
       )
-    with e -> begin
-      if (pass =|= 1 && !Flag_parsing_c.disable_two_pass)|| (pass =|= 2) 
-      then begin 
-        (match e with
-        (* Lexical is not anymore launched I think *)
-        | Lexer_c.Lexical s -> 
-            pr2 ("lexical error " ^s^ "\n =" ^ error_msg_tok tr.current)
-        | Parsing.Parse_error -> 
-            pr2 ("parse error \n = " ^ error_msg_tok tr.current)
-        | Semantic_c.Semantic (s, i) -> 
-            pr2 ("semantic error " ^s^ "\n ="^ error_msg_tok tr.current)
-        | e -> raise e
-        )
-      end;
+    with e -> 
       LP.restore_typedef_state();
 
       (* must keep here, before the code that adjusts the tr fields *)
       let line_error = TH.line_of_tok tr.current in
-        
+
+      let passed_before_error = tr.passed in
+      let current = tr.current in
         
       (*  error recovery, go to next synchro point *)
       let (passed', rest') = find_next_synchro tr.rest tr.passed in
@@ -1003,8 +1127,9 @@ let get_one_elem ~pass tr (file, filelines) =
       
       
       let info_of_bads = Common.map_eff_rev TH.info_of_tok tr.passed in 
-      Right (info_of_bads,  line_error, tr.passed)
-    end
+      Right (info_of_bads,  line_error, 
+            tr.passed, passed_before_error, 
+            current, e)
   )
 
 
@@ -1032,21 +1157,34 @@ let parse_print_error_heuristic2 file =
   (* -------------------------------------------------- *)
   LP.lexer_reset_typedef(); 
   Parsing_hacks.ifdef_paren_cnt := 0;
+
   let toks_orig = tokens file in
 
-  let toks = Parsing_hacks.fix_tokens_define toks_orig in
-  let toks = Parsing_hacks.fix_tokens_cpp toks in
-
-  let tr = { 
-    rest       = toks;
-    rest_clean = (toks +> List.filter TH.is_not_comment);
-    current    = (List.hd toks);
-    passed = []; 
-    passed_clean = [];
-  } in
+  let toks = Cpp_token_c.fix_tokens_define toks_orig in
 
+  let toks = Parsing_hacks.fix_tokens_cpp ~macro_defs:!_defs_builtins toks in
 
+  (* expand macros on demand trick, preparation phase *)
+  let macros = 
+    Common.profile_code "MACRO mgmt prep 1" (fun () -> 
+      let macros = Hashtbl.copy !_defs in
+      (* include also builtins as some macros may generate some builtins too
+       * like __decl_spec or __stdcall
+       *)
+      !_defs_builtins +> Hashtbl.iter (fun s def -> 
+        Hashtbl.replace macros   s def;
+      );
+      macros
+    )
+  in
+  Common.profile_code "MACRO mgmt prep 2" (fun () -> 
+    let local_macros = parse_cpp_define_file file in
+    local_macros +> List.iter (fun (s, def) -> 
+      Hashtbl.replace macros   s def;
+    );
+  );
 
+  let tr = mk_tokens_state toks in
 
   let rec loop tr =
 
@@ -1063,21 +1201,64 @@ let parse_print_error_heuristic2 file =
     let checkpoint = TH.line_of_tok tr.current in
     let checkpoint_file = TH.file_of_tok tr.current in
 
-    let tr_save = clone_tokens_stat tr in
-    
     (* call the parser *)
     let elem = 
-      let pass1 = get_one_elem ~pass:1 tr (file, filelines) in
+      let pass1 = 
+        Common.profile_code "Parsing: 1st pass" (fun () -> 
+          get_one_elem ~pass:1 tr (file, filelines)
+        ) in
       match pass1 with
       | Left e -> Left e
-      | Right res -> 
-          if !Flag_parsing_c.disable_two_pass
-          then Right res
+      | Right (info,line_err, passed, passed_before_error, cur, exn) -> 
+          if !Flag_parsing_c.disable_multi_pass
+          then pass1
           else begin
-            pr2 "parsing pass2: try again";
-            copy_tokens_stat ~src:tr_save ~dst: tr;
-            let pass2 = get_one_elem ~pass:2 tr (file, filelines) in
-            pass2
+            Common.profile_code "Parsing: multi pass" (fun () -> 
+
+            pr2_err "parsing pass2: try again";
+            let toks = List.rev passed ++ tr.rest in
+            let new_tr = mk_tokens_state toks in
+            copy_tokens_state ~src:new_tr ~dst:tr;
+            let passx = get_one_elem ~pass:2 tr (file, filelines) in
+
+            (match passx with
+            | Left e -> passx
+            | Right (info,line_err,passed,passed_before_error,cur,exn) -> 
+                let candidates = 
+                  candidate_macros_in_passed passed macros 
+                in
+                if is_define_passed passed || null candidates
+                then passx
+                else begin
+                  (* todo factorize code *)
+
+                  pr2_err "parsing pass3: try again";
+                  let toks = List.rev passed ++ tr.rest in
+                  let toks' = 
+                    find_optional_macro_to_expand ~defs:candidates toks in
+                  let new_tr = mk_tokens_state toks' in
+                  copy_tokens_state ~src:new_tr ~dst:tr;
+                  let passx = get_one_elem ~pass:3 tr (file, filelines) in
+
+                  (match passx with
+                  | Left e -> passx
+                  | Right (info,line_err,passed,passed_before_error,cur,exn) -> 
+                      pr2_err "parsing pass4: try again";
+
+                      let candidates = 
+                        candidate_macros_in_passed passed macros in
+
+                      let toks = List.rev passed ++ tr.rest in
+                      let toks' = 
+                      find_optional_macro_to_expand ~defs:candidates toks in
+                      let new_tr = mk_tokens_state toks' in
+                      copy_tokens_state ~src:new_tr ~dst:tr;
+                      let passx = get_one_elem ~pass:4 tr (file, filelines) in
+                      passx
+                  )
+                 end
+            )
+            )
           end
     in
 
@@ -1086,37 +1267,6 @@ let parse_print_error_heuristic2 file =
     let checkpoint2 = TH.line_of_tok tr.current in (* <> line_error *)
     let checkpoint2_file = TH.file_of_tok tr.current in
 
-    let was_define = 
-      (match elem with
-      | Left _ -> false
-      | Right (_, line_error, _) -> 
-          let was_define = 
-            let xs = tr.passed +> List.rev +> List.filter TH.is_not_comment in
-            if List.length xs >= 2 
-            then 
-              (match Common.head_middle_tail xs with
-              | Parser_c.TDefine _, _, Parser_c.TDefEOL _ -> 
-                  true
-              | _ -> false
-              )
-            else begin
-              pr2 "WEIRD: length list of error recovery tokens < 2 ";
-              false 
-            end
-          in
-          (if was_define && !Flag_parsing_c.filter_msg_define_error
-          then ()
-          else 
-            (* bugfix: *)
-            if (checkpoint_file =$= checkpoint2_file) && 
-                checkpoint_file =$= file
-            then print_bad line_error (checkpoint, checkpoint2) filelines
-            else pr2 "PB: bad: but on tokens not from original file"
-          );
-          was_define
-      ) in
-    
-
     let diffline = 
       if (checkpoint_file =$= checkpoint2_file) && (checkpoint_file =$= file)
       then (checkpoint2 - checkpoint) 
@@ -1139,22 +1289,59 @@ let parse_print_error_heuristic2 file =
       | Left e -> 
           stat.Stat.correct <- stat.Stat.correct + diffline;
           e
-      | Right (info_of_bads, line_error, toks_of_bads) -> 
+      | Right (info_of_bads, line_error, toks_of_bads, 
+              _passed_before_error, cur, exn) -> 
+
+          let was_define = is_define_passed tr.passed in
+          
+          if was_define && !Flag_parsing_c.filter_msg_define_error
+          then ()
+          else begin
+
+            (match exn with
+            | Lexer_c.Lexical _ 
+            | Parsing.Parse_error
+            | Semantic_c.Semantic _ -> ()
+            | e -> raise e
+            );
+
+            if !Flag_parsing_c.show_parsing_error
+            then begin 
+              (match exn with
+              (* Lexical is not anymore launched I think *)
+              | Lexer_c.Lexical s -> 
+                  pr2 ("lexical error " ^s^ "\n =" ^ error_msg_tok cur)
+              | Parsing.Parse_error -> 
+                  pr2 ("parse error \n = " ^ error_msg_tok cur)
+              | Semantic_c.Semantic (s, i) -> 
+                  pr2 ("semantic error " ^s^ "\n ="^ error_msg_tok cur)
+              | e -> raise Impossible
+              );
+              (* bugfix: *)
+              if (checkpoint_file =$= checkpoint2_file) && 
+                checkpoint_file =$= file
+              then print_bad line_error (checkpoint, checkpoint2) filelines
+              else pr2 "PB: bad: but on tokens not from original file"
+            end;
+
+            
+            let pbline = 
+              toks_of_bads 
+              +> Common.filter (TH.is_same_line_or_close line_error)
+              +> Common.filter TH.is_ident_like 
+            in
+            let error_info = 
+              (pbline +> List.map TH.str_of_tok), line_error
+            in
+            stat.Stat.problematic_lines <- 
+              error_info::stat.Stat.problematic_lines;
+
+          end;
+
           if was_define && !Flag_parsing_c.filter_define_error
           then stat.Stat.correct <- stat.Stat.correct + diffline
           else stat.Stat.bad     <- stat.Stat.bad     + diffline;
 
-          let pbline = 
-            toks_of_bads 
-            +> Common.filter (TH.is_same_line_or_close line_error)
-            +> Common.filter TH.is_ident_like 
-          in
-          let error_info = 
-            (pbline +> List.map TH.str_of_tok), line_error
-          in
-          stat.Stat.problematic_lines <- 
-            error_info::stat.Stat.problematic_lines;
-
           Ast_c.NotParsedCorrectly info_of_bads
     in
 
@@ -1215,8 +1402,9 @@ let parse_cache file =
 (*****************************************************************************)
 
 let (cstatement_of_string: string -> Ast_c.statement) = fun s ->
-  Common.write_file ("/tmp/__cocci.c") ("void main() { \n" ^ s ^ "\n}");
-  let program = parse_c_and_cpp ("/tmp/__cocci.c") +> fst in
+  let tmpfile = Common.new_temp_file "cocci_stmt_of_s" "c" in
+  Common.write_file tmpfile ("void main() { \n" ^ s ^ "\n}");
+  let program = parse_c_and_cpp tmpfile +> fst in
   program +> Common.find_some (fun (e,_) -> 
     match e with
     | Ast_c.Definition ({Ast_c.f_body = [Ast_c.StmtElem st]},_) -> Some st
@@ -1224,13 +1412,18 @@ let (cstatement_of_string: string -> Ast_c.statement) = fun s ->
   )
 
 let (cexpression_of_string: string -> Ast_c.expression) = fun s ->
-  Common.write_file ("/tmp/__cocci.c") ("void main() { \n" ^ s ^ ";\n}");
-  let program = parse_c_and_cpp ("/tmp/__cocci.c") +> fst in
+  let tmpfile = Common.new_temp_file "cocci_expr_of_s" "c" in
+  Common.write_file tmpfile ("void main() { \n" ^ s ^ ";\n}");
+  let program = parse_c_and_cpp tmpfile +> fst in
   program +> Common.find_some (fun (e,_) -> 
     match e with
     | Ast_c.Definition ({Ast_c.f_body = compound},_) -> 
         (match compound with
-        | [Ast_c.StmtElem (Ast_c.ExprStatement (Some e),ii)] -> Some e
+        | [Ast_c.StmtElem st] -> 
+            (match Ast_c.unwrap_st st with
+            | Ast_c.ExprStatement (Some e) -> Some e
+            | _ -> None
+            )
         | _ -> None
         )
     | _ -> None
index 8a6cc91..c877e7d 100644 (file)
@@ -12,6 +12,20 @@ type program2 = toplevel2 list
     (* the token list contains now also the comment-tokens *)
     and info_item = (string * Parser_c.token list)
 
+(* ---------------------------------------------------------------------- *)
+(* a few globals *)
+val parse_cpp_define_file : 
+  filename -> (string, Cpp_token_c.define_def) assoc
+
+(* usually correspond to what is inside your macros.h *)
+val _defs : (string, Cpp_token_c.define_def) Hashtbl.t ref
+(* usually correspond to what is inside your standard.h *)
+val _defs_builtins : (string, Cpp_token_c.define_def) Hashtbl.t ref
+
+val init_defs_macros : filename -> unit
+val init_defs_builtins : filename -> unit
+
+
 (* ---------------------------------------------------------------------- *)
 (* This is the main function *)
 val parse_print_error_heuristic:  
@@ -24,17 +38,6 @@ val parse_c_and_cpp :
 val parse_cache:
   filename (*cfile*) -> (program2 * Parsing_stat.parsing_stat)
 
-
-(* ---------------------------------------------------------------------- *)
-val parse_cpp_define_file : 
-  filename -> (string, Parsing_hacks.define_def) assoc
-
-val init_defs : filename -> unit
-
-
-
-
-
 (* ---------------------------------------------------------------------- *)
 (* used also for the standard.h file *)
 val tokens:      ?profile:bool -> filename -> Parser_c.token list
index e01b51f..14d3f8c 100644 (file)
@@ -31,10 +31,7 @@ let warning s v =
   then Common.warning ("PARSING: " ^ s) v
   else v
 
-
-let pr2 s = 
-  if !Flag_parsing_c.verbose_parsing 
-  then Common.pr2 s
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_parsing 
 
 (*****************************************************************************)
 (* Parse helpers functions *)
@@ -135,8 +132,7 @@ let (fixDeclSpecForDecl: decl -> (fullType * (storage wrap)))  = function
   typeD = (ty,iit); 
   inlineD = (inline,iinl);
   } -> 
-  (
-   ((qu, iiq),
+   let ty',iit' = 
    (match ty with 
  | (None,None,None)       -> 
      (* generate fake_info, otherwise type_annotater can crash in 
@@ -151,8 +147,10 @@ let (fixDeclSpecForDecl: decl -> (fullType * (storage wrap)))  = function
      BaseType(IntType (Si (Signed, [Short,CShort; Long, CLong; LongLong, CLongLong] +> List.assoc x))), iit
  | (Some UnSigned, Some x, (None| Some (BaseType (IntType (Si (_,CInt))))))-> 
      BaseType(IntType (Si (UnSigned, [Short,CShort; Long, CLong; LongLong, CLongLong] +> List.assoc x))), iit
- | (Some sign,   None, (Some (BaseType (IntType CChar))))   -> BaseType(IntType (Si (sign, CChar2))), iit
- | (None, Some Long,(Some(BaseType(FloatType CDouble))))    -> BaseType (FloatType (CLongDouble)), iit
+ | (Some sign,   None, (Some (BaseType (IntType CChar))))   ->
+     BaseType(IntType (Si (sign, CChar2))), iit
+ | (None, Some Long,(Some(BaseType(FloatType CDouble))))    ->
+     BaseType (FloatType (CLongDouble)), iit
 
  | (Some _,_, Some _) ->  
      (*mine*)
@@ -174,9 +172,13 @@ let (fixDeclSpecForDecl: decl -> (fullType * (storage wrap)))  = function
       * {....} and never with a typedef cos now we parse short uint i
       * as short ident ident => parse error (cos after first short i
       * pass in dt() mode) *)
-   ))
+
+   )
+   in
+   ((qu, iiq),
+   (ty', iit'))
      ,((st, inline),iist++iinl)
-  )
+  
 
 let fixDeclSpecForParam = function ({storageD = (st,iist)} as r) -> 
   let ((qu,ty) as v,_st) = fixDeclSpecForDecl r in
@@ -188,6 +190,16 @@ let fixDeclSpecForParam = function ({storageD = (st,iist)} as r) ->
         (Semantic ("storage class specified for parameter of function", 
                   fake_pi))
 
+let fixDeclSpecForMacro = function ({storageD = (st,iist)} as r) -> 
+  let ((qu,ty) as v,_st) = fixDeclSpecForDecl r in
+  match st with
+  | NoSto -> v
+  | _ -> 
+      raise 
+        (Semantic ("storage class specified for macro type decl", 
+                  fake_pi))
+
+
 let fixDeclSpecForFuncDef x =
   let (returnType,storage) = fixDeclSpecForDecl x in
   (match fst (unwrap storage) with
@@ -207,25 +219,33 @@ let fixDeclSpecForFuncDef x =
  * argument (in the typedef)
  *)
 let (fixOldCDecl: fullType -> fullType) = fun ty ->
-  match snd ty with
-  | ((FunctionType (fullt, (params, (b, iib)))),iifunc) -> 
+  match Ast_c.unwrap_typeC ty with
+  | FunctionType (fullt, (params, (b, iib))) -> 
 
       (* stdC: If the prototype declaration declares a parameter for a
        * function that you are defining (it is part of a function
        * definition), then you must write a name within the declarator.
        * Otherwise, you can omit the name. *)
       (match params with
-      | [{p_namei = None; p_type = ((_qua, (BaseType Void,_)))},_] ->  
-          ty
+      | [{p_namei = None; p_type = ty2},_] -> 
+          (match Ast_c.unwrap_typeC ty2 with
+          | BaseType Void ->  
+              ty
+          | _ -> 
+              pr2 ("SEMANTIC:parameter name omitted, but I continue");
+              ty
+          )
+              
       | params -> 
           (params +> List.iter (fun (param,_) ->
             match param with
             | {p_namei = None} -> 
               (* if majuscule, then certainly macro-parameter *)
-              pr2 ("SEMANTIC:parameter name omitted, but I continue"); 
+                pr2 ("SEMANTIC:parameter name omitted, but I continue"); 
            | _ -> ()
           ));
-           ty)
+          ty
+      )
       
         (* todo? can we declare prototype in the decl or structdef,
            ... => length <> but good kan meme *)
@@ -237,16 +257,25 @@ let (fixOldCDecl: fullType -> fullType) = fun ty ->
 let fixFunc (typ, compound, old_style_opt) = 
   let (cp,iicp) = compound in
 
-  match typ with
-  | (name, 
-    (nQ, (FunctionType (fullt, (params,bool)),iifunc)), 
-    (st,iist),
-    attrs)
-    -> 
+  let (name, ty,   (st,iist),  attrs) = typ in
+
+  let (qu, tybis) = ty in
+
+  match Ast_c.unwrap_typeC ty with
+  | FunctionType (fullt, (params,abool)) -> 
+      let iifunc = Ast_c.get_ii_typeC_take_care tybis in
+
       let iistart = Ast_c.fakeInfo () in
-      assert (nQ =*= nullQualif);
+      assert (qu =*= nullQualif);
+
       (match params with
-      | [{p_namei= None; p_type =((_qua, (BaseType Void,_)))}, _] ->  ()
+      | [{p_namei= None; p_type = ty2}, _] -> 
+          (match Ast_c.unwrap_typeC ty2 with
+          | BaseType Void ->  ()
+          | _ -> 
+                (* failwith "internal errror: fixOldCDecl not good" *)
+              ()
+          )
       | params -> 
           params +> List.iter (function 
           | ({p_namei = Some s}, _) -> ()
@@ -281,7 +310,7 @@ let fixFunc (typ, compound, old_style_opt) =
 
       (* it must be nullQualif,cos parser construct only this*)
       {f_name = name;
-       f_type = (fullt, (params, bool));
+       f_type = (fullt, (params, abool));
        f_storage = st;
        f_body = cp;
        f_attr = attrs;
@@ -308,11 +337,19 @@ let et s () =
   LP.enable_typedef ()
 
 
-let fix_add_params_ident = function
-  | ((s, (nQ, (FunctionType (fullt, (params, bool)),_)), st, _attrs)) ->  
+let fix_add_params_ident x = 
+  let (s, ty, st, _attrs) = x in
+  match Ast_c.unwrap_typeC ty with
+  | FunctionType (fullt, (params, bool)) ->
 
       (match params with
-      | [{p_namei=None; p_type=((_qua, (BaseType Void,_)))}, _] ->  ()
+      | [{p_namei=None; p_type=ty2}, _] ->  
+          (match Ast_c.unwrap_typeC ty2 with
+          | BaseType Void -> ()
+          | _ -> 
+              (* failwith "internal errror: fixOldCDecl not good" *)
+              ()
+          )
       | params -> 
           params +> List.iter (function 
           | ({p_namei= Some name}, _) -> 
@@ -330,7 +367,7 @@ let fix_add_params_ident = function
 (* shortcuts *)
 (*-------------------------------------------------------------------------- *)
 
-let mk_e e ii = ((e, Ast_c.noType()), ii)
+let mk_e e ii = Ast_c.mk_e e ii
 
 let mk_string_wrap (s,info) = (s, [info])
     
@@ -358,7 +395,7 @@ let mk_string_wrap (s,info) = (s, [info])
 /*(* the normal tokens *)*/
 /*(*-----------------------------------------*)*/
 
-%token <string * Ast_c.info>                     TInt
+%token <(string * (Ast_c.sign * Ast_c.base)) * Ast_c.info> TInt
 %token <(string * Ast_c.floatType) * Ast_c.info> TFloat
 %token <(string * Ast_c.isWchar) * Ast_c.info>   TChar
 %token <(string * Ast_c.isWchar) * Ast_c.info>   TString
@@ -483,9 +520,12 @@ let mk_string_wrap (s,info) = (s, [info])
 %token <(string * Ast_c.info)>            TMacroString 
 %token <(string * Ast_c.info)> TMacroDecl
 %token <Ast_c.info>            TMacroDeclConst 
-%token <(string * Ast_c.info)> TMacroStructDecl
+
 %token <(string * Ast_c.info)> TMacroIterator
-/*(* %token <(string * Ast_c.info)> TMacroTop *)*/
+/*(* 
+%token <(string * Ast_c.info)> TMacroTop 
+%token <(string * Ast_c.info)> TMacroStructDecl
+*)*/
 
 %token <(string * Ast_c.info)>            TMacroAttrStorage
 
@@ -604,9 +644,19 @@ identifier:
  * also cppext: gccext: ##args for variadic macro
  *)
 */
-ident_cpp:
+identifier_cpp:
  | TIdent       
      { RegularName (mk_string_wrap $1) }
+ | ident_extra_cpp { $1 }
+
+ident_cpp:
+ | TIdent
+     { RegularName (mk_string_wrap $1) }
+ | TypedefIdent       
+     { RegularName (mk_string_wrap $1) }
+ | ident_extra_cpp { $1 }
+
+ident_extra_cpp:
  | TIdent TCppConcatOp identifier_cpp_list 
      {  
        CppConcatenatedName (
@@ -719,8 +769,10 @@ postfix_expr:
      { mk_e(Constructor ($2, List.rev $5)) ([$1;$3;$4;$7] ++ $6) }
 
 primary_expr:
- | ident_cpp  { mk_e(Ident  ($1)) [] }
- | TInt    { mk_e(Constant (Int    (fst $1))) [snd $1] }
+ | identifier_cpp  { mk_e(Ident  ($1)) [] }
+ | TInt
+    { let (str,(sign,base)) = fst $1 in
+      mk_e(Constant (Int (str,Si(sign,base)))) [snd $1] }
  | TFloat  { mk_e(Constant (Float  (fst $1))) [snd $1] }
  | TString { mk_e(Constant (String (fst $1))) [snd $1] }
  | TChar   { mk_e(Constant (Char   (fst $1))) [snd $1] }
@@ -787,7 +839,9 @@ tcpar2: TCPar { et "tcpar2" (); $1 (*TODO? et ? sure ? c pas dt plutot ? *) }
 /*(* statement *)*/
 /*(*************************************************************************)*/
 
-statement: 
+statement: statement2 { mk_st (fst $1) (snd $1) }
+
+statement2: 
  | labeled         { Labeled      (fst $1), snd $1 }
  | compound        { Compound     (fst $1), snd $1 }
  | expr_statement  { ExprStatement(fst $1), snd $1 }
@@ -823,9 +877,11 @@ end_labeled:
     * and modifying below stat_or_decl_list
     *)*/
  | ident_cpp            TDotDot 
-     { Label ($1, (ExprStatement None, [])), [$2] }
- | Tcase const_expr TDotDot { Case ($2, (ExprStatement None, [])), [$1;$3] }   
- | Tdefault         TDotDot { Default (ExprStatement None, []),    [$1; $2] }  
+     { Label ($1, (mk_st (ExprStatement None) Ast_c.noii)), [$2] }
+ | Tcase const_expr TDotDot 
+     { Case ($2, (mk_st (ExprStatement None) Ast_c.noii)), [$1;$3] }
+ | Tdefault         TDotDot 
+     { Default (mk_st (ExprStatement None) Ast_c.noii),    [$1; $2] }
 
 
 
@@ -850,16 +906,16 @@ compound2:
 stat_or_decl_list: 
  | stat_or_decl                   { [$1] }                          
  /*(* gccext: to avoid conflicts, cf end_labeled above *)*/
- | end_labeled  { [StmtElem (Labeled      (fst $1), snd $1)] }
+ | end_labeled  { [StmtElem (mk_st (Labeled  (fst $1)) (snd $1))] }
  /*(* old: conflicts | stat_or_decl_list stat_or_decl { $1 ++ [$2] } *)*/
  | stat_or_decl stat_or_decl_list { $1 :: $2 }
 
 stat_or_decl: 
- | decl      { StmtElem (Decl ($1 Ast_c.LocalDecl), []) }
+ | decl      { StmtElem (mk_st (Decl ($1 Ast_c.LocalDecl)) Ast_c.noii) }
  | statement { StmtElem $1 }
 
   /*(* gccext: *)*/
- | function_definition { StmtElem (NestedFunc $1, []) }
+ | function_definition { StmtElem (mk_st (NestedFunc $1) Ast_c.noii) }
 
  /* (* cppext: *)*/
  | cpp_directive 
@@ -877,7 +933,7 @@ expr_statement:
 
 selection: 
  | Tif TOPar expr TCPar statement              %prec SHIFTHERE
-     { If ($3, $5, (ExprStatement None, [])),   [$1;$2;$4] }
+     { If ($3, $5, (mk_st (ExprStatement None) Ast_c.noii)),   [$1;$2;$4] }
  | Tif TOPar expr TCPar statement Telse statement 
      { If ($3, $5, $7),  [$1;$2;$4;$6] }
  | Tswitch TOPar expr TCPar statement             
@@ -1036,28 +1092,32 @@ declarator:
 
 /*(* so must do  int * const p; if the pointer is constant, not the pointee *)*/
 pointer: 
- | TMul                          { fun x ->(nQ,         (Pointer x,     [$1]))}
- | TMul type_qualif_list         { fun x ->($2.qualifD, (Pointer x,     [$1]))}
- | TMul pointer                  { fun x ->(nQ,         (Pointer ($2 x),[$1]))}
- | TMul type_qualif_list pointer { fun x ->($2.qualifD, (Pointer ($3 x),[$1]))}
+ | TMul                   { fun x -> mk_ty (Pointer x) [$1] }
+ | TMul pointer           { fun x -> mk_ty (Pointer ($2 x)) [$1] }
+ | TMul type_qualif_list  
+     { fun x -> ($2.qualifD, mk_tybis (Pointer x) [$1])}
+ | TMul type_qualif_list pointer 
+     { fun x -> ($2.qualifD, mk_tybis (Pointer ($3 x)) [$1]) }
 
 
 direct_d: 
- | ident_cpp
+ | identifier_cpp
      { ($1, fun x -> x) }
  | TOPar declarator TCPar      /*(* forunparser: old: $2 *)*/ 
-     { (fst $2, fun x -> (nQ, (ParenType ((snd $2) x), [$1;$3]))) }
+     { (fst $2, fun x -> mk_ty (ParenType ((snd $2) x)) [$1;$3]) }
  | direct_d tocro            tccro         
-     { (fst $1,fun x->(snd $1) (nQ,(Array (None,x),         [$2;$3]))) }
+     { (fst $1,fun x->(snd $1) (mk_ty (Array (None,x)) [$2;$3])) }
  | direct_d tocro const_expr tccro
-     { (fst $1,fun x->(snd $1) (nQ,(Array (Some $3,x),      [$2;$4])))}
+     { (fst $1,fun x->(snd $1) (mk_ty (Array (Some $3,x)) [$2;$4])) }
  | direct_d topar            tcpar
      { (fst $1,
        fun x->(snd $1) 
-         (nQ,(FunctionType (x,(([],(false, [])))),[$2;$3])))
+         (mk_ty (FunctionType (x,(([],(false, []))))) [$2;$3]))
      }
  | direct_d topar parameter_type_list tcpar
-     { (fst $1,fun x->(snd $1) (nQ,(FunctionType (x, $3),   [$2;$4]))) }
+     { (fst $1,fun x->(snd $1) 
+       (mk_ty (FunctionType (x, $3)) [$2;$4])) 
+     }
 
 
 /*(*----------------------------*)*/
@@ -1075,20 +1135,20 @@ abstract_declarator:
 
 direct_abstract_declarator: 
  | TOPar abstract_declarator TCPar /*(* forunparser: old: $2 *)*/
-     { (fun x -> (nQ, (ParenType ($2 x), [$1;$3]))) }
+     { fun x -> mk_ty (ParenType ($2 x)) [$1;$3] }
 
  | TOCro            TCCro                            
-     { fun x ->   (nQ, (Array (None, x),      [$1;$2]))}
+     { fun x -> mk_ty (Array (None, x)) [$1;$2] }
  | TOCro const_expr TCCro                            
-     { fun x ->   (nQ, (Array (Some $2, x),   [$1;$3]))}
+     { fun x -> mk_ty (Array (Some $2, x)) [$1;$3] }
  | direct_abstract_declarator TOCro            TCCro 
-     { fun x ->$1 (nQ, (Array (None, x),      [$2;$3])) }
+     { fun x -> $1 (mk_ty (Array (None, x))  [$2;$3]) }
  | direct_abstract_declarator TOCro const_expr TCCro
-     { fun x ->$1 (nQ, (Array (Some $3,x),    [$2;$4])) }
+     { fun x -> $1 (mk_ty (Array (Some $3,x))  [$2;$4]) }
  | TOPar TCPar                                       
-     { fun x ->   (nQ, (FunctionType (x, ([], (false,  []))),   [$1;$2])) }
+     { fun x -> mk_ty (FunctionType (x, ([], (false,  [])))) [$1;$2] }
  | topar parameter_type_list tcpar
-     { fun x ->   (nQ, (FunctionType (x, $2),           [$1;$3]))}
+     { fun x -> mk_ty (FunctionType (x, $2))  [$1;$3] }
 /*(* subtle: here must also use topar, not TOPar, otherwise if have for
    * instance   (xxx ( * )(xxx)) cast, then the second xxx may still be a Tident
    * but we want to reduce topar, to set the InParameter so that 
@@ -1099,9 +1159,9 @@ direct_abstract_declarator:
    * "disable typedef cos special case ..." message.
 *)*/
  | direct_abstract_declarator topar tcpar
-     { fun x ->$1 (nQ, (FunctionType (x, (([], (false, [])))),[$2;$3])) }
+     { fun x -> $1 (mk_ty (FunctionType (x, (([], (false, []))))) [$2;$3]) }
  | direct_abstract_declarator topar parameter_type_list tcpar
-     { fun x -> $1 (nQ, (FunctionType (x, $3), [$2;$4])) }
+     { fun x -> $1 (mk_ty (FunctionType (x, $3)) [$2;$4]) }
 
 /*(*-----------------------------------------------------------------------*)*/
 /*(* Parameters (use decl_spec not type_spec just for 'register') *)*/
@@ -1141,6 +1201,7 @@ parameter_decl2:
 /*(*----------------------------*)*/
 
 parameter_decl: parameter_decl2 { et "param" ();  $1 }
+ | attributes parameter_decl2 { et "param" (); $2 }
 
 declaratorp: 
  | declarator  { LP.add_ident (str_of_name (fst $1)); $1 }
@@ -1274,7 +1335,7 @@ storage_class_spec2:
 storage_class_spec:
  /*(* gccext: *)*/
  | storage_class_spec2 { $1 }
- | storage_class_spec2 attributes_storage { $1 (* TODO *) }
+ | storage_class_spec2 attribute_storage_list { $1 (* TODO *) }
 
 
 
@@ -1413,15 +1474,20 @@ struct_or_union2:
 
 
 struct_decl2: 
- | field_declaration { DeclarationField $1, noii }
- | TPtVirg { EmptyField, [$1]  }
- | TMacroStructDecl { MacroStructDeclTodo, [] }
+ | field_declaration { DeclarationField $1 }
+ | TPtVirg { EmptyField $1  }
+
+ /*(* no conflict ? no need for a TMacroStruct ? apparently not as at struct
+    * the rule are slightly different.
+    *)*/
+ | identifier TOPar argument_list TCPar TPtVirg
+     { MacroDeclField ((fst $1, $3), [snd $1;$2;$4;$5;fakeInfo()]) }
 
  /*(* cppext: *)*/
  | cpp_directive 
-     { CppDirectiveStruct $1, noii }
+     { CppDirectiveStruct $1 }
  | cpp_ifdef_directive/*(* struct_decl_list ... *)*/ 
-     { IfdefStruct $1, noii }
+     { IfdefStruct $1 }
 
 
 field_declaration:
@@ -1605,10 +1671,41 @@ cpp_directive:
 define_val: 
  | expr      { DefineExpr $1 }
  | statement { DefineStmt $1 }
- | decl      { DefineStmt (Decl ($1 Ast_c.NotLocalDecl), []) }
+ | decl      { DefineStmt (mk_st (Decl ($1 Ast_c.NotLocalDecl)) Ast_c.noii) }
+
+/*(*old: 
+  * | TypedefIdent { DefineType (nQ,(TypeName(fst $1,noTypedefDef()),[snd $1]))}
+  * get conflicts: 
+  * | spec_qualif_list TMul
+  *   { let (returnType, _) = fixDeclSpecForDecl $1 in  DefineType returnType }
+  *)
+*/
+ | decl_spec 
+     { let returnType = fixDeclSpecForMacro $1 in 
+       DefineType returnType
+     }
+ | decl_spec abstract_declarator 
+     { let returnType = fixDeclSpecForMacro $1 in 
+       let typ = $2 returnType in
+       DefineType typ
+     }
+
+/* can be in conflict with decl_spec, maybe change fixDeclSpecForMacro 
+ * to also allow storage ?
+ | storage_class_spec { DefineTodo }
+ | Tinline { DefineTodo }
+*/
+
+ /*(* a few special cases *)*/
+ | stat_or_decl stat_or_decl_list { DefineTodo }
+/*
+ | statement statement { DefineTodo }
+ | decl function_definition { DefineTodo }
+*/
+
+
+
 
-/*(*old: | TypedefIdent { DefineType (nQ,(TypeName(fst $1,noTypedefDef()),[snd $1]))}*)*/
- | spec_qualif_list { DefineTodo }
  | function_definition { DefineFunction $1 }
 
  | TOBraceDefineInit initialize_list gcc_comma_opt_struct TCBrace comma_opt 
@@ -1624,21 +1721,11 @@ define_val:
        DefineDoWhileZero (($2,$5),   [$1;$3;$4;$6])
      }
 
- /*(* a few special cases *)*/
- | stat_or_decl stat_or_decl_list { DefineTodo }
-/*
- | statement statement { DefineTodo }
- | decl function_definition { DefineTodo }
-*/
-
  | Tasm TOPar asmbody TCPar              { DefineTodo }
  | Tasm Tvolatile TOPar asmbody TCPar    { DefineTodo }
 
-
  /*(* aliases macro *)*/
  | TMacroAttr { DefineTodo }
- | storage_class_spec { DefineTodo }
- | Tinline { DefineTodo }
 
  | /*(* empty *)*/ { DefineEmpty }
 
@@ -1688,7 +1775,10 @@ cpp_other:
     * at the top, only decl or function definition.
     *)*/
  | identifier TOPar argument_list TCPar TPtVirg
-     { MacroTop (fst $1, $3,    [snd $1;$2;$4;$5]) } 
+     { 
+       Declaration (MacroDecl ((fst $1, $3), [snd $1;$2;$4;$5;fakeInfo()])) 
+       (* old: MacroTop (fst $1, $3,    [snd $1;$2;$4;$5])  *)
+     }
 
  /*(* TCParEOL to fix the end-of-stream bug of ocamlyacc *)*/
  | identifier TOPar argument_list TCParEOL
@@ -1883,7 +1973,6 @@ attribute_storage_list:
 
 attributes: attribute_list { $1 }
 
-attributes_storage: attribute_storage_list { $1 }
 
 
 /*(* gccext:  which allow a trailing ',' in enum, as in perl *)*/
index 866463b..50d769a 100644 (file)
 open Common
 
 module TH = Token_helpers 
+module TV = Token_views_c
 module LP = Lexer_parser
 
 module Stat = Parsing_stat
 
 open Parser_c 
 
+open TV 
+
 (*****************************************************************************)
 (* Some debugging functions  *)
 (*****************************************************************************)
 
-let pr2 s = 
-  if !Flag_parsing_c.verbose_parsing 
-  then Common.pr2 s
-
-let pr2_once s = 
-  if !Flag_parsing_c.verbose_parsing 
-  then Common.pr2_once s
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_parsing
 
 let pr2_cpp s = 
   if !Flag_parsing_c.debug_cpp
@@ -220,6 +217,10 @@ let msg_ifdef_funheaders () =
   incr Stat.nIfdefFunheader;
   ()
 
+let msg_ifdef_cparen_else () = 
+  incr Stat.nIfdefPassing;
+  pr2_cpp("found ifdef-cparen-else")
+
 
 let msg_attribute s = 
   incr Stat.nMacroAttribute;
@@ -262,555 +263,12 @@ let not_annot s =
   not (s ==~ regexp_annot)
 
 
-(* ------------------------------------------------------------------------- *)
-(* cpp part 1 for standard.h *)
-(* ------------------------------------------------------------------------- *)
-
-type define_def = string * define_param * define_body 
- and define_param = 
-   | NoParam
-   | Params of string list
- and define_body = 
-   | DefineBody of Parser_c.token list
-   | DefineHint of parsinghack_hint
-
-   and parsinghack_hint = 
-     | HintIterator
-     | HintDeclarator
-     | HintMacroString
-     | HintMacroStatement
-     | HintAttribute
-     | HintMacroIdentBuilder
-
-
-(* cf also data/test.h *)
-let assoc_hint_string = [
-  "YACFE_ITERATOR"   , HintIterator;
-  "YACFE_DECLARATOR" , HintDeclarator;
-  "YACFE_STRING"     , HintMacroString;
-  "YACFE_STATEMENT"  , HintMacroStatement;
-  "YACFE_ATTRIBUTE"  , HintAttribute;
-  "YACFE_IDENT_BUILDER"  , HintMacroIdentBuilder;
-
-  "MACROSTATEMENT"   , HintMacroStatement; (* backward compatibility *)
-]
-
-
-let (parsinghack_hint_of_string: string -> parsinghack_hint option) = fun s -> 
-  Common.assoc_option s assoc_hint_string
-
-let (is_parsinghack_hint: string -> bool) = fun s -> 
-  parsinghack_hint_of_string s <> None
-
-let (token_from_parsinghack_hint: 
-     (string * Ast_c.info) -> parsinghack_hint -> Parser_c.token) = 
- fun (s,ii) hint ->
-   match hint with
-   | HintIterator -> 
-       Parser_c.TMacroIterator (s, ii)
-   | HintDeclarator -> 
-       Parser_c.TMacroDecl (s, ii)
-   | HintMacroString -> 
-       Parser_c.TMacroString (s, ii)
-   | HintMacroStatement -> 
-       Parser_c.TMacroStmt (s, ii)
-   | HintAttribute -> 
-       Parser_c.TMacroAttr (s, ii)
-   | HintMacroIdentBuilder -> 
-       Parser_c.TMacroIdentBuilder (s, ii)
-  
-
-
-let (_defs : (string, define_def) Hashtbl.t ref)  = 
-  ref (Hashtbl.create 101)
-
-
-(* ------------------------------------------------------------------------- *)
-(* fuzzy parsing, different "views" over the same program *)
-(* ------------------------------------------------------------------------- *)
-
-
-(* Normally I should not use ref/mutable in the token_extended type
- * and I should have a set of functions taking a list of tokens and
- * returning a list of tokens. The problem is that to make easier some
- * functions, it is better to work on better representation, on "views"
- * over this list of tokens. But then modifying those views and get
- * back from those views to the original simple list of tokens is
- * tedious. One way is to maintain next to the view a list of "actions"
- * (I was using a hash storing the charpos of the token and associating
- * the action) but it is tedious too. Simpler to use mutable/ref. We
- * use the same idea that we use when working on the Ast_c. *)
-
-(* old: when I was using the list of "actions" next to the views, the hash
- * indexed by the charpos, there could have been some problems:
- * how my fake_pos interact with the way I tag and adjust token ?
- * because I base my tagging on the position of the token ! so sometimes
- * could tag another fakeInfo that should not be tagged ? 
- * fortunately I don't use anymore this technique.
- *)
-
-(* update: quite close to the Place_c.Inxxx *)
-type context = 
-  InFunction | InEnum | InStruct | InInitializer | NoContext
-
-type token_extended = { 
-  mutable tok: Parser_c.token;
-  mutable where: context;
-
-  (* less: need also a after ? *)
-  mutable new_tokens_before : Parser_c.token list;
-
-  (* line x col  cache, more easily accessible, of the info in the token *)
-  line: int; 
-  col : int;
-}
-
-let set_as_comment cppkind x = 
-  if TH.is_eof x.tok 
-  then () (* otherwise parse_c will be lost if don't find a EOF token *)
-  else 
-    x.tok <- TCommentCpp (cppkind, TH.info_of_tok x.tok)
-
-let mk_token_extended x = 
-  let (line, col) = TH.linecol_of_tok x in
-  { tok = x; 
-    line = line; col = col; 
-    where = NoContext; 
-    new_tokens_before = [];
-  }
-
-
-(* x list list, because x list separated by ',' *) 
-type paren_grouped = 
-  | Parenthised   of paren_grouped list list * token_extended list
-  | PToken of token_extended
-
-type brace_grouped = 
-  | Braceised   of 
-      brace_grouped list list * token_extended * token_extended option
-  | BToken of token_extended
-
-(* Far better data structure than doing hacks in the lexer or parser
- * because in lexer we don't know to which ifdef a endif is related
- * and so when we want to comment a ifdef, we don't know which endif
- * we must also comment. Especially true for the #if 0 which sometimes
- * have a #else part.
- * 
- * x list list, because x list separated by #else or #elif 
- *) 
-type ifdef_grouped = 
-  | Ifdef     of ifdef_grouped list list * token_extended list
-  | Ifdefbool of bool * ifdef_grouped list list * token_extended list
-  | NotIfdefLine of token_extended list
-
-
-type 'a line_grouped = 
-  Line of 'a list
-
-
-type body_function_grouped = 
-  | BodyFunction of token_extended list
-  | NotBodyLine  of token_extended list
-
-
-(* ------------------------------------------------------------------------- *)
-(* view builders  *)
-(* ------------------------------------------------------------------------- *)
-
-(* todo: synchro ! use more indentation 
- * if paren not closed and same indentation level, certainly because
- * part of a mid-ifdef-expression.
-*)
-let rec mk_parenthised xs = 
-  match xs with
-  | [] -> []
-  | x::xs -> 
-      (match x.tok with 
-      | TOPar _ | TOParDefine _ -> 
-          let body, extras, xs = mk_parameters [x] [] xs in
-          Parenthised (body,extras)::mk_parenthised xs
-      | _ -> 
-          PToken x::mk_parenthised xs
-      )
-
-(* return the body of the parenthised expression and the rest of the tokens *)
-and mk_parameters extras acc_before_sep  xs = 
-  match xs with
-  | [] -> 
-      (* maybe because of #ifdef which "opens" '(' in 2 branches *)
-      pr2 "PB: not found closing paren in fuzzy parsing";
-      [List.rev acc_before_sep], List.rev extras, []
-  | x::xs -> 
-      (match x.tok with 
-      (* synchro *)
-      | TOBrace _ when x.col =|= 0 -> 
-          pr2 "PB: found synchro point } in paren";
-          [List.rev acc_before_sep], List.rev (extras), (x::xs)
-
-      | TCPar _ | TCParEOL _ -> 
-          [List.rev acc_before_sep], List.rev (x::extras), xs
-      | TOPar _ | TOParDefine _ -> 
-          let body, extrasnest, xs = mk_parameters [x] [] xs in
-          mk_parameters extras 
-            (Parenthised (body,extrasnest)::acc_before_sep) 
-            xs
-      | TComma _ -> 
-          let body, extras, xs = mk_parameters (x::extras) [] xs in
-          (List.rev acc_before_sep)::body, extras, xs 
-      | _ -> 
-          mk_parameters extras (PToken x::acc_before_sep) xs
-      )
-
-
-
-
-let rec mk_braceised xs = 
-  match xs with
-  | [] -> []
-  | x::xs -> 
-      (match x.tok with 
-      | TOBrace _ -> 
-          let body, endbrace, xs = mk_braceised_aux [] xs in
-          Braceised (body, x, endbrace)::mk_braceised xs
-      | TCBrace _ -> 
-          pr2 "PB: found closing brace alone in fuzzy parsing";
-          BToken x::mk_braceised xs
-      | _ -> 
-          BToken x::mk_braceised xs
-      )
-
-(* return the body of the parenthised expression and the rest of the tokens *)
-and mk_braceised_aux acc xs = 
-  match xs with
-  | [] -> 
-      (* maybe because of #ifdef which "opens" '(' in 2 branches *)
-      pr2 "PB: not found closing brace in fuzzy parsing";
-      [List.rev acc], None, []
-  | x::xs -> 
-      (match x.tok with 
-      | TCBrace _ -> [List.rev acc], Some x, xs
-      | TOBrace _ -> 
-          let body, endbrace, xs = mk_braceised_aux [] xs in
-          mk_braceised_aux  (Braceised (body,x, endbrace)::acc) xs
-      | _ -> 
-          mk_braceised_aux (BToken x::acc) xs
-      )
-
-          
-
-
-let rec mk_ifdef xs = 
-  match xs with
-  | [] -> []
-  | x::xs -> 
-      (match x.tok with 
-      | TIfdef _ -> 
-          let body, extra, xs = mk_ifdef_parameters [x] [] xs in
-          Ifdef (body, extra)::mk_ifdef xs
-      | TIfdefBool (b,_, _) -> 
-          let body, extra, xs = mk_ifdef_parameters [x] [] xs in
-          
-          (* if not passing, then consider a #if 0 as an ordinary #ifdef *)
-          if !Flag_parsing_c.if0_passing
-          then Ifdefbool (b, body, extra)::mk_ifdef xs
-          else Ifdef(body, extra)::mk_ifdef xs
-
-      | TIfdefMisc (b,_,_) | TIfdefVersion (b,_,_) -> 
-          let body, extra, xs = mk_ifdef_parameters [x] [] xs in
-          Ifdefbool (b, body, extra)::mk_ifdef xs
-
-          
-      | _ -> 
-          (* todo? can have some Ifdef in the line ? *)
-          let line, xs = Common.span (fun y -> y.line =|= x.line) (x::xs) in
-          NotIfdefLine line::mk_ifdef xs 
-      )
-
-and mk_ifdef_parameters extras acc_before_sep xs = 
-  match xs with
-  | [] -> 
-      (* Note that mk_ifdef is assuming that CPP instruction are alone
-       * on their line. Because I do a span (fun x -> is_same_line ...)
-       * I might take with me a #endif if this one is mixed on a line
-       * with some "normal" tokens.
-       *)
-      pr2 "PB: not found closing ifdef in fuzzy parsing";
-      [List.rev acc_before_sep], List.rev extras, []
-  | x::xs -> 
-      (match x.tok with 
-      | TEndif _ -> 
-          [List.rev acc_before_sep], List.rev (x::extras), xs
-      | TIfdef _ -> 
-          let body, extrasnest, xs = mk_ifdef_parameters [x] [] xs in
-          mk_ifdef_parameters 
-            extras (Ifdef (body, extrasnest)::acc_before_sep) xs
-
-      | TIfdefBool (b,_,_) -> 
-          let body, extrasnest, xs = mk_ifdef_parameters [x] [] xs in
-
-          if !Flag_parsing_c.if0_passing
-          then
-            mk_ifdef_parameters 
-              extras (Ifdefbool (b, body, extrasnest)::acc_before_sep) xs
-          else 
-            mk_ifdef_parameters 
-              extras (Ifdef (body, extrasnest)::acc_before_sep) xs
-
-
-      | TIfdefMisc (b,_,_) | TIfdefVersion (b,_,_) -> 
-          let body, extrasnest, xs = mk_ifdef_parameters [x] [] xs in
-          mk_ifdef_parameters 
-            extras (Ifdefbool (b, body, extrasnest)::acc_before_sep) xs
-
-      | TIfdefelse _ 
-      | TIfdefelif _ -> 
-          let body, extras, xs = mk_ifdef_parameters (x::extras) [] xs in
-          (List.rev acc_before_sep)::body, extras, xs 
-      | _ -> 
-          let line, xs = Common.span (fun y -> y.line =|= x.line) (x::xs) in
-          mk_ifdef_parameters extras (NotIfdefLine line::acc_before_sep) xs
-      )
-
-(* --------------------------------------- *)
-
-let line_of_paren = function
-  | PToken x -> x.line
-  | Parenthised (xxs, info_parens) -> 
-      (match info_parens with
-      | [] -> raise Impossible
-      | x::xs -> x.line
-      )
-
-
-let rec span_line_paren line = function
-  | [] -> [],[]
-  | x::xs -> 
-      (match x with
-      | PToken tok when TH.is_eof tok.tok -> 
-          [], x::xs
-      | _ -> 
-        if line_of_paren x =|= line 
-        then
-          let (l1, l2) = span_line_paren line xs in
-          (x::l1, l2)
-        else ([], x::xs)
-      )
-        
-
-let rec mk_line_parenthised xs = 
-  match xs with
-  | [] -> []
-  | x::xs -> 
-      let line_no = line_of_paren x in
-      let line, xs = span_line_paren line_no xs in
-      Line (x::line)::mk_line_parenthised xs
-
-
-(* --------------------------------------- *)
-let rec mk_body_function_grouped xs = 
-  match xs with 
-  | [] -> []
-  | x::xs -> 
-      (match x with
-      | {tok = TOBrace _; col = 0} -> 
-          let is_closing_brace = function 
-            | {tok = TCBrace _; col = 0 } -> true 
-            | _ -> false 
-          in
-          let body, xs = Common.span (fun x -> not (is_closing_brace x)) xs in
-          (match xs with
-          | ({tok = TCBrace _; col = 0 })::xs -> 
-              BodyFunction body::mk_body_function_grouped xs
-          | [] -> 
-              pr2 "PB:not found closing brace in fuzzy parsing";
-              [NotBodyLine body]
-          | _ -> raise Impossible
-          )
-          
-      | _ -> 
-          let line, xs = Common.span (fun y -> y.line =|= x.line) (x::xs) in
-          NotBodyLine line::mk_body_function_grouped xs 
-      )
-
-
-(* ------------------------------------------------------------------------- *)
-(* view iterators  *)
-(* ------------------------------------------------------------------------- *)
-
-let rec iter_token_paren f xs = 
-  xs +> List.iter (function
-  | PToken tok -> f tok;
-  | Parenthised (xxs, info_parens) -> 
-      info_parens +> List.iter f;
-      xxs +> List.iter (fun xs -> iter_token_paren f xs)
-  )
-
-let rec iter_token_brace f xs = 
-  xs +> List.iter (function
-  | BToken tok -> f tok;
-  | Braceised (xxs, tok1, tok2opt) -> 
-      f tok1; do_option f tok2opt;
-      xxs +> List.iter (fun xs -> iter_token_brace f xs)
-  )
-
-let rec iter_token_ifdef f xs = 
-  xs +> List.iter (function
-  | NotIfdefLine xs -> xs +> List.iter f;
-  | Ifdefbool (_, xxs, info_ifdef) 
-  | Ifdef (xxs, info_ifdef) -> 
-      info_ifdef +> List.iter f;
-      xxs +> List.iter (iter_token_ifdef f)
-  )
-
-
-
-
-let tokens_of_paren xs = 
-  let g = ref [] in
-  xs +> iter_token_paren (fun tok -> push2 tok g);
-  List.rev !g
-
-
-let tokens_of_paren_ordered xs = 
-  let g = ref [] in
-
-  let rec aux_tokens_ordered = function
-    | PToken tok -> push2 tok g;
-    | Parenthised (xxs, info_parens) -> 
-        let (opar, cpar, commas) = 
-          match info_parens with
-          | opar::xs -> 
-              (match List.rev xs with
-              | cpar::xs -> 
-                  opar, cpar, List.rev xs
-              | _ -> raise Impossible
-              )
-          | _ -> raise Impossible
-        in
-        push2 opar g;
-        aux_args (xxs,commas);
-        push2 cpar g;
-
-  and aux_args (xxs, commas) =
-    match xxs, commas with
-    | [], [] -> ()
-    | [xs], [] -> xs +> List.iter aux_tokens_ordered
-    | xs::ys::xxs, comma::commas -> 
-        xs +> List.iter aux_tokens_ordered;
-        push2 comma g;
-        aux_args (ys::xxs, commas)
-    | _ -> raise Impossible
-
-  in
-
-  xs +> List.iter aux_tokens_ordered;
-  List.rev !g
-
-
-
-
-(* ------------------------------------------------------------------------- *)
-(* set the context info in token *)
-(* ------------------------------------------------------------------------- *)
-
-
-let rec set_in_function_tag xs = 
- (* could try: ) { } but it can be the ) of a if or while, so 
-  * better to base the heuristic on the position in column zero.
-  * Note that some struct or enum or init put also their { in first column
-  * but set_in_other will overwrite the previous InFunction tag.
-  *)
-  match xs with
-  | [] -> ()
-  (* ) { and the closing } is in column zero, then certainly a function *)
-  | BToken ({tok = TCPar _ })::(Braceised (body, tok1, Some tok2))::xs 
-      when tok1.col <> 0 && tok2.col =|= 0 -> 
-      body +> List.iter (iter_token_brace (fun tok -> 
-        tok.where <- InFunction
-      ));
-      set_in_function_tag xs
-
-  | (BToken x)::xs -> set_in_function_tag xs
 
-  | (Braceised (body, tok1, Some tok2))::xs 
-      when tok1.col =|= 0 && tok2.col =|= 0 -> 
-      body +> List.iter (iter_token_brace (fun tok -> 
-        tok.where <- InFunction
-      ));
-      set_in_function_tag xs
-  | Braceised (body, tok1, tok2)::xs -> 
-      set_in_function_tag xs
-  
-
-let rec set_in_other xs = 
-  match xs with 
-  | [] -> ()
-  (* enum x { } *)
-  | BToken ({tok = Tenum _})::BToken ({tok = TIdent _})
-    ::Braceised(body, tok1, tok2)::xs 
-  | BToken ({tok = Tenum _})
-    ::Braceised(body, tok1, tok2)::xs 
-    -> 
-      body +> List.iter (iter_token_brace (fun tok -> 
-        tok.where <- InEnum;
-      ));
-      set_in_other xs
-
-  (* struct x { } *)
-  | BToken ({tok = Tstruct _})::BToken ({tok = TIdent _})
-    ::Braceised(body, tok1, tok2)::xs -> 
-      body +> List.iter (iter_token_brace (fun tok -> 
-        tok.where <- InStruct;
-      ));
-      set_in_other xs
-  (* = { } *)
-  | BToken ({tok = TEq _})
-    ::Braceised(body, tok1, tok2)::xs -> 
-      body +> List.iter (iter_token_brace (fun tok -> 
-        tok.where <- InInitializer;
-      ));
-      set_in_other xs
-
-  | BToken _::xs -> set_in_other xs
-
-  | Braceised(body, tok1, tok2)::xs -> 
-      body +> List.iter set_in_other;
-      set_in_other xs
-
-      
-      
-
-let set_context_tag xs = 
-  begin
-    set_in_function_tag xs;
-    set_in_other xs;
-  end
-  
 
 (*****************************************************************************)
 (* Helpers *)
 (*****************************************************************************)
 
-(* To expand the parameter of the macro. The env corresponds to the actual
- * code that is binded to the parameters of the macro.
- * TODO? recurse ? fixpoint ? the expansion may also contain macro.
- * Or to macro expansion in a strict manner, that is process first
- * the parameters, expands macro in params, and then process enclosing
- * macro call.
- *)
-let rec (cpp_engine: (string , Parser_c.token list) assoc -> 
-          Parser_c.token list -> Parser_c.token list) = 
- fun env xs ->
-  xs +> List.map (fun tok -> 
-    match tok with
-    | TIdent (s,i1) when List.mem_assoc s env -> Common.assoc s env
-    | x -> [x]
-  )
-  +> List.flatten
-
-
-
-
 (* ------------------------------------------------------------------------- *)
 (* the pair is the status of '()' and '{}', ex: (-1,0) 
  * if too much ')' and good '{}' 
@@ -818,10 +276,10 @@ let rec (cpp_engine: (string , Parser_c.token list) assoc ->
  * could do for ','   if encounter ',' at "toplevel", not inside () or {}
  * then if have ifdef, then certainly can lead to a problem.
  *)
-let (count_open_close_stuff_ifdef_clause: ifdef_grouped list -> (int * int)) = 
+let (count_open_close_stuff_ifdef_clause: TV.ifdef_grouped list -> (int * int))=
  fun xs -> 
    let cnt_paren, cnt_brace = ref 0, ref 0 in
-   xs +> iter_token_ifdef (fun x -> 
+   xs +> TV.iter_token_ifdef (fun x -> 
      (match x.tok with
      | x when TH.is_opar x  -> incr cnt_paren
      | TOBrace _ -> incr cnt_brace
@@ -1121,171 +579,61 @@ let rec adjust_inifdef_include xs =
 
 
 
-(* ------------------------------------------------------------------------- *)
-(* cpp-builtin part2, macro, using standard.h or other defs *)
-(* ------------------------------------------------------------------------- *)
-
-(* Thanks to this function many stuff are not anymore hardcoded in ocaml code
- * (but they are now hardcoded in standard.h ...)
- *
- * 
- * 
- * No need to take care to not substitute the macro name itself
- * that occurs in the macro definition because the macro name is
- * after fix_token_define a TDefineIdent, no more a TIdent.
- *)
-
-let rec apply_macro_defs xs = 
-  match xs with
-  | [] -> ()
 
-  (* old: "but could do more, could reuse same original token
-   * so that have in the Ast a Dbg, not a MACROSTATEMENT"
-   * 
-   *   | PToken ({tok = TIdent (s,i1)} as id)::xs 
-   *     when s = "MACROSTATEMENT" -> 
-   * 
-   *     msg_macro_statement_hint s;
-   *     id.tok <- TMacroStmt(TH.info_of_tok id.tok);
-   *     find_macro_paren xs
-   * 
-   *  let msg_macro_statement_hint s = 
-   *    incr Stat.nMacroHint;
-   *   ()
-   * 
-   *)
 
-  (* recognized macro of standard.h (or other) *)
-  | PToken ({tok = TIdent (s,i1)} as id)::Parenthised (xxs,info_parens)::xs 
-      when Hashtbl.mem !_defs s -> 
-      
-      msg_apply_known_macro s;
-      let (s, params, body) = Hashtbl.find !_defs s in
-
-      (match params with
-      | NoParam -> 
-          pr2 ("WEIRD: macro without param used before parenthize: " ^ s);
-          (* ex: PRINTP("NCR53C400 card%s detected\n" ANDP(((struct ... *)
-
-          (match body with
-          | DefineBody bodymacro -> 
-              set_as_comment (Token_c.CppMacro) id;
-              id.new_tokens_before <- bodymacro;
-          | DefineHint hint -> 
-              msg_apply_known_macro_hint s;
-              id.tok <- token_from_parsinghack_hint (s,i1) hint;
-          )
-      | Params params -> 
-          (match body with
-          | DefineBody bodymacro -> 
-
-              (* bugfix: better to put this that before the match body, 
-               * cos our macrostatement hint can have variable number of
-               * arguments and so it's ok if it does not match exactly
-               * the number of arguments. *)
-              if List.length params != List.length xxs
-              then begin 
-                pr2_once ("WEIRD: macro with wrong number of arguments: " ^ s);
-                (* old: id.new_tokens_before <- bodymacro; *)
-                ()
-              end
-              else 
-
-                let xxs' = xxs +> List.map (fun x -> 
-                  (tokens_of_paren_ordered x) +> List.map (fun x -> 
-                    TH.visitor_info_of_tok Ast_c.make_expanded x.tok
-                  )
-                ) in
-                id.new_tokens_before <-
-                  cpp_engine (Common.zip params xxs') bodymacro;
-
-                (* important to do that after have apply the macro, otherwise
-                 * will pass as argument to the macro some tokens that
-                 * are all TCommentCpp
-                 *)
-                [Parenthised (xxs, info_parens)] +> 
-                  iter_token_paren (set_as_comment Token_c.CppMacro);
-                set_as_comment Token_c.CppMacro id;
-
-            | DefineHint (HintMacroStatement as hint) -> 
-                (* important to do that after have apply the macro, otherwise
-                 * will pass as argument to the macro some tokens that
-                 * are all TCommentCpp
-                 * 
-                 * note: such macrostatement can have a variable number of
-                 * arguments but here we don't care, we just pass all the
-                 * parameters.
-                 *)
-
-                (match xs with
-                | PToken ({tok = TPtVirg _} as id2)::_ -> 
-                    pr2_once 
-                      ("macro stmt with trailing ';', passing also ';' for: "^
-                       s);
-                    (* sometimes still want pass its params ... as in
-                     *  DEBUGPOLL(static unsigned int prev_mask = 0);
-                     *)
-
-                    msg_apply_known_macro_hint s;
-                    id.tok <- token_from_parsinghack_hint (s,i1) hint;
-                    [Parenthised (xxs, info_parens)] +> 
-                      iter_token_paren (set_as_comment Token_c.CppMacro);
-                    set_as_comment Token_c.CppMacro id2;
-
-                | _ ->
-                    msg_apply_known_macro_hint s;
-                    id.tok <- token_from_parsinghack_hint (s,i1) hint;
-                    [Parenthised (xxs, info_parens)] +> 
-                      iter_token_paren (set_as_comment Token_c.CppMacro);
-                )
-                
-
-            | DefineHint hint -> 
-                msg_apply_known_macro_hint s;
-                id.tok <- token_from_parsinghack_hint (s,i1) hint;
-            )
-      );
-      apply_macro_defs xs
-
-  | PToken ({tok = TIdent (s,i1)} as id)::xs 
-      when Hashtbl.mem !_defs s -> 
-
-      msg_apply_known_macro s;
-      let (_s, params, body) = Hashtbl.find !_defs s in
-
-      (match params with
-      | Params params -> 
-          pr2 ("WEIRD: macro with params but no parens found: " ^ s);
-          (* dont apply the macro, perhaps a redefinition *)
-          ()
-      | NoParam -> 
-          (match body with
-          | DefineBody [newtok] -> 
-             (* special case when 1-1 substitution, we reuse the token *)
-              id.tok <- (newtok +> TH.visitor_info_of_tok (fun _ -> 
-                TH.info_of_tok id.tok))
-          | DefineBody bodymacro -> 
-              set_as_comment Token_c.CppMacro id;
-              id.new_tokens_before <- bodymacro;
-          | DefineHint hint -> 
-                msg_apply_known_macro_hint s;
-                id.tok <- token_from_parsinghack_hint (s,i1) hint;
-          )
-      );
-      apply_macro_defs xs
 
 
+let rec find_ifdef_cparen_else xs = 
+  let rec aux xs = 
+  xs +> List.iter (function 
+  | NotIfdefLine _ -> ()
+  | Ifdef (xxs, info_ifdef_stmt) -> 
+      (match xxs with 
+      | [] -> raise Impossible
+      | [first] -> ()
+      | first::second::rest -> 
 
+         (* found a closing ')' just after the #else *)
 
-  (* recurse *)
-  | (PToken x)::xs -> apply_macro_defs xs 
-  | (Parenthised (xxs, info_parens))::xs -> 
-      xxs +> List.iter apply_macro_defs;
-      apply_macro_defs xs
+          (* Too bad ocaml does not support better list pattern matching
+           * a la Prolog-III where can match the end of lists.
+           *)
+          let condition = 
+            if List.length first = 0 then false 
+            else 
+              let last_line = Common.last first in
+              match last_line with
+              | NotIfdefLine xs -> 
+                  if List.length xs = 0 then false 
+                  else 
+                    let last_tok = Common.last xs in
+                    TH.is_cpar last_tok.tok
+              | Ifdef _ | Ifdefbool _ -> false 
+          in
+          if condition then begin
+            msg_ifdef_cparen_else();
 
+            (* keep only first, treat the rest as comment *)
+            info_ifdef_stmt +> List.iter (set_as_comment Token_c.CppDirective);
+            (second::rest) +> List.iter 
+              (iter_token_ifdef (set_as_comment Token_c.CppPassingCosWouldGetError));
+          end
+              
+      );
+      List.iter aux xxs
+        
+  (* no need complex analysis for ifdefbool *)
+  | Ifdefbool (_, xxs, info_ifdef_stmt) -> 
+      List.iter aux xxs
+  )
+  in aux xs
 
 
+(* ------------------------------------------------------------------------- *)
+(* cpp-builtin part2, macro, using standard.h or other defs *)
+(* ------------------------------------------------------------------------- *)
 
+(* now in cpp_token_c.ml *) 
 
 (* ------------------------------------------------------------------------- *)
 (* stringification *)
@@ -1338,24 +686,34 @@ let rec find_macro_paren xs =
       find_macro_paren xs
 
 (*
-  (* attribute cpp, __xxx id() *)
+  (* attribute cpp, __xxx id *)
   | PToken ({tok = TIdent (s,i1)} as id)
-    ::PToken ({tok = TIdent (s2, i2)})
-    ::Parenthised(xxs,info_parens)
+    ::PToken ({tok = TIdent (s2, i2)} as id2)
     ::xs when s ==~ regexp_annot
      -> 
       msg_attribute s;
       id.tok <- TMacroAttr (s, i1);
-      find_macro_paren (Parenthised(xxs,info_parens)::xs)
+      find_macro_paren ((PToken id2)::xs); (* recurse also on id2 ? *)
 
-  (* attribute cpp, id __xxx =  *)
-  | PToken ({tok = TIdent (s,i1)})
-    ::PToken ({tok = TIdent (s2, i2)} as id)
-    ::xs when s2 ==~ regexp_annot
+  (* attribute cpp, id __xxx *)
+  | PToken ({tok = TIdent (s,i1)} as _id)
+    ::PToken ({tok = TIdent (s2, i2)} as id2)
+    ::xs when s2 ==~ regexp_annot && (not (s ==~ regexp_typedef))
      -> 
       msg_attribute s2;
-      id.tok <- TMacroAttr (s2, i2);
-      find_macro_paren (xs)
+      id2.tok <- TMacroAttr (s2, i2);
+      find_macro_paren xs
+
+  | PToken ({tok = (Tstatic _ | Textern _)} as tok1)
+    ::PToken ({tok = TIdent (s,i1)} as attr)
+    ::xs when s ==~ regexp_annot
+    -> 
+      pr2_cpp ("storage attribute: " ^ s);
+      attr.tok <- TMacroAttrStorage (s,i1);
+      (* recurse, may have other storage attributes *)
+      find_macro_paren (PToken (tok1)::xs)
+      
+
 *)
 
   (* storage attribute *)
@@ -1366,7 +724,7 @@ let rec find_macro_paren xs =
       attr.tok <- TMacroAttrStorage (s,i1);
       (* recurse, may have other storage attributes *)
       find_macro_paren (PToken (tok1)::xs)
-      
+
 
   (* stringification
    * 
@@ -1791,6 +1149,13 @@ let rec find_define_init_brace_paren xs =
 (* action *)
 (* ------------------------------------------------------------------------- *)
 
+(* obsolete now with macro expansion ? get some regression if comment.
+ * todo: if do bad decision here, then it can influence other phases 
+ * and make it hard to parse. So maybe when have a parse error, should
+ * undo some of the guess those heuristics have done, and restore 
+ * the original token value.
+ *)
+
 let rec find_actions = function
   | [] -> ()
 
@@ -1809,17 +1174,26 @@ let rec find_actions = function
 and find_actions_params xxs = 
   xxs +> List.fold_left (fun acc xs -> 
     let toks = tokens_of_paren xs in
-    if toks +> List.exists (fun x -> TH.is_statement x.tok)
+    if toks +> List.exists (fun x -> TH.is_statement x.tok) 
+      (* undo:  && List.length toks > 1 
+       * good for sparse, not good for linux
+       *)
     then begin
       xs +> iter_token_paren (fun x -> 
         if TH.is_eof x.tok
         then 
           (* certainly because paren detection had a pb because of
-           * some ifdef-exp
+           * some ifdef-exp. Do similar additional checking than
+           * what is done in set_as_comment.
            *)
-          pr2 "PB: weird, I try to tag an EOF token as action"
+          pr2 "PB: weird, I try to tag an EOF token as an action"
         else 
-          x.tok <- TAction (TH.info_of_tok x.tok);
+          (* cf tests-bis/no_cpar_macro.c *)
+          if TH.is_eom x.tok 
+          then 
+            pr2 "PB: weird, I try to tag an EOM token as an action"
+          else 
+            x.tok <- TAction (TH.info_of_tok x.tok);
       );
       true (* modified *)
     end
@@ -1832,15 +1206,6 @@ and find_actions_params xxs =
 (* main fix cpp function *)
 (* ------------------------------------------------------------------------- *)
 
-let rebuild_tokens_extented toks_ext = 
-  let _tokens = ref [] in
-  toks_ext +> List.iter (fun tok -> 
-    tok.new_tokens_before +> List.iter (fun x -> push2 x _tokens);
-    push2 tok.tok _tokens 
-  );
-  let tokens = List.rev !_tokens in
-  (tokens +> acc_map mk_token_extended)
-
 let filter_cpp_stuff xs = 
   let rec aux xs = 
     match xs with
@@ -1863,8 +1228,8 @@ let filter_cpp_stuff xs =
 
 let insert_virtual_positions l =
   let strlen x = String.length (Ast_c.str_of_info x) in
-  let rec loop prev offset = function
-      [] -> []
+  let rec loop prev offset acc = function
+      [] -> List.rev acc
     | x::xs ->
        let ii = TH.info_of_tok x in
        let inject pi =
@@ -1872,28 +1237,30 @@ let insert_virtual_positions l =
        match Ast_c.pinfo_of_info ii with
          Ast_c.OriginTok pi ->
            let prev = Ast_c.parse_info_of_info ii in
-           x::(loop prev (strlen ii) xs)
+           loop prev (strlen ii) (x::acc) xs 
        | Ast_c.ExpandedTok (pi,_) ->
-           inject (Ast_c.ExpandedTok (pi,(prev,offset))) ::
-           (loop prev (offset + (strlen ii)) xs)
+            let x' = inject (Ast_c.ExpandedTok (pi,(prev,offset))) in
+           loop prev (offset + (strlen ii)) (x'::acc) xs 
        | Ast_c.FakeTok (s,_) ->
-           inject (Ast_c.FakeTok (s,(prev,offset))) ::
-           (loop prev (offset + (strlen ii)) xs)
+            let x' = inject (Ast_c.FakeTok (s,(prev,offset))) in
+           loop prev (offset + (strlen ii)) (x'::acc) xs 
        | Ast_c.AbstractLineTok _ -> failwith "abstract not expected" in
   let rec skip_fake = function
-      [] -> []
+    | [] -> []
     | x::xs ->
        let ii = TH.info_of_tok x in
        match Ast_c.pinfo_of_info ii with
-         Ast_c.OriginTok pi ->
+       | Ast_c.OriginTok pi ->
            let prev = Ast_c.parse_info_of_info ii in
-           x::(loop prev (strlen ii) xs)
+            let res = loop prev (strlen ii) [] xs  in
+            x::res
        | _ -> x::skip_fake xs in
-  skip_fake l
+  skip_fake l 
+
 
 (* ------------------------------------------------------------------------- *)
-let fix_tokens_cpp2 tokens = 
-  let tokens2 = ref (tokens +> acc_map mk_token_extended) in
+let fix_tokens_cpp2 ~macro_defs tokens = 
+  let tokens2 = ref (tokens +> Common.acc_map TV.mk_token_extended) in
   
   begin 
     (* the order is important, if you put the action heuristic first,
@@ -1916,22 +1283,29 @@ let fix_tokens_cpp2 tokens =
        * commentize_skip_start_to_end *)
       not (TH.is_comment x.tok) (* could filter also #define/#include *)
     ) in
-    let ifdef_grouped = mk_ifdef cleaner in
+    let ifdef_grouped = TV.mk_ifdef cleaner in
     set_ifdef_parenthize_info ifdef_grouped;
 
     find_ifdef_funheaders ifdef_grouped;
     find_ifdef_bool       ifdef_grouped;
     find_ifdef_mid        ifdef_grouped;
+    (* change order ? maybe cparen_else heuristic make some of the funheaders 
+     * heuristics irrelevant ?
+     *)
+    find_ifdef_cparen_else        ifdef_grouped; 
     adjust_inifdef_include ifdef_grouped;
 
 
     (* macro 1 *)
     let cleaner = !tokens2 +> filter_cpp_stuff in
 
-    let paren_grouped = mk_parenthised  cleaner in
-    apply_macro_defs paren_grouped;
+    let paren_grouped = TV.mk_parenthised  cleaner in
+    Cpp_token_c.apply_macro_defs
+      ~msg_apply_known_macro 
+      ~msg_apply_known_macro_hint 
+      macro_defs paren_grouped;
     (* because the before field is used by apply_macro_defs *)
-    tokens2 := rebuild_tokens_extented !tokens2; 
+    tokens2 := TV.rebuild_tokens_extented !tokens2; 
 
     (* tagging contextual info (InFunc, InStruct, etc). Better to do
      * that after the "ifdef-simplification" phase.
@@ -1940,7 +1314,7 @@ let fix_tokens_cpp2 tokens =
       not (TH.is_comment x.tok) (* could filter also #define/#include *)
     ) in
 
-    let brace_grouped = mk_braceised cleaner in
+    let brace_grouped = TV.mk_braceised cleaner in
     set_context_tag   brace_grouped;
 
 
@@ -1948,199 +1322,37 @@ let fix_tokens_cpp2 tokens =
     (* macro *)
     let cleaner = !tokens2 +> filter_cpp_stuff in
 
-    let paren_grouped      = mk_parenthised  cleaner in
-    let line_paren_grouped = mk_line_parenthised paren_grouped in
+    let paren_grouped      = TV.mk_parenthised  cleaner in
+    let line_paren_grouped = TV.mk_line_parenthised paren_grouped in
     find_define_init_brace_paren paren_grouped;
     find_string_macro_paren paren_grouped;
     find_macro_lineparen    line_paren_grouped;
     find_macro_paren        paren_grouped;
 
 
-    (* actions *)
+    (* obsolete: actions ? not yet *)
     let cleaner = !tokens2 +> filter_cpp_stuff in
-    let paren_grouped = mk_parenthised  cleaner in
+    let paren_grouped = TV.mk_parenthised  cleaner in
     find_actions  paren_grouped;
+    
 
 
-    insert_virtual_positions (!tokens2 +> acc_map (fun x -> x.tok))
+    insert_virtual_positions (!tokens2 +> Common.acc_map (fun x -> x.tok))
   end
 
-let time_hack1 a = 
-  Common.profile_code_exclusif "HACK" (fun () -> fix_tokens_cpp2 a)
-
-let fix_tokens_cpp a = 
-  Common.profile_code "C parsing.fix_cpp" (fun () -> time_hack1 a)
-
-
-
+let time_hack1 ~macro_defs a = 
+  Common.profile_code_exclusif "HACK" (fun () -> fix_tokens_cpp2 ~macro_defs a)
 
-(*****************************************************************************)
-(* The #define tricks *)
-(*****************************************************************************)
+let fix_tokens_cpp ~macro_defs a = 
+  Common.profile_code "C parsing.fix_cpp" (fun () -> time_hack1 ~macro_defs a)
 
-(* ugly hack, a better solution perhaps would be to erase TDefEOL 
- * from the Ast and list of tokens in parse_c. 
- * 
- * note: I do a +1 somewhere, it's for the unparsing to correctly sync.
- * 
- * note: can't replace mark_end_define by simply a fakeInfo(). The reason
- * is where is the \n TCommentSpace. Normally there is always a last token
- * to synchronize on, either EOF or the token of the next toplevel.
- * In the case of the #define we got in list of token 
- * [TCommentSpace "\n"; TDefEOL] but if TDefEOL is a fakeinfo then we will
- * not synchronize on it and so we will not print the "\n".
- * A solution would be to put the TDefEOL before the "\n".
- * 
- * todo?: could put a ExpandedTok for that ? 
- *)
-let mark_end_define ii = 
-  let ii' = 
-    { Ast_c.pinfo = Ast_c.OriginTok { (Ast_c.parse_info_of_info ii) with 
-        Common.str = ""; 
-        Common.charpos = Ast_c.pos_of_info ii + 1
-      };
-      cocci_tag = ref Ast_c.emptyAnnot;
-      comments_tag = ref Ast_c.emptyComments;
-    } 
-  in
-  TDefEOL (ii')
 
-(* put the TDefEOL at the good place *)
-let rec define_line_1 acc xs = 
-  match xs with
-  | [] -> List.rev acc
-  | TDefine ii::xs ->
-      let line = Ast_c.line_of_info ii in
-      let acc = (TDefine ii) :: acc in
-      define_line_2 acc line ii xs
-  | TCppEscapedNewline ii::xs ->
-      pr2 "WEIRD: a \\ outside a #define";
-      let acc = (TCommentSpace ii) :: acc in
-      define_line_1 acc xs
-  | x::xs -> define_line_1 (x::acc) xs
-
-and define_line_2 acc line lastinfo xs = 
-  match xs with 
-  | [] -> 
-      (* should not happened, should meet EOF before *)
-      pr2 "PB: WEIRD";   
-      List.rev (mark_end_define lastinfo::acc)
-  | x::xs -> 
-      let line' = TH.line_of_tok x in
-      let info = TH.info_of_tok x in
-
-      (match x with
-      | EOF ii -> 
-         let acc = (mark_end_define lastinfo) :: acc in
-         let acc = (EOF ii) :: acc in
-          define_line_1 acc xs
-      | TCppEscapedNewline ii -> 
-          if (line' <> line) then pr2 "PB: WEIRD: not same line number";
-         let acc = (TCommentSpace ii) :: acc in
-          define_line_2 acc (line+1) info xs
-      | x -> 
-          if line' =|= line
-          then define_line_2 (x::acc) line info xs 
-          else define_line_1 (mark_end_define lastinfo::acc) (x::xs)
-      )
-
-let rec define_ident acc xs = 
-  match xs with
-  | [] -> List.rev acc
-  | TDefine ii::xs -> 
-      let acc = TDefine ii :: acc in
-      (match xs with
-      | TCommentSpace i1::TIdent (s,i2)::TOPar (i3)::xs -> 
-          (* Change also the kind of TIdent to avoid bad interaction
-           * with other parsing_hack tricks. For instant if keep TIdent then
-           * the stringication algo can believe the TIdent is a string-macro.
-           * So simpler to change the kind of the ident too.
-           *)
-          (* if TOParDefine sticked to the ident, then 
-           * it's a macro-function. Change token to avoid ambiguity
-           * between #define foo(x)  and   #define foo   (x)
-           *)
-         let acc = (TCommentSpace i1) :: acc in
-         let acc = (TIdentDefine (s,i2)) :: acc in
-         let acc = (TOParDefine i3) :: acc in
-          define_ident acc xs
-      | TCommentSpace i1::TIdent (s,i2)::xs -> 
-         let acc = (TCommentSpace i1) :: acc in
-         let acc = (TIdentDefine (s,i2)) :: acc in
-          define_ident acc xs
-      | _ -> 
-          pr2 "WEIRD: weird #define body"; 
-          define_ident acc xs
-      )
-  | x::xs ->
-      let acc = x :: acc in
-      define_ident acc xs
-  
-
-
-let fix_tokens_define2 xs = 
-  define_ident [] (define_line_1 [] xs)
-
-let fix_tokens_define a = 
-  Common.profile_code "C parsing.fix_define" (fun () -> fix_tokens_define2 a)
-      
 
 (*****************************************************************************)
 (* for the cpp-builtin, standard.h, part 0 *)
 (*****************************************************************************)
 
-let macro_body_to_maybe_hint body = 
-  match body with
-  | [] -> DefineBody body
-  | [TIdent (s,i1)] -> 
-      (match parsinghack_hint_of_string s with
-      | Some hint -> DefineHint hint
-      | None -> DefineBody body
-      )
-  | xs -> DefineBody body
-
-
-let rec define_parse xs = 
-  match xs with
-  | [] -> []
-  | TDefine i1::TIdentDefine (s,i2)::TOParDefine i3::xs -> 
-      let (tokparams, _, xs) = 
-        xs +> Common.split_when (function TCPar _ -> true | _ -> false) in
-      let (body, _, xs) = 
-        xs +> Common.split_when (function TDefEOL _ -> true | _ -> false) in
-      let params = 
-        tokparams +> Common.map_filter (function
-        | TComma _ -> None
-        | TIdent (s, _) -> Some s
-        | x -> error_cant_have x
-        ) in
-      let body = body +> List.map 
-        (TH.visitor_info_of_tok Ast_c.make_expanded) in
-      let def = (s, (s, Params params, macro_body_to_maybe_hint body)) in
-      def::define_parse xs
-
-  | TDefine i1::TIdentDefine (s,i2)::xs -> 
-      let (body, _, xs) = 
-        xs +> Common.split_when (function TDefEOL _ -> true | _ -> false) in
-      let body = body +> List.map 
-        (TH.visitor_info_of_tok Ast_c.make_expanded) in
-      let def = (s, (s, NoParam, macro_body_to_maybe_hint body)) in
-      def::define_parse xs
-
-  | TDefine i1::_ -> 
-      pr2_gen i1;
-      raise Impossible
-  | x::xs -> define_parse xs 
-      
-
-let extract_cpp_define xs = 
-  let cleaner = xs +> List.filter (fun x -> 
-    not (TH.is_comment x)
-  ) in
-  define_parse cleaner
-  
-
-      
+(* now in cpp_token_c.ml *)
 
 (*****************************************************************************)
 (* Lexing with lookahead *)
@@ -2389,8 +1601,7 @@ let lookahead2 ~pass next before =
       (take_safe 1 !passed_tok <> [Tenum]))
       &&
       !LP._lexer_hint = Some LP.Toplevel -> 
-      msg_typedef s; 
-      LP.add_typedef_root s;
+      msg_typedef s; LP.add_typedef_root s;
       TypedefIdent s
      *)
 
@@ -2531,8 +1742,7 @@ let lookahead2 ~pass next before =
 
         (* can have sizeof on expression
            | (Tsizeof::TOPar::TIdent s::TCPar::_,   _) -> 
-           msg_typedef s; 
-           LP.add_typedef_root s;
+           msg_typedef s; LP.add_typedef_root s;
            Tsizeof
          *)
 
@@ -2570,7 +1780,7 @@ let lookahead2 ~pass next before =
       *)
       (* not !LP._lexer_hint.toplevel *)
       if !Flag_parsing_c.ifdef_directive_passing
-        || (pass =|= 2)
+        || (pass >= 2)
       then begin
         
         if (LP.current_context () =*= LP.InInitializer)
@@ -2578,7 +1788,7 @@ let lookahead2 ~pass next before =
           pr2_cpp "In Initializer passing"; (* cheat: dont count in stat *)
           incr Stat.nIfdefInitializer;
         end else begin 
-          pr2_cpp("IFDEF: or related insde function. I treat it as comment");
+          pr2_cpp("IFDEF: or related inside function. I treat it as comment");
           incr Stat.nIfdefPassing;
         end;
         TCommentCpp (Token_c.CppDirective, ii)
@@ -2587,7 +1797,7 @@ let lookahead2 ~pass next before =
         
   | (TUndef (id, ii) as x)::_, _ 
       -> 
-        if (pass =|= 2)
+        if (pass >= 2)
         then begin
           pr2_cpp("UNDEF: I treat it as comment");
           TCommentCpp (Token_c.CppDirective, ii)
@@ -2596,7 +1806,7 @@ let lookahead2 ~pass next before =
 
   | (TCppDirectiveOther (ii) as x)::_, _ 
       -> 
-        if (pass =|= 2)
+        if (pass >= 2)
         then begin
           pr2_cpp ("OTHER directive: I treat it as comment");
           TCommentCpp (Token_c.CppDirective, ii)
index 7b41698..4689fd0 100644 (file)
@@ -6,8 +6,9 @@ open Common
  * sometimes we do some kind of lalr(k) by finding patterns. Often try to
  * work on better token representation, like ifdef-paren-ized, brace-ized,
  * paren-ized, so can do easier pattern matching to more easily match
- * complex cpp idiom pattern. Also try to get context info such as
- * whether the token is in a initializer as some common patterns have different
+ * complex cpp idiom pattern (cf token_views_c.ml). 
+ * We also try to get more contextual information such as whether the 
+ * token is in a initializer as some common patterns have different
  * use depending on context.
  * 
  * 
@@ -27,49 +28,31 @@ open Common
  * 
  * Cf the TMacroXxx in parser_c.mly and MacroXxx in ast_c.ml
  * 
- * Also try infer typedef.
+ * Also try to infer typedef.
  * 
  * Also do other stuff involving cpp like expanding some macros, 
  * or try parse well define body by finding the end of define virtual 
- * end-of-line token.
+ * end-of-line token. But now most of the code is actually in cpp_token_c.ml
+ * It is related to what is in the yacfe configuration file (e.g. standard.h)
  *)
 
-(* corresponds to what is in the yacfe configuration file (e.g. standard.h) *)
-type define_def = string * define_param * define_body 
- and define_param = 
-   | NoParam
-   | Params of string list
- and define_body = 
-   | DefineBody of Parser_c.token list
-   | DefineHint of parsinghack_hint
-
-   (* strongly corresponds to the TMacroXxx in the grammar and lexer and the
-    * MacroXxx in the ast.
-    *)
-   and parsinghack_hint = 
-     | HintIterator
-     | HintDeclarator
-     | HintMacroString
-     | HintMacroStatement
-     | HintAttribute
-     | HintMacroIdentBuilder
-
 val regexp_macro: Str.regexp
 val regexp_annot: Str.regexp
 val regexp_declare: Str.regexp
 val regexp_foreach: Str.regexp
 val regexp_typedef: Str.regexp
 
-val _defs : (string, define_def) Hashtbl.t ref
-
-(* can reset it *)
+(* can reset this global *)
 val ifdef_paren_cnt: int ref
 
-val fix_tokens_define : Parser_c.token list -> Parser_c.token list
-val extract_cpp_define : Parser_c.token list -> (string, define_def) assoc
-
+val filter_cpp_stuff : 
+  Token_views_c.token_extended list -> Token_views_c.token_extended list
+val insert_virtual_positions: 
+  Parser_c.token list -> Parser_c.token list
 
-val fix_tokens_cpp : Parser_c.token list -> Parser_c.token list
+val fix_tokens_cpp : 
+  macro_defs:(string, Cpp_token_c.define_def) Hashtbl.t ->
+  Parser_c.token list -> Parser_c.token list
 
 (* next stream tokens -> passed stream tokens -> final next token *)
 val lookahead : 
index f67d0f6..560240d 100644 (file)
  *)
 open Common
 
+
 open Ast_c
 
+(*****************************************************************************)
+(* Wrappers *)
+(*****************************************************************************)
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_unparsing
+
+(*****************************************************************************)
 
 type pr_elem_func = Ast_c.info -> unit
 type pr_space_func = unit -> unit
@@ -67,8 +74,8 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
   let start_block () = pr_nl(); pr_indent() in
   let end_block   () = pr_unindent(); pr_nl() in
   
-  let indent_if_needed (s,_) f =
-    match s with
+  let indent_if_needed st f =
+    match Ast_c.unwrap_st st with
       Compound _ -> pr_space(); f()
     | _ ->
         (*no newline at the end - someone else will do that*)
@@ -196,7 +203,8 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
         pr_elem icp
 
 (* ---------------------- *)
-  and pp_statement = function
+  and pp_statement = fun st -> 
+    match Ast_c.get_st_and_ii st with
     | Labeled (Label (name, st)), ii ->
         let (i2) = Common.tuple_of_list1 ii in
        pr_outdent(); pp_name name; pr_elem i2; pr_nl(); pp_statement st
@@ -226,10 +234,10 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
     | Selection  (If (e, st1, st2)), i1::i2::i3::is -> 
         pr_elem i1; pr_space(); pr_elem i2; pp_expression e; pr_elem i3;
        indent_if_needed st1 (function _ -> pp_statement st1);
-        (match (st2, is) with
+        (match (Ast_c.get_st_and_ii st2, is) with
         | ((ExprStatement None, []), [])  -> ()
         | ((ExprStatement None, []), [iifakend])  -> pr_elem iifakend
-        | st2, [i4;iifakend] -> pr_elem i4;
+        | _st2, [i4;iifakend] -> pr_elem i4;
            indent_if_needed st2 (function _ -> pp_statement st2);
            pr_elem iifakend
         | x -> raise Impossible
@@ -253,10 +261,10 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
          
           pr_elem i1; pr_space();
           pr_elem i2;
-          pp_statement (ExprStatement e1opt, il1);
-          pp_statement (ExprStatement e2opt, il2);
+          pp_statement (Ast_c.mk_st (ExprStatement e1opt) il1);
+          pp_statement (Ast_c.mk_st (ExprStatement e2opt) il2);
           assert (null il3);
-          pp_statement (ExprStatement e3opt, il3);
+          pp_statement (Ast_c.mk_st (ExprStatement e3opt) il3);
           pr_elem i3;
           indent_if_needed st (function _ -> pp_statement st);
           pr_elem iifakend
@@ -376,12 +384,12 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
         (string * info) option -> (storage * il) option -> 
           fullType -> attribute list ->
             unit) = 
-    fun ident sto ((qu, iiqu), (ty, iity)) attrs ->
-      pp_base_type ((qu, iiqu), (ty, iity))  sto;
-      (match (ident,ty) with
+    fun ident sto ft attrs ->
+      pp_base_type ft  sto;
+      (match (ident, Ast_c.unwrap_typeC ft) with
        (Some _,_) | (_,Pointer _) -> pr_space()
       |        _ -> ());
-      pp_type_with_ident_rest ident ((qu, iiqu), (ty, iity)) attrs
+      pp_type_with_ident_rest ident ft attrs
        
        
   and (pp_base_type: fullType -> (storage * il) option -> unit) = 
@@ -432,9 +440,9 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
          );
            
           fields +> List.iter 
-            (fun (xfield, iipttvirg_when_emptyfield) -> 
+            (fun (field) -> 
                
-              match xfield with 
+              match field with 
               | DeclarationField(FieldDeclList(onefield_multivars,iiptvirg))->
                   (match onefield_multivars with
                   | x::xs -> 
@@ -448,7 +456,7 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
                          let identinfo = 
                             match nameopt with 
                            | None -> None 
-                            | Some name -> Some (get_s_and_ii_of_name name)
+                            | Some name -> Some (get_s_and_info_of_name name)
                           in
                          pp_type_with_ident identinfo None typ Ast_c.noattr;
                            
@@ -459,7 +467,7 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
                          | None -> 
                              pp_type typ;
                          | Some name -> 
-                              let (s, is) = get_s_and_ii_of_name name in
+                              let (s, is) = get_s_and_info_of_name name in
                              pp_type_with_ident
                                (Some (s, is)) None typ Ast_c.noattr;
                          );
@@ -468,14 +476,14 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
                             
                       ); (* match x, first onefield_multivars *)
                        
-                  (* for other vars *)
+                      (* for other vars *)
                      xs +> List.iter (function
                        | (Simple (nameopt, typ)), iivirg -> 
                            iivirg +> List.iter pr_elem;
                            let identinfo = 
                              match nameopt with 
                              | None -> None 
-                             | Some name -> Some (get_s_and_ii_of_name name)
+                             | Some name -> Some (get_s_and_info_of_name name)
                            in
                            pp_type_with_ident_rest identinfo typ Ast_c.noattr
 
@@ -483,7 +491,7 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
                            iivirg +> List.iter pr_elem;
                            (match nameopt with
                            | Some name -> 
-                                let (s,is) = get_s_and_ii_of_name name in
+                                let (s,is) = get_s_and_info_of_name name in
                                pp_type_with_ident_rest
                                  (Some (s, is)) typ Ast_c.noattr;
                                pr_elem iidot;
@@ -497,10 +505,28 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
                  iiptvirg +> List.iter pr_elem;
                    
                    
-             | MacroStructDeclTodo -> pr2 "MacroTodo"
+             | MacroDeclField ((s, es), ii)  -> 
+                 let (iis, lp, rp, iiend, ifakestart) = 
+                   Common.tuple_of_list5 ii in
+                 (* iis::lp::rp::iiend::ifakestart::iisto
+                iisto +> List.iter pr_elem; (* static and const *)
+                 *)
+                pr_elem ifakestart;
+                pr_elem iis;
+                pr_elem lp;
+                es +> List.iter (fun (e, opt) -> 
+                   assert (List.length opt <= 1);
+                   opt +> List.iter pr_elem;
+                   pp_argument e;
+                );
+                
+                pr_elem rp;
+                pr_elem iiend;
+
                      
                      
-             | EmptyField -> iipttvirg_when_emptyfield +> List.iter pr_elem
+             | EmptyField iipttvirg_when_emptyfield -> 
+                  pr_elem iipttvirg_when_emptyfield
                      
              | CppDirectiveStruct cpp -> pp_directive cpp
              | IfdefStruct ifdef -> pp_ifdef ifdef
@@ -558,10 +584,19 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
           assert (List.length iis =|= 2);
           print_sto_qu_ty (sto, qu, iis);
            
-      | (TypeName (name,_typ), noii) -> 
+      | (TypeName (name,typ), noii) -> 
           assert (null noii);
-          let (_s, iis) = get_s_and_ii_of_name name in
+          let (_s, iis) = get_s_and_info_of_name name in
           print_sto_qu_ty (sto, qu, [iis]);
+
+          if !Flag_parsing_c.pretty_print_typedef_value
+          then begin
+            pr_elem (Ast_c.fakeInfo() +> Ast_c.rewrap_str "{*");
+            typ +> Common.do_option (fun typ -> 
+                pp_type typ;
+            );
+            pr_elem (Ast_c.fakeInfo() +> Ast_c.rewrap_str "*}");
+          end;
            
       | (TypeOfExpr (e), iis) -> 
           print_sto_qu (sto, qu);
@@ -597,6 +632,7 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
     fullType -> attribute list -> unit) = 
     
     fun ident (((qu, iiqu), (ty, iity)) as fullt) attrs -> 
+
       let print_ident ident = Common.do_option (fun (s, iis) -> 
         (* XXX attrs +> pp_attributes pr_elem pr_space; *)
         pr_elem iis
@@ -626,37 +662,51 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
           pp_type_with_ident_rest ident t attrs;
          
       (* ugly special case ... todo? maybe sufficient in practice *)       
-      | (ParenType (q1, (Pointer (q2, (FunctionType t, ii3))   , 
-                         [ipointer])  ), [i1;i2]) ->  
-                          pp_type_left (q2, (FunctionType t, ii3));
-                          pr_elem i1;
-                          pr_elem ipointer;
-                          print_ident ident;
-                          pr_elem i2;
-                          pp_type_right (q2, (FunctionType t, ii3));
-                          
-      (* another ugly special case *)
-      | (ParenType 
-           (q1, (Array (eopt,
-                       (q2, (Pointer 
-                               (q3, (FunctionType t, iifunc)), 
-                             [ipointer]))),
-                [iarray1;iarray2])), [i1;i2]) -> 
-                  pp_type_left (q3, (FunctionType t, iifunc));
-                  pr_elem i1;
-                  pr_elem ipointer;
-                  print_ident ident;
-                  pr_elem iarray1;
-                  do_option pp_expression eopt;
-                  pr_elem iarray2;
-                  pr_elem i2;
-                  pp_type_right (q3, (FunctionType t, iifunc))
-                    
-                    
-                    
-      | (ParenType t, [i1;i2]) ->  
-          pr2 "PB PARENTYPE ZARB, I forget about the ()";
-          pp_type_with_ident_rest ident t attrs;
+      | (ParenType ttop, [i1;i2]) ->  
+          (match Ast_c.get_ty_and_ii ttop with
+          | (_q1, (Pointer t2, [ipointer])) -> 
+              (match Ast_c.get_ty_and_ii t2 with
+              | (q2, (FunctionType t, ii3)) -> 
+
+                 pp_type_left (q2, mk_tybis (FunctionType t) ii3);
+                 pr_elem i1;
+                 pr_elem ipointer;
+                 print_ident ident;
+                 pr_elem i2;
+                 pp_type_right (q2, mk_tybis (FunctionType t) ii3);
+              | _ -> 
+                  pr2 "PB PARENTYPE ZARB, I forget about the ()";
+                  pp_type_with_ident_rest ident ttop attrs;
+              )
+          (* another ugly special case *)
+          | _q1, (Array (eopt,t2 ), [iarray1;iarray2]) -> 
+              (match Ast_c.get_ty_and_ii t2 with 
+              | (_q2, (Pointer t3, [ipointer])) -> 
+                  (match Ast_c.get_ty_and_ii t3 with
+                  | (q3, (FunctionType t, iifunc)) -> 
+                     pp_type_left (q3, mk_tybis (FunctionType t) iifunc);
+                     pr_elem i1;
+                     pr_elem ipointer;
+                     print_ident ident;
+                     pr_elem iarray1;
+                     do_option pp_expression eopt;
+                     pr_elem iarray2;
+                     pr_elem i2;
+                     pp_type_right (q3, mk_tybis (FunctionType t) iifunc)
+                  | _ -> 
+                      pr2 "PB PARENTYPE ZARB, I forget about the ()";
+                      pp_type_with_ident_rest ident ttop attrs;
+                  )
+              | _ -> 
+                  pr2 "PB PARENTYPE ZARB, I forget about the ()";
+                  pp_type_with_ident_rest ident ttop attrs;
+              )
+          | _t -> 
+
+              pr2 "PB PARENTYPE ZARB, I forget about the ()";
+              pp_type_with_ident_rest ident ttop attrs;
+          )
           
          
       | (Array (eopt, t), [i1;i2]) -> 
@@ -719,7 +769,7 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
     | None -> 
         pp_type t
     | Some name -> 
-        let (s,i1) = get_s_and_ii_of_name name in
+        let (s,i1) = get_s_and_info_of_name name in
        pp_type_with_ident
           (Some (s, i1)) None t Ast_c.noattr
           
@@ -783,7 +833,7 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
         (* handling the first var. Special case, we print the whole type *)
        (match var with
        | Some (name, iniopt) -> 
-            let (s,iis) = get_s_and_ii_of_name name in
+            let (s,iis) = get_s_and_info_of_name name in
            pp_type_with_ident
              (Some (s, iis)) (Some (storage, iisto))
              returnType attrs;
@@ -801,7 +851,7 @@ let pretty_print_c pr_elem pr_space pr_nl pr_indent pr_outdent pr_unindent =
            v_attr = attrs;
          }, iivirg) ->
                         
-            let (s,iis) = get_s_and_ii_of_name name in
+            let (s,iis) = get_s_and_info_of_name name in
            assert (storage2 =*= storage);
            iivirg +> List.iter pr_elem;
            pp_type_with_ident_rest
@@ -1083,7 +1133,7 @@ and pp_init (init, iinit) =
        pr2 "Decl" 
        
     | F.ExprStatement (st, (eopt, ii)) ->  
-       pp_statement (ExprStatement eopt, ii) 
+       pp_statement (Ast_c.mk_st (ExprStatement eopt) ii) 
        
     | F.IfHeader (_, (e,ii)) 
     | F.SwitchHeader (_, (e,ii))
@@ -1308,6 +1358,11 @@ let string_of_expression e =
   Common.format_to_string (fun () ->
     pp_expression_simple e
       )
+
+let string_of_toplevel top = 
+  Common.format_to_string (fun () ->
+    pp_toplevel_simple top
+      )
     
 let (debug_info_of_node:
        Ograph_extended.nodei -> Control_flow_c.cflow -> string) = 
index 9e8e475..d6273a8 100644 (file)
@@ -62,3 +62,4 @@ val pp_flow_simple: flow_printer
 val debug_info_of_node: Ograph_extended.nodei -> Control_flow_c.cflow -> string
 
 val string_of_expression: Ast_c.expression -> string
+val string_of_toplevel: Ast_c.toplevel -> string
index 96cc546..e11d5df 100644 (file)
@@ -6,6 +6,7 @@ let score_path = "/home/pad/c-yacfe/tmp"
 
 let tmpfile = "/tmp/output.c" 
 
+module Ast_to_flow = Control_flow_c_build
 
 (*****************************************************************************)
 (* Subsystem testing *)
@@ -72,12 +73,6 @@ let test_parse_gen xs ext =
     else Hashtbl.add newscore file (Common.Pb s)
   );
   
-  if not (null !stat_list) 
-  then begin 
-    Parsing_stat.print_recurring_problematic_tokens !stat_list;
-    Parsing_stat.print_parsing_stat_list !stat_list;
-  end;
-  
   dirname_opt +> Common.do_option (fun dirname -> 
     pr2_xxxxxxxxxxxxxxxxx();
     pr2 "regression testing  information";
@@ -88,7 +83,14 @@ let test_parse_gen xs ext =
     Common.regression_testing newscore 
       (Filename.concat score_path
        ("score_parsing__" ^str ^ def ^ ext ^ ".marshalled"))
-  )
+  );
+
+  if not (null !stat_list) 
+  then begin 
+    Parsing_stat.print_recurring_problematic_tokens !stat_list;
+    Parsing_stat.print_parsing_stat_list !stat_list;
+  end;
+  ()
 
 
 let test_parse_c xs = 
@@ -99,7 +101,61 @@ let test_parse_ch xs =
   test_parse_gen xs "[ch]"
 
 
+(* ---------------------------------------------------------------------- *)
+
+let test_parse xs = 
+
+  Flag_parsing_c.filter_msg_define_error := true;
+  Flag_parsing_c.filter_define_error := true;
+  Flag_parsing_c.verbose_lexing := false;
+  Flag_parsing_c.verbose_parsing := false;
+
+  let dirname_opt = 
+    match xs with
+    | [x] when is_directory x -> Some x
+    | _ -> None
+  in
+  dirname_opt +> Common.do_option (fun dir -> 
+
+    let ext = "h" in 
+    let fullxs = Common.files_of_dir_or_files_no_vcs ext [dir] in
+    fullxs +> List.iter (fun file -> 
+      let xs = Parse_c.parse_cpp_define_file file in
+      xs +> List.iter (fun (x, def) -> 
+        let (s, params, body) = def in 
+        Hashtbl.replace !Parse_c._defs s (s, params, body);
+      );
+    );
+  );
+
+  let ext = "[ch]" in
+
+  let fullxs = Common.files_of_dir_or_files_no_vcs ext xs in
+
+  let stat_list = ref [] in
+  Common.check_stack_nbfiles (List.length fullxs);
+
+  fullxs +> List.iter (fun file -> 
+    if not (file =~ (".*\\."^ext))
+    then pr2 ("warning: seems not a ."^ext^" file");
 
+    pr2 "";
+    pr2 ("PARSING: " ^ file);
+
+    let (xs, stat) = Parse_c.parse_print_error_heuristic file in
+    xs +> List.iter (fun (ast, (s, toks)) -> 
+      Parse_c.print_commentized toks
+    );
+
+    Common.push2 stat stat_list;
+  );
+  
+  if not (null !stat_list) 
+  then begin 
+    Parsing_stat.print_recurring_problematic_tokens !stat_list;
+    Parsing_stat.print_parsing_stat_list !stat_list;
+  end;
+  ()
 
 
 
@@ -322,6 +378,57 @@ let test_cpp file =
 
 
 
+let extract_macros ~selection x = 
+  (* CONFIG [ch] ? also do for .c ? maybe less needed now that I 
+   * add local_macros.
+   *)
+
+  let ext = "h" in 
+  let fullxs = Common.files_of_dir_or_files_no_vcs ext [x] in
+  fullxs +> List.iter (fun file -> 
+   
+    pr ("/* PARSING: " ^ file ^ " */");
+    let xs = Parse_c.parse_cpp_define_file file in
+    xs +> List.iter (fun (x, def) -> 
+      let (s, params, body) = def in 
+      assert(s = x);
+      (match params, body with
+      | Cpp_token_c.NoParam, Cpp_token_c.DefineBody [Parser_c.TInt _]
+      | Cpp_token_c.NoParam, Cpp_token_c.DefineBody [] -> 
+          ()
+      | _ -> 
+
+          let s1 = 
+            match params with
+            | Cpp_token_c.NoParam -> spf "#define %s " s
+            | Cpp_token_c.Params xs -> 
+                spf "#define %s(%s) "
+                  s (Common.join "," xs)
+          in
+          let s2, bodytoks = 
+            match body with
+            | Cpp_token_c.DefineHint _ -> 
+                failwith "weird, hint in regular header file"
+            | Cpp_token_c.DefineBody xs -> 
+                Common.join " " (xs +> List.map Token_helpers.str_of_tok),
+                xs
+          in
+
+          let print = 
+            match () with
+            | () when s ==~ Parsing_hacks.regexp_annot -> true
+            | () when List.exists (function
+              | Parser_c.Tattribute _ -> true
+              | _ -> false) bodytoks -> true
+            | () -> false
+          in
+          if print || not selection then pr (s1 ^ s2)
+      );
+    );
+  );
+  ()
+
+
 
 (* ---------------------------------------------------------------------- *)
 let test_xxx a  = 
@@ -354,6 +461,9 @@ let actions () = [
   "-parse_ch", "   <file or dir>", 
   Common.mk_action_n_arg test_parse_ch;
 
+  "-parse", "   <file or dir>", 
+  Common.mk_action_n_arg test_parse;
+
   "-show_flow", "   <file or file:function>", 
   Common.mk_action_1_arg test_cfg;
   "-control_flow", "   <file or file:function>", 
@@ -377,6 +487,11 @@ let actions () = [
   "-test_cpp", " <file>",
   Common.mk_action_1_arg test_cpp;
 
+  "-extract_macros", " <file or dir>",
+  Common.mk_action_1_arg (extract_macros ~selection:false) ;
+
+  "-extract_macros_select", " <file or dir>",
+  Common.mk_action_1_arg (extract_macros ~selection:true);
 
 
   "-xxx", "   <file1> <>", 
index d896141..7c8e6e7 100644 (file)
@@ -28,8 +28,8 @@ open Common
  * so that ast_c does not need to depend on yacc which depends on
  * ast_c, etc. 
  * 
- * Also, OcamlYacc imposes some stupid constraints on the way we can define
- * the token type. OcamlYacc force us to do a token type that
+ * Also, ocamlyacc imposes some stupid constraints on the way we can define
+ * the token type. ocamlyacc forces us to do a token type that
  * cant be a pair of a sum type, it must be directly a sum type.
  * We don't have this constraint here.
  * 
index cefa5e9..d7e60ca 100644 (file)
@@ -117,11 +117,17 @@ let is_cbrace = function
 
 
 (* ---------------------------------------------------------------------- *)
+
+(* end of file *)
 let is_eof = function
   | EOF x -> true
   | _ -> false
 
 
+(* end of macro *)
+let is_eom = function
+  | TDefEOL _ -> true
+  | _ -> false
 
 let is_statement = function
   | Tfor _ | Tdo _ | Tif _ | Twhile _ | Treturn _ 
@@ -193,7 +199,6 @@ let is_ident_like = function
   | TMacroStmt _
   | TMacroString _
   | TMacroDecl _
-  | TMacroStructDecl _
   | TMacroDeclConst _
   | TMacroIterator _
       -> true
@@ -247,7 +252,6 @@ let info_of_tok = function
   | TMacroStmt             (s, i) -> i
   | TMacroString             (s, i) -> i
   | TMacroDecl             (s, i) -> i
-  | TMacroStructDecl             (s, i) -> i
   | TMacroDeclConst             (i) -> i
   | TMacroIterator             (s,i) -> i
 (*  | TMacroTop             (s,i) -> i *)
@@ -397,7 +401,6 @@ let visitor_info_of_tok f = function
   | TMacroStmt           (s, i)   -> TMacroStmt            (s, f i)
   | TMacroString         (s, i)   -> TMacroString          (s, f i)
   | TMacroDecl           (s, i) -> TMacroDecl            (s, f i)
-  | TMacroStructDecl     (s, i) -> TMacroStructDecl      (s, f i)
   | TMacroDeclConst      (i)   -> TMacroDeclConst       (f i)
   | TMacroIterator       (s, i) -> TMacroIterator        (s, f i)
 (*  | TMacroTop          (s,i) -> TMacroTop             (s,f i) *)
index bcb1fcd..3fff96d 100644 (file)
@@ -15,6 +15,8 @@ val is_cpp_instruction     : Parser_c.token -> bool
 val is_gcc_token           : Parser_c.token -> bool
 
 val is_eof                 : Parser_c.token -> bool
+val is_eom                 : Parser_c.token -> bool
+
 val is_statement           : Parser_c.token -> bool
 val is_start_of_something  : Parser_c.token -> bool
 val is_binary_operator     : Parser_c.token -> bool
diff --git a/parsing_c/token_views_c.ml b/parsing_c/token_views_c.ml
new file mode 100644 (file)
index 0000000..6b3a4fb
--- /dev/null
@@ -0,0 +1,500 @@
+(* Yoann Padioleau
+ * 
+ * Copyright (C) 2007, 2008 Ecole des Mines de Nantes
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License (GPL)
+ * version 2 as published by the Free Software Foundation.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * file license.txt for more details.
+ *)
+
+open Common
+
+module TH = Token_helpers 
+
+open Parser_c 
+
+(*****************************************************************************)
+(* Some debugging functions  *)
+(*****************************************************************************)
+
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_parsing 
+
+(* ------------------------------------------------------------------------- *)
+(* fuzzy parsing, different "views" over the same program *)
+(* ------------------------------------------------------------------------- *)
+
+
+(* Normally I should not use ref/mutable in the token_extended type
+ * and I should have a set of functions taking a list of tokens and
+ * returning a list of tokens. The problem is that to make easier some
+ * functions, it is better to work on better representation, on "views"
+ * over this list of tokens. But then modifying those views and get
+ * back from those views to the original simple list of tokens is
+ * tedious. One way is to maintain next to the view a list of "actions"
+ * (I was using a hash storing the charpos of the token and associating
+ * the action) but it is tedious too. Simpler to use mutable/ref. We
+ * use the same idea that we use when working on the Ast_c. *)
+
+(* old: when I was using the list of "actions" next to the views, the hash
+ * indexed by the charpos, there could have been some problems:
+ * how my fake_pos interact with the way I tag and adjust token ?
+ * because I base my tagging on the position of the token ! so sometimes
+ * could tag another fakeInfo that should not be tagged ? 
+ * fortunately I don't use anymore this technique.
+ *)
+
+(* update: quite close to the Place_c.Inxxx *)
+type context = 
+  InFunction | InEnum | InStruct | InInitializer | NoContext
+
+type token_extended = { 
+  mutable tok: Parser_c.token;
+  mutable where: context;
+
+  (* less: need also a after ? *)
+  mutable new_tokens_before : Parser_c.token list;
+
+  (* line x col  cache, more easily accessible, of the info in the token *)
+  line: int; 
+  col : int;
+}
+
+(* todo? is it ok to reset as a comment a TDefEOL ? if do that, then
+ * can confuse the parser.
+ *)
+let set_as_comment cppkind x = 
+  if TH.is_eof x.tok 
+  then () (* otherwise parse_c will be lost if don't find a EOF token *)
+  else 
+    x.tok <- TCommentCpp (cppkind, TH.info_of_tok x.tok)
+
+let mk_token_extended x = 
+  let (line, col) = TH.linecol_of_tok x in
+  { tok = x; 
+    line = line; col = col; 
+    where = NoContext; 
+    new_tokens_before = [];
+  }
+
+
+let rebuild_tokens_extented toks_ext = 
+  let _tokens = ref [] in
+  toks_ext +> List.iter (fun tok -> 
+    tok.new_tokens_before +> List.iter (fun x -> push2 x _tokens);
+    push2 tok.tok _tokens 
+  );
+  let tokens = List.rev !_tokens in
+  (tokens +> acc_map mk_token_extended)
+
+
+
+(* x list list, because x list separated by ',' *) 
+type paren_grouped = 
+  | Parenthised   of paren_grouped list list * token_extended list
+  | PToken of token_extended
+
+type brace_grouped = 
+  | Braceised   of 
+      brace_grouped list list * token_extended * token_extended option
+  | BToken of token_extended
+
+(* Far better data structure than doing hacks in the lexer or parser
+ * because in lexer we don't know to which ifdef a endif is related
+ * and so when we want to comment a ifdef, we don't know which endif
+ * we must also comment. Especially true for the #if 0 which sometimes
+ * have a #else part.
+ * 
+ * x list list, because x list separated by #else or #elif 
+ *) 
+type ifdef_grouped = 
+  | Ifdef     of ifdef_grouped list list * token_extended list
+  | Ifdefbool of bool * ifdef_grouped list list * token_extended list
+  | NotIfdefLine of token_extended list
+
+
+type 'a line_grouped = 
+  Line of 'a list
+
+
+type body_function_grouped = 
+  | BodyFunction of token_extended list
+  | NotBodyLine  of token_extended list
+
+
+(* ------------------------------------------------------------------------- *)
+(* view builders  *)
+(* ------------------------------------------------------------------------- *)
+
+(* todo: synchro ! use more indentation 
+ * if paren not closed and same indentation level, certainly because
+ * part of a mid-ifdef-expression.
+*)
+let rec mk_parenthised xs = 
+  match xs with
+  | [] -> []
+  | x::xs -> 
+      (match x.tok with 
+      | TOPar _ | TOParDefine _ -> 
+          let body, extras, xs = mk_parameters [x] [] xs in
+          Parenthised (body,extras)::mk_parenthised xs
+      | _ -> 
+          PToken x::mk_parenthised xs
+      )
+
+(* return the body of the parenthised expression and the rest of the tokens *)
+and mk_parameters extras acc_before_sep  xs = 
+  match xs with
+  | [] -> 
+      (* maybe because of #ifdef which "opens" '(' in 2 branches *)
+      pr2 "PB: not found closing paren in fuzzy parsing";
+      [List.rev acc_before_sep], List.rev extras, []
+  | x::xs -> 
+      (match x.tok with 
+      (* synchro *)
+      | TOBrace _ when x.col =|= 0 -> 
+          pr2 "PB: found synchro point } in paren";
+          [List.rev acc_before_sep], List.rev (extras), (x::xs)
+
+      | TCPar _ | TCParEOL _ -> 
+          [List.rev acc_before_sep], List.rev (x::extras), xs
+      | TOPar _ | TOParDefine _ -> 
+          let body, extrasnest, xs = mk_parameters [x] [] xs in
+          mk_parameters extras 
+            (Parenthised (body,extrasnest)::acc_before_sep) 
+            xs
+      | TComma _ -> 
+          let body, extras, xs = mk_parameters (x::extras) [] xs in
+          (List.rev acc_before_sep)::body, extras, xs 
+      | _ -> 
+          mk_parameters extras (PToken x::acc_before_sep) xs
+      )
+
+
+
+
+let rec mk_braceised xs = 
+  match xs with
+  | [] -> []
+  | x::xs -> 
+      (match x.tok with 
+      | TOBrace _ -> 
+          let body, endbrace, xs = mk_braceised_aux [] xs in
+          Braceised (body, x, endbrace)::mk_braceised xs
+      | TCBrace _ -> 
+          pr2 "PB: found closing brace alone in fuzzy parsing";
+          BToken x::mk_braceised xs
+      | _ -> 
+          BToken x::mk_braceised xs
+      )
+
+(* return the body of the parenthised expression and the rest of the tokens *)
+and mk_braceised_aux acc xs = 
+  match xs with
+  | [] -> 
+      (* maybe because of #ifdef which "opens" '(' in 2 branches *)
+      pr2 "PB: not found closing brace in fuzzy parsing";
+      [List.rev acc], None, []
+  | x::xs -> 
+      (match x.tok with 
+      | TCBrace _ -> [List.rev acc], Some x, xs
+      | TOBrace _ -> 
+          let body, endbrace, xs = mk_braceised_aux [] xs in
+          mk_braceised_aux  (Braceised (body,x, endbrace)::acc) xs
+      | _ -> 
+          mk_braceised_aux (BToken x::acc) xs
+      )
+
+          
+
+
+let rec mk_ifdef xs = 
+  match xs with
+  | [] -> []
+  | x::xs -> 
+      (match x.tok with 
+      | TIfdef _ -> 
+          let body, extra, xs = mk_ifdef_parameters [x] [] xs in
+          Ifdef (body, extra)::mk_ifdef xs
+      | TIfdefBool (b,_, _) -> 
+          let body, extra, xs = mk_ifdef_parameters [x] [] xs in
+          
+          (* if not passing, then consider a #if 0 as an ordinary #ifdef *)
+          if !Flag_parsing_c.if0_passing
+          then Ifdefbool (b, body, extra)::mk_ifdef xs
+          else Ifdef(body, extra)::mk_ifdef xs
+
+      | TIfdefMisc (b,_,_) | TIfdefVersion (b,_,_) -> 
+          let body, extra, xs = mk_ifdef_parameters [x] [] xs in
+          Ifdefbool (b, body, extra)::mk_ifdef xs
+
+          
+      | _ -> 
+          (* todo? can have some Ifdef in the line ? *)
+          let line, xs = Common.span (fun y -> y.line =|= x.line) (x::xs) in
+          NotIfdefLine line::mk_ifdef xs 
+      )
+
+and mk_ifdef_parameters extras acc_before_sep xs = 
+  match xs with
+  | [] -> 
+      (* Note that mk_ifdef is assuming that CPP instruction are alone
+       * on their line. Because I do a span (fun x -> is_same_line ...)
+       * I might take with me a #endif if this one is mixed on a line
+       * with some "normal" tokens.
+       *)
+      pr2 "PB: not found closing ifdef in fuzzy parsing";
+      [List.rev acc_before_sep], List.rev extras, []
+  | x::xs -> 
+      (match x.tok with 
+      | TEndif _ -> 
+          [List.rev acc_before_sep], List.rev (x::extras), xs
+      | TIfdef _ -> 
+          let body, extrasnest, xs = mk_ifdef_parameters [x] [] xs in
+          mk_ifdef_parameters 
+            extras (Ifdef (body, extrasnest)::acc_before_sep) xs
+
+      | TIfdefBool (b,_,_) -> 
+          let body, extrasnest, xs = mk_ifdef_parameters [x] [] xs in
+
+          if !Flag_parsing_c.if0_passing
+          then
+            mk_ifdef_parameters 
+              extras (Ifdefbool (b, body, extrasnest)::acc_before_sep) xs
+          else 
+            mk_ifdef_parameters 
+              extras (Ifdef (body, extrasnest)::acc_before_sep) xs
+
+
+      | TIfdefMisc (b,_,_) | TIfdefVersion (b,_,_) -> 
+          let body, extrasnest, xs = mk_ifdef_parameters [x] [] xs in
+          mk_ifdef_parameters 
+            extras (Ifdefbool (b, body, extrasnest)::acc_before_sep) xs
+
+      | TIfdefelse _ 
+      | TIfdefelif _ -> 
+          let body, extras, xs = mk_ifdef_parameters (x::extras) [] xs in
+          (List.rev acc_before_sep)::body, extras, xs 
+      | _ -> 
+          let line, xs = Common.span (fun y -> y.line =|= x.line) (x::xs) in
+          mk_ifdef_parameters extras (NotIfdefLine line::acc_before_sep) xs
+      )
+
+(* --------------------------------------- *)
+
+let line_of_paren = function
+  | PToken x -> x.line
+  | Parenthised (xxs, info_parens) -> 
+      (match info_parens with
+      | [] -> raise Impossible
+      | x::xs -> x.line
+      )
+
+
+let rec span_line_paren line = function
+  | [] -> [],[]
+  | x::xs -> 
+      (match x with
+      | PToken tok when TH.is_eof tok.tok -> 
+          [], x::xs
+      | _ -> 
+        if line_of_paren x =|= line 
+        then
+          let (l1, l2) = span_line_paren line xs in
+          (x::l1, l2)
+        else ([], x::xs)
+      )
+        
+
+let rec mk_line_parenthised xs = 
+  match xs with
+  | [] -> []
+  | x::xs -> 
+      let line_no = line_of_paren x in
+      let line, xs = span_line_paren line_no xs in
+      Line (x::line)::mk_line_parenthised xs
+
+
+(* --------------------------------------- *)
+let rec mk_body_function_grouped xs = 
+  match xs with 
+  | [] -> []
+  | x::xs -> 
+      (match x with
+      | {tok = TOBrace _; col = 0} -> 
+          let is_closing_brace = function 
+            | {tok = TCBrace _; col = 0 } -> true 
+            | _ -> false 
+          in
+          let body, xs = Common.span (fun x -> not (is_closing_brace x)) xs in
+          (match xs with
+          | ({tok = TCBrace _; col = 0 })::xs -> 
+              BodyFunction body::mk_body_function_grouped xs
+          | [] -> 
+              pr2 "PB:not found closing brace in fuzzy parsing";
+              [NotBodyLine body]
+          | _ -> raise Impossible
+          )
+          
+      | _ -> 
+          let line, xs = Common.span (fun y -> y.line =|= x.line) (x::xs) in
+          NotBodyLine line::mk_body_function_grouped xs 
+      )
+
+
+(* ------------------------------------------------------------------------- *)
+(* view iterators  *)
+(* ------------------------------------------------------------------------- *)
+
+let rec iter_token_paren f xs = 
+  xs +> List.iter (function
+  | PToken tok -> f tok;
+  | Parenthised (xxs, info_parens) -> 
+      info_parens +> List.iter f;
+      xxs +> List.iter (fun xs -> iter_token_paren f xs)
+  )
+
+let rec iter_token_brace f xs = 
+  xs +> List.iter (function
+  | BToken tok -> f tok;
+  | Braceised (xxs, tok1, tok2opt) -> 
+      f tok1; do_option f tok2opt;
+      xxs +> List.iter (fun xs -> iter_token_brace f xs)
+  )
+
+let rec iter_token_ifdef f xs = 
+  xs +> List.iter (function
+  | NotIfdefLine xs -> xs +> List.iter f;
+  | Ifdefbool (_, xxs, info_ifdef) 
+  | Ifdef (xxs, info_ifdef) -> 
+      info_ifdef +> List.iter f;
+      xxs +> List.iter (iter_token_ifdef f)
+  )
+
+
+
+
+let tokens_of_paren xs = 
+  let g = ref [] in
+  xs +> iter_token_paren (fun tok -> push2 tok g);
+  List.rev !g
+
+
+let tokens_of_paren_ordered xs = 
+  let g = ref [] in
+
+  let rec aux_tokens_ordered = function
+    | PToken tok -> push2 tok g;
+    | Parenthised (xxs, info_parens) -> 
+        let (opar, cpar, commas) = 
+          match info_parens with
+          | opar::xs -> 
+              (match List.rev xs with
+              | cpar::xs -> 
+                  opar, cpar, List.rev xs
+              | _ -> raise Impossible
+              )
+          | _ -> raise Impossible
+        in
+        push2 opar g;
+        aux_args (xxs,commas);
+        push2 cpar g;
+
+  and aux_args (xxs, commas) =
+    match xxs, commas with
+    | [], [] -> ()
+    | [xs], [] -> xs +> List.iter aux_tokens_ordered
+    | xs::ys::xxs, comma::commas -> 
+        xs +> List.iter aux_tokens_ordered;
+        push2 comma g;
+        aux_args (ys::xxs, commas)
+    | _ -> raise Impossible
+
+  in
+
+  xs +> List.iter aux_tokens_ordered;
+  List.rev !g
+
+
+
+(* ------------------------------------------------------------------------- *)
+(* set the context info in token *)
+(* ------------------------------------------------------------------------- *)
+
+
+let rec set_in_function_tag xs = 
+ (* could try: ) { } but it can be the ) of a if or while, so 
+  * better to base the heuristic on the position in column zero.
+  * Note that some struct or enum or init put also their { in first column
+  * but set_in_other will overwrite the previous InFunction tag.
+  *)
+  match xs with
+  | [] -> ()
+  (* ) { and the closing } is in column zero, then certainly a function *)
+  | BToken ({tok = TCPar _ })::(Braceised (body, tok1, Some tok2))::xs 
+      when tok1.col <> 0 && tok2.col =|= 0 -> 
+      body +> List.iter (iter_token_brace (fun tok -> 
+        tok.where <- InFunction
+      ));
+      set_in_function_tag xs
+
+  | (BToken x)::xs -> set_in_function_tag xs
+
+  | (Braceised (body, tok1, Some tok2))::xs 
+      when tok1.col =|= 0 && tok2.col =|= 0 -> 
+      body +> List.iter (iter_token_brace (fun tok -> 
+        tok.where <- InFunction
+      ));
+      set_in_function_tag xs
+  | Braceised (body, tok1, tok2)::xs -> 
+      set_in_function_tag xs
+  
+
+let rec set_in_other xs = 
+  match xs with 
+  | [] -> ()
+  (* enum x { } *)
+  | BToken ({tok = Tenum _})::BToken ({tok = TIdent _})
+    ::Braceised(body, tok1, tok2)::xs 
+  | BToken ({tok = Tenum _})
+    ::Braceised(body, tok1, tok2)::xs 
+    -> 
+      body +> List.iter (iter_token_brace (fun tok -> 
+        tok.where <- InEnum;
+      ));
+      set_in_other xs
+
+  (* struct x { } *)
+  | BToken ({tok = Tstruct _})::BToken ({tok = TIdent _})
+    ::Braceised(body, tok1, tok2)::xs -> 
+      body +> List.iter (iter_token_brace (fun tok -> 
+        tok.where <- InStruct;
+      ));
+      set_in_other xs
+  (* = { } *)
+  | BToken ({tok = TEq _})
+    ::Braceised(body, tok1, tok2)::xs -> 
+      body +> List.iter (iter_token_brace (fun tok -> 
+        tok.where <- InInitializer;
+      ));
+      set_in_other xs
+
+  | BToken _::xs -> set_in_other xs
+
+  | Braceised(body, tok1, tok2)::xs -> 
+      body +> List.iter set_in_other;
+      set_in_other xs
+
+      
+      
+
+let set_context_tag xs = 
+  begin
+    set_in_function_tag xs;
+    set_in_other xs;
+  end
+  
diff --git a/parsing_c/token_views_c.mli b/parsing_c/token_views_c.mli
new file mode 100644 (file)
index 0000000..804552b
--- /dev/null
@@ -0,0 +1,62 @@
+
+type context = InFunction | InEnum | InStruct | InInitializer | NoContext
+
+type token_extended = {
+  mutable tok : Parser_c.token;
+  mutable where : context;
+  mutable new_tokens_before : Parser_c.token list;
+  line : int;
+  col : int;
+}
+val mk_token_extended : Parser_c.token -> token_extended
+
+val rebuild_tokens_extented : token_extended list -> token_extended list
+
+(* ---------------------------------------------------------------------- *)
+type paren_grouped =
+    Parenthised of paren_grouped list list * token_extended list
+  | PToken of token_extended
+
+type brace_grouped =
+    Braceised of brace_grouped list list * token_extended *
+      token_extended option
+  | BToken of token_extended
+
+type ifdef_grouped =
+    Ifdef of ifdef_grouped list list * token_extended list
+  | Ifdefbool of bool * ifdef_grouped list list * token_extended list
+  | NotIfdefLine of token_extended list
+
+type 'a line_grouped = Line of 'a list
+
+type body_function_grouped =
+    BodyFunction of token_extended list
+  | NotBodyLine of token_extended list
+
+(* ---------------------------------------------------------------------- *)
+val mk_parenthised : token_extended list -> paren_grouped list
+val mk_braceised : token_extended list -> brace_grouped list
+val mk_ifdef : token_extended list -> ifdef_grouped list
+val mk_line_parenthised :
+  paren_grouped list -> paren_grouped line_grouped list
+val mk_body_function_grouped :
+  token_extended list -> body_function_grouped list
+
+val line_of_paren : paren_grouped -> int
+val span_line_paren :
+  int -> paren_grouped list -> paren_grouped list * paren_grouped list
+
+(* ---------------------------------------------------------------------- *)
+val iter_token_paren : (token_extended -> unit) -> paren_grouped list -> unit
+val iter_token_brace : (token_extended -> unit) -> brace_grouped list -> unit
+val iter_token_ifdef : (token_extended -> unit) -> ifdef_grouped list -> unit
+
+val tokens_of_paren : paren_grouped list -> token_extended list
+val tokens_of_paren_ordered : paren_grouped list -> token_extended list
+
+(* ---------------------------------------------------------------------- *)
+val set_context_tag: brace_grouped list -> unit
+
+(* ---------------------------------------------------------------------- *)
+val set_as_comment : Token_c.cppcommentkind -> token_extended -> unit
+
index 0707df8..7b8ef84 100644 (file)
@@ -94,13 +94,7 @@ module Lib = Lib_parsing_c
 (*****************************************************************************)
 (* Wrappers *)
 (*****************************************************************************)
-let pr2 s = 
-  if !Flag_parsing_c.verbose_type
-  then Common.pr2 s
-
-let pr2_once s = 
-  if !Flag_parsing_c.verbose_type
-  then Common.pr2_once s
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_type
 
 (*****************************************************************************)
 (* Environment *)
@@ -161,6 +155,7 @@ type namedef =
   | VarOrFunc of string * Ast_c.exp_type
   | EnumConstant of string * string option
 
+  (* also used for macro type aliases *)
   | TypeDef   of string * fullType
   (* the structType contains nested "idents" with struct scope *)
   | StructUnionNameDef of string * (structUnion * structType) wrap
@@ -354,7 +349,7 @@ let rec type_unfold_one_step ty env =
   | StructUnionName (su, s) -> 
       (try 
           let (((su,fields),ii), env') = lookup_structunion (su, s) env in
-          Ast_c.nQ, (StructUnion (su, Some s, fields), ii)
+          Ast_c.mk_ty (StructUnion (su, Some s, fields)) ii
           (* old: +> Ast_c.rewrap_typeC ty 
            * but must wrap with good ii, otherwise pretty_print_c
            * will be lost and raise some Impossible
@@ -466,15 +461,13 @@ let type_of_s a =
  * I now add a fake parse_info for such default int so no more failwith
  * normally.
  *)
-let offset (_,(ty,iis)) =
-  match ty, iis with
-  | TypeName (name, _typ), [] -> 
-      (match name with
-      | RegularName (s, [ii]) -> ii.Ast_c.pinfo
-      | _ -> raise Todo
-      )
-  | _, ii::_ -> ii.Ast_c.pinfo
-  | _ -> failwith "type has no text; need to think again"
+let offset ft = 
+  let (qu, ty) = ft in
+  (* bugfix: because of string->name, the ii can be deeper *)
+  let ii = Ast_c.get_local_ii_of_tybis_inlining_ii_of_name ty in
+  match ii with
+  | ii::_ -> ii.Ast_c.pinfo
+  | [] -> failwith "type has no text; need to think again"
   
 
 
@@ -629,13 +622,24 @@ let annotater_expr_visitor_subpart = (fun (k,bigf) expr ->
     | Constant (String (s,kind)) -> make_info_def (type_of_s "char *")
     | Constant MultiString _  -> make_info_def (type_of_s "char *")
     | Constant (Char   (s,kind)) -> make_info_def (type_of_s "char")
-    | Constant (Int (s))         -> make_info_def (type_of_s "int")
+    | Constant (Int (s,kind)) ->
+       (* this seems really unpleasant, but perhaps the type needs to be set
+          up in some way that allows pretty printing *)
+       make_info_def
+         (match kind with
+         (* matches limited by what is generated in lexer_c.mll *)
+           Si(Signed,CInt) -> type_of_s "int"
+         | Si(UnSigned,CInt) -> type_of_s "unsigned int"
+         | Si(Signed,CLong) -> type_of_s "long"
+         | Si(UnSigned,CLong) -> type_of_s "unsigned long"
+         | Si(Signed,CLongLong) -> type_of_s "long long"
+         | Si(UnSigned,CLongLong) -> type_of_s "unsigned long long"
+         | _ -> failwith "unexpected kind for constant")
     | Constant (Float (s,kind)) -> 
         let fake = Ast_c.fakeInfo (Common.fake_parse_info) in
         let fake = Ast_c.rewrap_str "float" fake in
         let iinull = [fake] in
-        make_info_def
-         (Ast_c.nQ, (BaseType (FloatType kind), iinull))
+        make_info_def (Ast_c.mk_ty (BaseType (FloatType kind)) iinull)
           
           
     (* -------------------------------------------------- *)
@@ -648,7 +652,9 @@ let annotater_expr_visitor_subpart = (fun (k,bigf) expr ->
      * Also as I don't want a warning on the Ident that are a FunCall,
      * easier to have a rule separate from the Ident rule.
      *)
-    | FunCall (((Ident (ident), typ), _ii) as e1, args) -> 
+    | FunCall (e1, args) -> 
+     (match Ast_c.unwrap_expr e1 with
+     | Ident (ident) -> 
         
         (* recurse *)
         args +> List.iter (fun (e,ii) -> 
@@ -715,10 +721,10 @@ let annotater_expr_visitor_subpart = (fun (k,bigf) expr ->
         )
 
 
-    | FunCall (e, args) -> 
+      | _e -> 
         k expr;
         
-        (Ast_c.get_type_expr e) +> Type_c.do_with_type (fun typ -> 
+        (Ast_c.get_type_expr e1) +> Type_c.do_with_type (fun typ -> 
           (* copy paste of above *)   
           (match unwrap_unfold_env typ with
           | FunctionType (ret, params) -> make_info_def ret
@@ -730,6 +736,7 @@ let annotater_expr_visitor_subpart = (fun (k,bigf) expr ->
           | _ -> Type_c.noTypeHere
           )
         )
+     )
 
 
     (* -------------------------------------------------- *)
@@ -800,7 +807,7 @@ let annotater_expr_visitor_subpart = (fun (k,bigf) expr ->
           let fake = Ast_c.fakeInfo Common.fake_parse_info in
           let fake = Ast_c.rewrap_str "*" fake in
           
-          let ft = (Ast_c.nQ, (Pointer t, [fake])) in
+          let ft = Ast_c.mk_ty (Pointer t) [fake] in
           make_info_def_fix ft
         )
 
@@ -867,10 +874,14 @@ let annotater_expr_visitor_subpart = (fun (k,bigf) expr ->
         k expr; 
         Ast_c.get_type_expr e2
           
+    | Binary (e1, Logical _, e2) -> 
+        k expr;
+        make_info_def (type_of_s "int")
+
     (* todo: lub *)
-    | Binary (e1, op, e2) -> 
+    | Binary (e1, Arith op, e2) -> 
         k expr;
-        Type_c.lub (Type_c.get_opt_type e1) (Type_c.get_opt_type e2)
+        Type_c.lub op (Type_c.get_opt_type e1) (Type_c.get_opt_type e2)
 
     | CondExpr (cond, e1opt, e2) -> 
         k expr;
@@ -1027,8 +1038,8 @@ let rec visit_toplevel ~just_add_in_env ~depth elem =
 
     (* ------------------------------------------------------------ *)
     Visitor_c.kstatement = (fun (k, bigf) st -> 
-      match st with 
-      | Compound statxs, ii -> do_in_new_scope (fun () -> k st);
+      match Ast_c.unwrap_st st with 
+      | Compound statxs -> do_in_new_scope (fun () -> k st);
       | _ -> k st
     );
     (* ------------------------------------------------------------ *)
@@ -1045,7 +1056,7 @@ let rec visit_toplevel ~just_add_in_env ~depth elem =
            let local =
              match local with
              | Ast_c.NotLocalDecl -> Ast_c.NotLocalVar
-             | Ast_c.LocalDecl -> Ast_c.LocalVar (offset t) 
+             | Ast_c.LocalDecl -> Ast_c.LocalVar (offset t)
             in
             
             var +> Common.do_option (fun (name, iniopt) -> 
@@ -1080,17 +1091,18 @@ let rec visit_toplevel ~just_add_in_env ~depth elem =
        * the ref of abstract-lined types, but the real one, so 
        * don't al_type here
        *)
-      let (_q, t) = typ in
-      match t with 
-      | StructUnion  (su, Some s, structType),ii -> 
+      let (_q, tbis) = typ in
+      match Ast_c.unwrap_typeC typ with 
+      | StructUnion  (su, Some s, structType) -> 
           let structType' = Lib.al_fields structType in 
+          let ii = Ast_c.get_ii_typeC_take_care tbis in
           let ii' = Lib.al_ii ii in
           add_binding (StructUnionNameDef (s, ((su, structType'),ii')))  true;
 
           if need_annotate_body
           then k typ (* todo: restrict ? new scope so use do_in_scope ? *)
 
-      | Enum (sopt, enums), ii -> 
+      | Enum (sopt, enums) -> 
 
           enums +> List.iter (fun ((name, eopt), iicomma) -> 
 
@@ -1137,7 +1149,7 @@ let rec visit_toplevel ~just_add_in_env ~depth elem =
           (match oldstyle with 
           | None -> 
               let typ' = 
-                Lib.al_type (Ast_c.nQ, (FunctionType ftyp, [i1;i2])) in
+                Lib.al_type (Ast_c.mk_ty (FunctionType ftyp) [i1;i2]) in
 
               add_binding (VarOrFunc (funcs, (typ',islocal i1.Ast_c.pinfo))) 
                 false;
@@ -1170,9 +1182,17 @@ let rec visit_toplevel ~just_add_in_env ~depth elem =
                 );
 
           );
+      | CppTop x -> 
+          (match x with
+          | Define ((s,ii), (DefineVar, DefineType t)) -> 
+              add_binding (TypeDef (s,Lib.al_type t)) true;
+          | _ -> k elem
+          )   
+
       | Declaration _
 
-      | CppTop _ 
+
+
       | IfdefTop _
       | MacroTop _ 
       | EmptyDef _
@@ -1236,14 +1256,14 @@ let annotate_test_expressions prog =
 
   let bigf = { Visitor_c.default_visitor_c with
     Visitor_c.kexpr = (fun (k,bigf) expr ->
-      (match unwrap expr with
-       (CondExpr(e,_,_),_) -> propagate_test e
+      (match unwrap_expr expr with
+       CondExpr(e,_,_) -> propagate_test e
       |        _ -> ()
       );
       k expr
     );
     Visitor_c.kstatement = (fun (k, bigf) st ->
-      match unwrap st with 
+      match unwrap_st st with 
        Selection(s) ->
          (match s with If(e1,s1,s2) -> propagate_test e1 | _ -> ());
          k st;
index 5edbdd2..29bc3d1 100644 (file)
@@ -1,6 +1,6 @@
-(* Yoann Padioleau 
+(* Yoann Padioleau, Julia Lawall
  *
- * Copyright (C) 2007, 2008, 2009 University of Urbana Champaign
+ * Copyright (C) 2007, 2008, 2009 University of Urbana Champaign and DIKU
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License (GPL)
@@ -16,6 +16,11 @@ open Common
 
 open Ast_c
 
+(*****************************************************************************)
+(* Wrappers *)
+(*****************************************************************************)
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_type
+
 (*****************************************************************************)
 (* Types *)
 (*****************************************************************************)
@@ -63,6 +68,28 @@ type completed_and_simplified = Ast_c.fullType
 type completed_typedef = Ast_c.fullType
 type removed_typedef = Ast_c.fullType
 
+(* move in ast_c ? 
+ * use Ast_c.nQ, Ast_c.defaultInt, Ast_c.emptyAnnotCocci, 
+ * Ast_c.emptyMetavarsBinding, Ast_c.emptyComments
+*)
+let (int_type: Ast_c.fullType) = 
+  (* Lib_parsing_c.al_type   (Parse_c.type_of_string "int")*)
+  Ast_c.mk_ty
+   (Ast_c.BaseType (Ast_c.IntType (Ast_c.Si (Ast_c.Signed, Ast_c.CInt))))
+   [Ast_c.al_info 0 (* al *)
+    {Ast_c.pinfo =
+     Ast_c.OriginTok
+      {Common.str = "int"; Common.charpos = 0; Common.line = -1;
+       Common.column = -1; Common.file = ""};
+    Ast_c.cocci_tag = 
+     {contents = Some (Ast_cocci.CONTEXT (Ast_cocci.NoPos, Ast_cocci.NOTHING), [])};
+    Ast_c.comments_tag = {contents = 
+        {Ast_c.mbefore = []; Ast_c.mafter = [];
+         Ast_c.mbefore2 = []; Ast_c.mafter2 = []
+        }}}]
+
+
+
 
 (* normally if the type annotated has done a good job, this should always
  * return true. Cf type_annotater_c.typedef_fix.
@@ -143,9 +170,6 @@ let noTypeHere =
   (None, Ast_c.NotTest)
 
 
-
-
-
 let do_with_type f (t,_test) = 
   match t with
   | None -> noTypeHere
@@ -164,12 +188,14 @@ let get_opt_type e =
 
 
 let structdef_to_struct_name ty = 
-  match ty with 
-  | qu, (StructUnion (su, sopt, fields), iis) -> 
-      (match sopt,iis with
+  let (qu, tybis) = ty in
+  match Ast_c.unwrap_typeC ty with 
+  | (StructUnion (su, sopt, fields)) -> 
+      let iis = Ast_c.get_ii_typeC_take_care tybis in
+      (match sopt, iis with
       (* todo? but what if correspond to a nested struct def ? *)
       | Some s , [i1;i2;i3;i4] -> 
-          qu, (StructUnionName (su, s), [i1;i2])
+          qu, Ast_c.mk_tybis (StructUnionName (su, s)) [i1;i2]
       | None, _ -> 
           ty
       | x -> raise Impossible
@@ -192,7 +218,7 @@ let type_of_function (def,ii) =
   let fake = Ast_c.fakeInfo (Common.fake_parse_info) in
   let fake_cparen = Ast_c.rewrap_str ")" fake in
 
-  Ast_c.nQ, (FunctionType ftyp, [fake_oparen;fake_cparen])
+  Ast_c.mk_ty (FunctionType ftyp) [fake_oparen;fake_cparen]
 
 
 (* pre: only a single variable *)
@@ -277,7 +303,7 @@ let (fake_function_type:
     rettype +> Common.map_option (fun rettype -> 
       let (ftyp: functionType) = (rettype, (tyargs, (false,[]))) in
       let (t: fullType) = 
-        (Ast_c.nQ, (FunctionType ftyp, [fake_oparen;fake_cparen]))  
+        Ast_c.mk_ty (FunctionType ftyp) [fake_oparen;fake_cparen]
       in
       t
     )
@@ -301,7 +327,7 @@ let (fake_function_type:
  * | (T.Pointer(ty1),ty2) -> T.Pointer(ty1)
  * 
 *)
-let lub t1 t2 = 
+let lub op t1 t2 =
   let ftopt = 
     match t1, t2 with
     | None, None -> None
@@ -321,9 +347,55 @@ let lub t1 t2 =
     | Some t1, Some t2 -> 
         let t1bis = Ast_c.unwrap_typeC t1 in
         let t2bis = Ast_c.unwrap_typeC t2 in
-        (match t1bis, t2bis with
+       (* a small attempt to do better, no consideration of typedefs *)
+        (match op, t1bis, t2bis with
+         (* these rules follow ANSI C.  See eg:
+            http://flexor.uwaterloo.ca/library/SGI_bookshelves/SGI_Developer/books/CLanguageRef/sgi_html/ch05.html *)
+         _,Ast_c.BaseType(bt1),Ast_c.BaseType(bt2) ->
+           (match bt1,bt2 with
+             Ast_c.Void,_ -> Some t2 (* something has gone wrong *)
+           | _,Ast_c.Void -> Some t1 (* something has gone wrong *)
+           | Ast_c.FloatType(Ast_c.CLongDouble),_ -> Some t1
+           | _,Ast_c.FloatType(Ast_c.CLongDouble) -> Some t2
+           | Ast_c.FloatType(Ast_c.CDouble),_ -> Some t1
+           | _,Ast_c.FloatType(Ast_c.CDouble) -> Some t2
+           | Ast_c.FloatType(Ast_c.CFloat),_ -> Some t1
+           | _,Ast_c.FloatType(Ast_c.CFloat) -> Some t2
+
+           | Ast_c.IntType(Ast_c.Si(Ast_c.UnSigned,Ast_c.CLongLong)),_ ->
+               Some t1
+           | _,Ast_c.IntType(Ast_c.Si(Ast_c.UnSigned,Ast_c.CLongLong)) ->
+               Some t2
+           | Ast_c.IntType(Ast_c.Si(Ast_c.Signed,Ast_c.CLongLong)),_ ->
+               Some t1
+           | _,Ast_c.IntType(Ast_c.Si(Ast_c.Signed,Ast_c.CLongLong)) ->
+               Some t2
+           | Ast_c.IntType(Ast_c.Si(Ast_c.UnSigned,Ast_c.CLong)),_ ->
+               Some t1
+           | _,Ast_c.IntType(Ast_c.Si(Ast_c.UnSigned,Ast_c.CLong)) ->
+               Some t2
+           | Ast_c.IntType(Ast_c.Si(Ast_c.Signed,Ast_c.CLong)),_ ->
+               Some t1
+           | _,Ast_c.IntType(Ast_c.Si(Ast_c.Signed,Ast_c.CLong)) ->
+               Some t2
+           | Ast_c.IntType(Ast_c.Si(Ast_c.UnSigned,Ast_c.CInt)),_ ->
+               Some t1
+           | _,Ast_c.IntType(Ast_c.Si(Ast_c.UnSigned,Ast_c.CInt)) ->
+               Some t2
+           | _ -> Some int_type)
+
+       | Ast_c.Plus,Ast_c.Pointer _,Ast_c.BaseType(Ast_c.IntType _) ->
+           Some t1
+       | Ast_c.Plus,Ast_c.BaseType(Ast_c.IntType _),Ast_c.Pointer _ ->
+           Some t2
+       | Ast_c.Minus,Ast_c.Pointer _,Ast_c.BaseType(Ast_c.IntType _) ->
+           Some t1
+       | Ast_c.Minus,Ast_c.BaseType(Ast_c.IntType _),Ast_c.Pointer _ ->
+           Some t2
+       | Ast_c.Minus,Ast_c.Pointer _,Ast_c.Pointer _ ->
+           Some int_type
         (* todo, Pointer, Typedef, etc *)
-        | _, _ -> Some t1
+        | _, _, _ -> Some t1
         )
 
   in
@@ -349,7 +421,7 @@ let (type_field:
     
   let rec aux_fields fields = 
     fields +> List.iter (fun x -> 
-      match Ast_c.unwrap x with
+      match x with
       | DeclarationField (FieldDeclList (onefield_multivars, iiptvirg)) -> 
           onefield_multivars +> List.iter (fun (fieldkind, iicomma) -> 
             match fieldkind with
@@ -380,8 +452,8 @@ let (type_field:
             | _ -> ()
           )
             
-      | EmptyField -> ()
-      | MacroStructDeclTodo -> pr2_once "DeclTodo"; ()
+      | EmptyField info -> ()
+      | MacroDeclField _ -> pr2_once "DeclTodo"; ()
           
       | CppDirectiveStruct _
       | IfdefStruct _ -> pr2_once "StructCpp"; 
index dfa6345..917e1b0 100644 (file)
@@ -21,7 +21,7 @@ val type_field:
 
 (* typing rules *)
 val lub: 
-  finalType option -> finalType option -> Ast_c.exp_info
+  Ast_c.arithOp -> finalType option -> finalType option -> Ast_c.exp_info
 
 (* helpers *)
 val structdef_to_struct_name: 
index 2c2a238..9380543 100644 (file)
@@ -27,6 +27,11 @@ labels found in the control-flow graph *)
 
 
 
+(*****************************************************************************)
+(* Wrappers *)
+(*****************************************************************************)
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_unparsing
+
 (*****************************************************************************)
 (* Types used during the intermediate phases of the unparsing *)
 (*****************************************************************************)
@@ -44,11 +49,15 @@ type token1 =
  * This type contains the whole information. Have all the tokens with this
  * type.
  *)
+type min =
+    Min of (int list (* match numbers *) * int (* adjacency information *))
+  | Ctx
+
 type token2 = 
-  | T2 of Parser_c.token * bool (* minus *) * 
+  | T2 of Parser_c.token * min * 
           int option (* orig index, abstracting away comments and space *)
   | Fake2
-  | Cocci2 of string
+  | Cocci2 of string * int (* line *) * int (* lcol *) * int (* rcol *)
   | C2 of string
   | Indent_cocci2
   | Unindent_cocci2
@@ -82,20 +91,27 @@ let info_of_token1 t =
 let str_of_token2 = function
   | T2 (t,_,_) -> TH.str_of_tok t
   | Fake2 -> ""
-  | Cocci2 s -> s
+  | Cocci2 (s,_,_,_) -> s
   | C2 s -> s
   | Indent_cocci2 -> ""
   | Unindent_cocci2 -> ""
 
 let print_token2 = function
-  | T2 (t,b,_) -> "T2:"^(if b then "-" else "")^TH.str_of_tok t
+  | T2 (t,b,_) ->
+      let b_str =
+       match b with
+         Min (index,adj) ->
+           Printf.sprintf "-%d[%s]" adj
+             (String.concat " " (List.map string_of_int index))
+       | Ctx -> "" in
+      "T2:"^b_str^TH.str_of_tok t
   | Fake2 -> ""
-  | Cocci2 s -> "Cocci2:"^s
+  | Cocci2 (s,_,lc,rc) -> Printf.sprintf "Cocci2:%d:%d%s" lc rc s
   | C2 s -> "C2:"^s
   | Indent_cocci2 -> "Indent"
   | Unindent_cocci2 -> "Unindent"
 
-let print_all_tokens2 l =
+let simple_print_all_tokens2 l =
   List.iter (function x -> Printf.printf "%s " (print_token2 x)) l;
   Printf.printf "\n"
 
@@ -132,8 +148,8 @@ let mcode_contain_plus = function
   | Ast_cocci.CONTEXT (_,Ast_cocci.NOTHING) -> false
   | Ast_cocci.CONTEXT _ -> true
 (* patch: when need full coccinelle transformation *)
-  | Ast_cocci.MINUS (_,[]) -> false
-  | Ast_cocci.MINUS (_,x::xs) -> true
+  | Ast_cocci.MINUS (_,_,_,[]) -> false
+  | Ast_cocci.MINUS (_,_,_,x::xs) -> true
   | Ast_cocci.PLUS -> raise Impossible
 
 let contain_plus info = 
@@ -242,6 +258,8 @@ let displace_fake_nodes toks =
     match fake_info with
       Some(bef,((Fake1 info) as fake),aft) ->
        (match !(info.cocci_tag) with
+        | Some x -> 
+          (match x with
          (Ast_cocci.CONTEXT(_,Ast_cocci.BEFORE _),_) ->
            (* move the fake node forwards *)
            let (whitespace,rest) = Common.span is_whitespace aft in
@@ -259,6 +277,9 @@ let displace_fake_nodes toks =
            failwith "fake node should not be before-after"
        | _ -> bef @ fake :: (loop aft) (* old: was removed when have simpler yacfe *)
         )
+        | None -> 
+            bef @ fake :: (loop aft)
+        )
     | None -> toks
     | _ -> raise Impossible in
   loop toks
@@ -315,11 +336,11 @@ let expand_mcode toks =
   in
 
   let expand_info t = 
-    let (mcode,env) = !((info_of_token1 t).cocci_tag) in
+    let (mcode,env) = 
+      Ast_c.mcode_and_env_of_cocciref ((info_of_token1 t).cocci_tag) in
 
-    let pr_cocci s = 
-      push2 (Cocci2 s) toks_out 
-    in
+    let pr_cocci s ln col rcol = 
+      push2 (Cocci2(s,ln,col,rcol)) toks_out  in
     let pr_c info = 
       (match Ast_c.pinfo_of_info info with
        Ast_c.AbstractLineTok _ ->
@@ -332,14 +353,26 @@ let expand_mcode toks =
       (!(info.Ast_c.comments_tag)).Ast_c.mafter +>
       List.iter (fun x -> Common.push2 (comment2t2 x) toks_out) in
 
+    let pr_barrier ln col = (* marks a position, used around C code *)
+      push2 (Cocci2("",ln,col,col)) toks_out  in
+    let pr_nobarrier ln col = () in (* not needed for linux spacing *)
 
+    let pr_cspace _ = push2 (C2 " ") toks_out in
 
-    let pr_space _ = push2 (C2 " ") toks_out in
+    let pr_space _ = () (* rely on add_space in cocci code *) in
+    let pr_arity _ = () (* not interested *) in
 
     let indent _   = push2 Indent_cocci2 toks_out in
     let unindent _ = push2 Unindent_cocci2 toks_out in
 
-    let args_pp = (env, pr_cocci, pr_c, pr_space, indent, unindent) in
+    let args_pp =
+      (env, pr_cocci, pr_c, pr_cspace,
+       (match !Flag_parsing_c.spacing with
+        Flag_parsing_c.SMPL -> pr_space | _ -> pr_cspace),
+       pr_arity,
+       (match !Flag_parsing_c.spacing with
+        Flag_parsing_c.SMPL -> pr_barrier | _ -> pr_nobarrier),
+       indent, unindent) in
 
     (* old: when for yacfe with partial cocci: 
      *    add_elem t false; 
@@ -348,25 +381,25 @@ let expand_mcode toks =
     (* patch: when need full coccinelle transformation *)
     let unparser = Unparse_cocci.pp_list_list_any args_pp false in
     match mcode with
-    | Ast_cocci.MINUS (_,any_xxs) -> 
+    | Ast_cocci.MINUS (_,inst,adj,any_xxs) -> 
         (* Why adding ? because I want to have all the information, the whole
          * set of tokens, so I can then process and remove the 
          * is_between_two_minus for instance *)
-        add_elem t true;
+        add_elem t (Min (inst,adj));
         unparser any_xxs Unparse_cocci.InPlace
     | Ast_cocci.CONTEXT (_,any_befaft) -> 
         (match any_befaft with
         | Ast_cocci.NOTHING -> 
-            add_elem t false
+            add_elem t Ctx
         | Ast_cocci.BEFORE xxs -> 
             unparser xxs Unparse_cocci.Before;
-            add_elem t false
+            add_elem t Ctx
         | Ast_cocci.AFTER xxs -> 
-            add_elem t false;
+            add_elem t Ctx;
             unparser xxs Unparse_cocci.After;
         | Ast_cocci.BEFOREAFTER (xxs, yys) -> 
             unparser xxs Unparse_cocci.Before;
-            add_elem t false;
+            add_elem t Ctx;
             unparser yys Unparse_cocci.After;
         )
     | Ast_cocci.PLUS -> raise Impossible
@@ -408,8 +441,8 @@ let all_coccis = function
 (*previously gave up if the first character was a newline, but not clear why*)
 let is_minusable_comment_or_plus x = is_minusable_comment x or all_coccis x
 
-let set_minus_comment = function
-  | T2 (t,false,idx) -> 
+let set_minus_comment adj = function
+  | T2 (t,Ctx,idx) -> 
       let str = TH.str_of_tok t in
       (match t with
       | Parser_c.TCommentSpace _
@@ -425,14 +458,14 @@ let set_minus_comment = function
                 (TH.line_of_tok t) str)
       | _ -> raise Impossible
       );
-      T2 (t, true, idx)
+      T2 (t, Min adj, idx)
 (* patch: coccinelle *)   
-  | T2 (Parser_c.TCommentNewline _,true,idx) as x -> x
+  | T2 (Parser_c.TCommentNewline _,Min adj,idx) as x -> x
   | _ -> raise Impossible
 
-let set_minus_comment_or_plus = function
+let set_minus_comment_or_plus adj = function
     Cocci2 _ | C2 _ | Indent_cocci2 | Unindent_cocci2 as x -> x
-  | x -> set_minus_comment x
+  | x -> set_minus_comment adj x
 
 let remove_minus_and_between_and_expanded_and_fake xs =
 
@@ -447,19 +480,20 @@ let remove_minus_and_between_and_expanded_and_fake xs =
 
   (*This drops the space before each completely minused block (no plus code).*)
   let minus_or_comment = function
-      T2(_,true,_) -> true
+      T2(_,Min adj,_) -> true
     | T2(Parser_c.TCommentNewline _,_b,_i) -> false
     | x -> is_minusable_comment x in
 
   let rec adjust_before_minus = function
       [] -> []
 (* patch: coccinelle  *)
-    | (T2(Parser_c.TCommentNewline c,_b,_i) as x)::((T2(_,true,_)::_) as xs) ->
+    | (T2(Parser_c.TCommentNewline c,_b,_i) as x)::
+      ((T2(_,Min adj,_)::_) as xs) ->
        let (between_minus,rest) = Common.span minus_or_comment xs in
        (match rest with
-         [] -> (set_minus_comment x) :: between_minus
+         [] -> (set_minus_comment adj x) :: between_minus
        | T2(Parser_c.TCommentNewline _,_b,_i)::_ ->
-           (set_minus_comment x) :: between_minus @
+           (set_minus_comment adj x) :: between_minus @
            (adjust_before_minus rest)
        | _ -> x :: between_minus @ (adjust_before_minus rest))
     | x::xs -> x::adjust_before_minus xs in
@@ -469,7 +503,7 @@ let remove_minus_and_between_and_expanded_and_fake xs =
   (* this drops blank lines after a brace introduced by removing code *)
   let rec adjust_after_brace = function
       [] -> []
-    | ((T2(_,false,_)) as x)::((T2(_,true,_)::_) as xs)
+    | ((T2(_,Ctx,_)) as x)::((T2(_,Min adj,_)::_) as xs)
        when str_of_token2 x =$= "{" ->
         let (between_minus,rest) = Common.span minus_or_comment xs in
         let is_whitespace = function
@@ -487,7 +521,7 @@ let remove_minus_and_between_and_expanded_and_fake xs =
                 let (drop_newlines,last_newline) = loop xs in
                 (drop_newlines,x::last_newline) in
           loop (List.rev newlines) in
-        x::between_minus@(List.map set_minus_comment drop_newlines)@
+        x::between_minus@(List.map (set_minus_comment adj) drop_newlines)@
         last_newline@
         adjust_after_brace rest
     | x::xs -> x::adjust_after_brace xs in
@@ -499,23 +533,27 @@ let remove_minus_and_between_and_expanded_and_fake xs =
   (* The use of is_minusable_comment_or_plus and set_minus_comment_or_plus
      is because the + code can end up anywhere in the middle of the - code;
      it is not necessarily to the far left *)
+
+  let common_adj (index1,adj1) (index2,adj2) =
+    adj1 = adj2 (* same adjacency info *) &&
+    (* non-empty intersection of witness trees *)
+    not ((Common.inter_set index1 index2) = []) in
+
   let rec adjust_between_minus xs =
     match xs with
     | [] -> []
-    | (T2 (t1,true,idx1))::xs -> 
-
+    | ((T2 (_,Min adj1,_)) as t1)::xs ->
         let (between_comments, rest) =
          Common.span is_minusable_comment_or_plus xs in
         (match rest with
-        | [] -> [(T2 (t1, true,idx1))]
+        | [] -> [t1]
 
-        | (T2 (t2, true,idx2))::rest ->
-            (T2 (t1, true,idx1))::
-            (List.map set_minus_comment_or_plus between_comments @
-             adjust_between_minus ((T2 (t2, true, idx2))::rest))
+        | ((T2 (_,Min adj2,_)) as t2)::rest when common_adj adj1 adj2 ->
+            t1::
+            (List.map (set_minus_comment_or_plus adj1) between_comments @
+             adjust_between_minus (t2::rest))
         | x::xs ->
-            (T2 (t1, true, idx1))::
-            (between_comments @ adjust_between_minus (x::xs))
+            t1::(between_comments @ adjust_between_minus (x::xs))
         )
 
     | x::xs -> x::adjust_between_minus xs in
@@ -523,7 +561,7 @@ let remove_minus_and_between_and_expanded_and_fake xs =
   let xs = adjust_between_minus xs in
 
   let xs = xs +> Common.exclude (function
-    | T2 (t,true,_) -> true
+    | T2 (t,Min adj,_) -> true
     | _ -> false
   ) in
   xs
@@ -533,12 +571,12 @@ let adjust_before_semicolon toks =
   let toks = List.rev toks in
   let rec loop = function
       [] -> []
-    | ((T2(_,false,_)) as x)::xs ->
+    | ((T2(_,Ctx,_)) as x)::xs ->
        if List.mem (str_of_token2 x) [";";")";","]
        then
          let (spaces, rest) = Common.span is_minusable_comment xs in
          (match rest with
-           (T2(_,true,_))::_ | (Cocci2 _)::_ ->
+           (T2(_,Min _,_))::_ | (Cocci2 _)::_ ->
              (* only drop spaces if something was actually changed before *)
              x :: loop rest
          | _ -> x :: loop xs)
@@ -552,6 +590,13 @@ let rec add_space xs =
   match xs with
   | [] -> []
   | [x] -> [x]
+  | (Cocci2(sx,lnx,_,rcolx) as x)::((Cocci2(sy,lny,lcoly,_)) as y)::xs
+    when !Flag_parsing_c.spacing = Flag_parsing_c.SMPL &&
+      not (lnx = -1) && lnx = lny && not (rcolx = -1) && rcolx < lcoly ->
+       (* this only works within a line.  could consider whether
+          something should be done to add newlines too, rather than
+          printing them explicitly in unparse_cocci. *)
+       x::C2 (String.make (lcoly-rcolx) ' ')::add_space (y::xs)
   | x::y::xs -> 
       let sx = str_of_token2 x in
       let sy = str_of_token2 y in
@@ -628,9 +673,10 @@ let rec adjust_indentation xs =
     | [] ->  []
 (* patch: coccinelle *)
     | ((T2 (tok,_,_)) as x)::(T2 (Parser_c.TCommentNewline s, _, _))::
-      (Cocci2 "{")::xs when started && str_of_token2 x =$= ")" ->
+      ((Cocci2 ("{",_,_,_)) as a)::xs
+      when started && str_of_token2 x =$= ")" ->
        (* to be done for if, etc, but not for a function header *)
-       x::(Cocci2 " {")::(aux started xs)
+       x::(C2 " ")::a::(aux started xs)
     | ((T2 (Parser_c.TCommentNewline s, _, _)) as x)::xs ->
        let old_tabbing = !_current_tabbing in 
         str_of_token2 x +> new_tabbing +> (fun s -> _current_tabbing := s);
@@ -647,7 +693,7 @@ let rec adjust_indentation xs =
          None -> aux started xs
        | Some (tu,_) ->
            _current_tabbing := (!_current_tabbing)^tu;
-           Cocci2 (tu)::aux started xs)
+           Cocci2 (tu,-1,-1,-1)::aux started xs)
     | Unindent_cocci2::xs ->
        (match !tabbing_unit with
          None -> aux started xs
@@ -655,7 +701,7 @@ let rec adjust_indentation xs =
            _current_tabbing := remtab tu (!_current_tabbing);
            aux started xs)
     (* border between existing code and cocci code *)
-    | ((T2 (tok,_,_)) as x)::((Cocci2 "\n") as y)::xs
+    | ((T2 (tok,_,_)) as x)::((Cocci2("\n",_,_,_)) as y)::xs
       when str_of_token2 x =$= "{" ->
        x::aux true (y::Indent_cocci2::xs)
     | ((Cocci2 _) as x)::((T2 (tok,_,_)) as y)::xs
@@ -663,11 +709,11 @@ let rec adjust_indentation xs =
        x::aux started (y::Unindent_cocci2::xs)
     (* starting the body of the function *)
     | ((T2 (tok,_,_)) as x)::xs when str_of_token2 x =$= "{" ->  x::aux true xs
-    | (Cocci2 "{")::xs -> (Cocci2 "{")::aux true xs
-    | ((Cocci2 "\n") as x)::xs -> 
+    | ((Cocci2("{",_,_,_)) as a)::xs -> a::aux true xs
+    | ((Cocci2("\n",_,_,_)) as x)::xs -> 
             (* dont inline in expr because of weird eval order of ocaml *)
         let s = !_current_tabbing in 
-        x::Cocci2 (s)::aux started xs
+        x::Cocci2 (s,-1,-1,-1)::aux started xs
     | x::xs -> x::aux started xs in
   aux false xs
 
index 89d25d4..9328523 100644 (file)
@@ -19,14 +19,20 @@ exception CantBeInPlus
 
 type pos = Before | After | InPlace
 
-let rec pp_list_list_any (env, pr, pr_elem, pr_space, indent, unindent)
+let unknown = -1
+
+let rec pp_list_list_any
+    (env, pr, pr_celem, pr_cspace, pr_space, pr_arity, pr_barrier,
+     indent, unindent)
     generating xxs before =
 
 (* Just to be able to copy paste the code from pretty_print_cocci.ml. *)
-let print_string = pr in
+let print_string s line lcol =
+  let rcol = if lcol = unknown then unknown else lcol + (String.length s) in
+  pr s line lcol rcol in
+let print_text s = pr s unknown unknown unknown in
 let close_box _ = () in
-let print_space() = pr " "  in
-let force_newline () = pr "\n" in
+let force_newline () = print_text "\n" in
 
 let start_block () = force_newline(); indent() in
 let end_block () = unindent(); force_newline () in
@@ -38,7 +44,7 @@ let print_between = Common.print_between in
 let outdent _ = () (* should go to leftmost col, does nothing now *) in
 
 let pretty_print_c =
-  Pretty_print_c.pretty_print_c pr_elem pr_space
+  Pretty_print_c.pretty_print_c pr_celem pr_cspace
     force_newline indent outdent unindent in
 
 (* --------------------------------------------------------------------- *)
@@ -68,7 +74,7 @@ and print_anything_list = function
          Ast.Rule_elemTag(_) | Ast.AssignOpTag(_) | Ast.BinaryOpTag(_)
        | Ast.ArithOpTag(_) | Ast.LogicalOpTag(_) | Ast.Token("{",_) -> true
        | _ -> false) in
-      if space then print_string " ";
+      if space then pr_space ();
       print_anything_list rest in
 
 let print_around printer term = function
@@ -79,25 +85,29 @@ let print_around printer term = function
       print_anything bef; printer term; print_anything aft in
 
 let print_string_befaft fn fn1 x info =
-  List.iter (function (s,_,_) -> fn1(); print_string s; force_newline())
+  List.iter
+    (function (s,ln,col) -> fn1(); print_string s ln col; force_newline())
     info.Ast.strbef;
   fn x;
-  List.iter (function (s,_,_) -> force_newline(); fn1(); print_string s)
+  List.iter
+    (function (s,ln,col) -> force_newline(); fn1(); print_string s ln col)
     info.Ast.straft in
 
-let print_meta (r,x) = print_string x in
+let print_meta (r,x) = print_text x in
 
 let print_pos = function
     Ast.MetaPos(name,_,_,_,_) ->
       let name = Ast.unwrap_mcode name in
-      print_string "@"; print_meta name
+      print_text "@"; print_meta name
   | _ -> () in
 
 (* --------------------------------------------------------------------- *)
 
-let mcode fn arg =
-  match (generating,arg) with
-    (false,(s,info,_,_)) ->
+let mcode fn (s,info,mc,pos) =
+  let line = info.Ast.line in
+  let lcol = info.Ast.column in
+  match (generating,mc) with
+    (false,_) ->
     (* printing for transformation *)
     (* Here we don't care about the annotation on s. *)
       let print_comments lb comments =
@@ -105,48 +115,60 @@ let mcode fn arg =
          (function line_before ->
            function (str,line,col) ->
              match line_before with
-               None -> print_string str; Some line
-             | Some lb when line =|= lb -> print_string str; Some line
-             | _ -> print_string "\n"; print_string str; Some line)
+               None -> print_string str line col; Some line
+             | Some lb when line =|= lb ->
+                 print_string str line col; Some line
+             | _ -> force_newline(); print_string str line col; Some line)
          lb comments in
       let line_before = print_comments None info.Ast.strbef in
       (match line_before with
        None -> ()
       |        Some lb when lb =|= info.Ast.line -> ()
-      |        _ -> print_string "\n");
-      fn s;
+      |        _ -> force_newline());
+      fn s line lcol;
       let _ = print_comments (Some info.Ast.line) info.Ast.straft in
       ()
       (* printing for rule generation *)
-  | (true, (x, _, Ast.MINUS(_,plus_stream), pos)) ->
-      print_string "\n- ";
-      fn x; print_pos pos;
+  | (true, Ast.MINUS(_,_,_,plus_stream)) ->
+      force_newline();
+      print_text "- ";
+      fn s line lcol; print_pos pos;
       print_anything plus_stream
-  | (true, (x, _, Ast.CONTEXT(_,plus_streams), pos)) ->
-      let fn x = print_string "\n "; fn x; print_pos pos in
-      print_around fn x plus_streams
-  | (true,( x, info, Ast.PLUS, pos)) ->
-      let fn x = print_string "\n+ "; fn x; print_pos pos in
-      print_string_befaft fn (function _ -> print_string "+ ") x info
+  | (true, Ast.CONTEXT(_,plus_streams)) ->
+      let fn s = force_newline(); fn s line lcol; print_pos pos in
+      print_around fn s plus_streams
+  | (true,Ast.PLUS) ->
+      let fn s =
+       force_newline(); print_text "+ "; fn s line lcol; print_pos pos in
+      print_string_befaft fn (function _ -> print_text "+ ") s info
 in
 
 
 (* --------------------------------------------------------------------- *)
 
 let handle_metavar name fn =
-  match (Common.optionise (fun () -> List.assoc (term name) env)) with
-  | None ->
+  let ((_,b) as s,info,mc,pos) = name in
+  let line = info.Ast.line in
+  let lcol = info.Ast.column in
+  match Common.optionise (fun () -> List.assoc s env) with
+    None ->
       let name_string (_,s) = s in
       if generating
-      then mcode (function _ -> pr (name_string (term name))) name
+      then
+       mcode (function _ -> print_string (name_string s)) name
       else
        failwith
          (Printf.sprintf "SP line %d: Not found a value in env for: %s"
-            (Ast_cocci.get_mcode_line name) (name_string (term name)))
+            line (name_string s))
   | Some e  ->
-      if generating
-      then mcode (function _ -> fn e) name
-      else fn e
+      pr_barrier line lcol;
+      (if generating
+      then
+       (* call mcode to preserve the -+ annotation *)
+       mcode (fun _ _ _ -> fn e) name
+      else fn e);
+      let rcol = if lcol = unknown then unknown else lcol + (String.length b) in
+      pr_barrier line rcol
 in
 (* --------------------------------------------------------------------- *)
 let dots between fn d =
@@ -161,17 +183,17 @@ let nest_dots multi fn f d =
   let mc s = if multi then s^"+>" else s^">" in
   match Ast.unwrap d with
     Ast.DOTS(l) ->
-      print_string (mo "..."); f(); start_block();
+      print_text (mo "..."); f(); start_block();
       print_between force_newline fn l;
-      end_block(); print_string (mc "...")
+      end_block(); print_text (mc "...")
   | Ast.CIRCLES(l) ->
-      print_string (mo "ooo"); f(); start_block();
+      print_text (mo "ooo"); f(); start_block();
       print_between force_newline fn l;
-      end_block(); print_string (mc "ooo")
+      end_block(); print_text (mc "ooo")
   | Ast.STARS(l) ->
-      print_string (mo "***"); f(); start_block();
+      print_text (mo "***"); f(); start_block();
       print_between force_newline fn l;
-      end_block(); print_string (mc "***")
+      end_block(); print_text (mc "***")
 in
 
 (* --------------------------------------------------------------------- *)
@@ -182,17 +204,17 @@ let rec ident i =
     Ast.Id(name) -> mcode print_string name
   | Ast.MetaId(name,_,_,_) -> 
       handle_metavar name (function
-        | (Ast_c.MetaIdVal id) -> pr id
+        | (Ast_c.MetaIdVal id) -> print_text id
         | _ -> raise Impossible
         ) 
   | Ast.MetaFunc(name,_,_,_) -> 
       handle_metavar name (function
-        | (Ast_c.MetaFuncVal id) -> pr id
+        | (Ast_c.MetaFuncVal id) -> print_text id
         | _ -> raise Impossible
         ) 
   | Ast.MetaLocalFunc(name,_,_,_) -> 
       handle_metavar name (function
-        | (Ast_c.MetaLocalFuncVal id) -> pr id
+        | (Ast_c.MetaLocalFuncVal id) -> print_text id
         | _ -> raise Impossible
         )
 
@@ -205,34 +227,30 @@ in
 (* Expression *)
 
 let print_disj_list fn l =
-  force_newline(); print_string "("; force_newline();
-  print_between
-    (function _ ->
-      force_newline(); print_string "|"; force_newline())
-    fn l;
-  force_newline(); print_string ")"; force_newline() in
+  print_text "\n(\n";
+  print_between (function _ -> print_text "\n|\n") fn l;
+  print_text "\n)\n" in
 
 let rec expression e =
   match Ast.unwrap e with
     Ast.Ident(id) -> ident id
-
   | Ast.Constant(const) -> mcode constant const
   | Ast.FunCall(fn,lp,args,rp) ->
       expression fn; mcode print_string_box lp;
       dots (function _ -> ()) expression args;
       close_box(); mcode print_string rp
   | Ast.Assignment(left,op,right,_) ->
-      expression left; print_string " "; mcode assignOp op;
-      print_string " "; expression right
+      expression left; pr_space(); mcode assignOp op;
+      pr_space(); expression right
   | Ast.CondExpr(exp1,why,exp2,colon,exp3) ->
-      expression exp1; print_string " "; mcode print_string why;
-      print_option (function e -> print_string " "; expression e) exp2;
-      print_string " "; mcode print_string colon; expression exp3
+      expression exp1; pr_space(); mcode print_string why;
+      print_option (function e -> pr_space(); expression e) exp2;
+      pr_space(); mcode print_string colon; expression exp3
   | Ast.Postfix(exp,op) -> expression exp; mcode fixOp op
   | Ast.Infix(exp,op) -> mcode fixOp op; expression exp
   | Ast.Unary(exp,op) -> mcode unaryOp op; expression exp
   | Ast.Binary(left,op,right) ->
-      expression left; print_string " "; mcode binaryOp op; print_string " ";
+      expression left; pr_space(); mcode binaryOp op; pr_space();
       expression right
   | Ast.Nested(left,op,right) -> failwith "nested only in minus code"
   | Ast.Paren(lp,exp,rp) ->
@@ -273,7 +291,7 @@ let rec expression e =
         | _ -> raise Impossible
       )
 
-  | Ast.EComma(cm) -> mcode print_string cm; print_space()
+  | Ast.EComma(cm) -> mcode print_string cm; pr_space()
 
   | Ast.DisjExpr(exp_list) ->
       if generating
@@ -281,7 +299,7 @@ let rec expression e =
       else raise CantBeInPlus
   | Ast.NestExpr(expr_dots,Some whencode,multi) when generating ->
       nest_dots multi expression
-       (function _ -> print_string "   when != "; expression whencode)
+       (function _ -> print_text "   when != "; expression whencode)
        expr_dots
   | Ast.NestExpr(expr_dots,None,multi) when generating ->
       nest_dots multi expression (function _ -> ()) expr_dots
@@ -292,7 +310,7 @@ let rec expression e =
       if generating
       then
        (mcode print_string dots;
-        print_string "   when != ";
+        print_text "   when != ";
         expression whencode)
       else raise CantBeInPlus
   | Ast.Edots(dots,None)
@@ -315,7 +333,9 @@ and  unaryOp = function
 
 and  assignOp = function
     Ast.SimpleAssign -> print_string "="
-  | Ast.OpAssign(aop) -> arithOp aop; print_string "="
+  | Ast.OpAssign(aop) ->
+      (function line -> function lcol ->
+       arithOp aop line lcol; print_string "=" line lcol)
 
 and  fixOp = function
     Ast.Dec -> print_string "--"
@@ -348,7 +368,7 @@ and  logicalOp = function
   | Ast.OrLog -> print_string "||"
 
 and constant = function
-    Ast.String(s) -> print_string "\""; print_string s; print_string "\""
+    Ast.String(s) -> print_string ("\""^s^"\"")
   | Ast.Char(s) -> print_string s
   | Ast.Int(s) -> print_string s
   | Ast.Float(s) -> print_string s
@@ -390,13 +410,13 @@ and typeC ty =
   | Ast.Array(ty,lb,size,rb) ->
       fullType ty; mcode print_string lb; print_option expression size;
       mcode print_string rb
-  | Ast.EnumName(kind,name) -> mcode print_string kind; print_string " ";
+  | Ast.EnumName(kind,name) -> mcode print_string kind; pr_space();
       ident name
   | Ast.StructUnionName(kind,name) ->
       mcode structUnion kind;
       print_option ident name
   | Ast.StructUnionDef(ty,lb,decls,rb) ->
-      fullType ty;
+      fullType ty; ft_space ty;
       mcode print_string lb;
       dots force_newline declaration decls;
       mcode print_string rb
@@ -452,10 +472,10 @@ and print_named_type ty id =
       (match Ast.unwrap ty1 with
        Ast.FunctionPointer(ty,lp1,star,rp1,lp2,params,rp2) ->
          print_function_pointer (ty,lp1,star,rp1,lp2,params,rp2)
-           (function _ -> print_string " "; ident id)
+           (function _ -> pr_space(); ident id)
       | Ast.FunctionType(am,ty,lp1,params,rp1) ->
          print_function_type (ty,lp1,params,rp1)
-           (function _ -> print_string " "; ident id)
+           (function _ -> pr_space(); ident id)
       | Ast.Array(_,_,_,_) ->
          let rec loop ty k =
            match Ast.unwrap ty with
@@ -480,23 +500,23 @@ and print_named_type ty id =
 and ty_space ty =
   match Ast.unwrap ty with
     Ast.Pointer(_,_) -> ()
-  | _ -> print_space()
+  | _ -> pr_space()
 
 and ft_space ty =
   match Ast.unwrap ty with
     Ast.Type(cv,ty) ->
       (match Ast.unwrap ty with
        Ast.Pointer(_,_) -> ()
-      | _ -> print_space())
-  | _ -> print_space()
+      | _ -> pr_space())
+  | _ -> pr_space()
 
 and declaration d =
   match Ast.unwrap d with
     Ast.Init(stg,ty,id,eq,ini,sem) ->
       print_option (mcode storage) stg;
       print_named_type ty id;
-      print_string " "; mcode print_string eq;
-      print_string " "; initialiser true ini; mcode print_string sem
+      pr_space(); mcode print_string eq;
+      pr_space(); initialiser true ini; mcode print_string sem
   | Ast.UnInit(stg,ty,id,sem) ->
       print_option (mcode storage) stg;
       print_named_type ty id;
@@ -537,8 +557,8 @@ and initialiser nlcomma i =
       end_block(); mcode print_string rb
   | Ast.InitList(lb,initlist,rb,_) -> failwith "unexpected whencode in plus"
   | Ast.InitGccExt(designators,eq,ini) ->
-      List.iter designator designators; print_string " ";
-      mcode print_string eq; print_string " "; initialiser nlcomma ini
+      List.iter designator designators; pr_space();
+      mcode print_string eq; pr_space(); initialiser nlcomma ini
   | Ast.InitGccName(name,eq,ini) ->
       ident name; mcode print_string eq; initialiser nlcomma ini
   | Ast.IComma(comma) ->
@@ -569,7 +589,7 @@ and parameterTypeDef p =
   | Ast.MetaParamList(name,_,_,_) -> 
       failwith "not handling MetaParamList"
 
-  | Ast.PComma(cm) -> mcode print_string cm; print_space()
+  | Ast.PComma(cm) -> mcode print_string cm; pr_space()
   | Ast.Pdots(dots) | Ast.Pcircles(dots) when generating ->
       mcode print_string dots
   | Ast.Pdots(dots) | Ast.Pcircles(dots) -> raise CantBeInPlus
@@ -584,17 +604,13 @@ in
 
 let rec inc_file = function
     Ast.Local(elems) ->
-      print_string "\"";
-      print_between (function _ -> print_string "/") inc_elem elems;
-      print_string "\""
+      print_string ("\""^(String.concat "/" (List.map inc_elem elems))^"\"")
   | Ast.NonLocal(elems) ->
-      print_string "<";
-      print_between (function _ -> print_string "/") inc_elem elems;
-      print_string ">"
+      print_string ("<"^(String.concat "/" (List.map inc_elem elems))^">")
 
 and inc_elem = function
-    Ast.IncPath s -> print_string s
-  | Ast.IncDots -> print_string "..."
+    Ast.IncPath s -> s
+  | Ast.IncDots -> "..."
 
 (* --------------------------------------------------------------------- *)
 (* Top-level code *)
@@ -602,94 +618,91 @@ and inc_elem = function
 and rule_elem arity re =
   match Ast.unwrap re with
     Ast.FunHeader(_,_,fninfo,name,lp,params,rp) ->
-      print_string arity; List.iter print_fninfo fninfo;
+      pr_arity arity; List.iter print_fninfo fninfo;
       ident name; mcode print_string_box lp;
       parameter_list params; close_box(); mcode print_string rp;
-      print_string " "
-  | Ast.Decl(_,_,decl) -> print_string arity; declaration decl
+      pr_space()
+  | Ast.Decl(_,_,decl) -> pr_arity arity; declaration decl
 
   | Ast.SeqStart(brace) ->
-      print_string arity; mcode print_string brace; start_block()
+      pr_arity arity; mcode print_string brace; start_block()
   | Ast.SeqEnd(brace) ->
-      end_block(); print_string arity; mcode print_string brace
+      end_block(); pr_arity arity; mcode print_string brace
 
   | Ast.ExprStatement(exp,sem) ->
-      print_string arity; expression exp; mcode print_string sem
+      pr_arity arity; expression exp; mcode print_string sem
 
   | Ast.IfHeader(iff,lp,exp,rp) ->
-      print_string arity;
-      mcode print_string iff; print_string " "; mcode print_string_box lp;
+      pr_arity arity;
+      mcode print_string iff; pr_space(); mcode print_string_box lp;
       expression exp; close_box(); mcode print_string rp
   | Ast.Else(els) ->
-      print_string arity; mcode print_string els
+      pr_arity arity; mcode print_string els
 
   | Ast.WhileHeader(whl,lp,exp,rp) ->
-      print_string arity;
-      mcode print_string whl; print_string " "; mcode print_string_box lp;
+      pr_arity arity;
+      mcode print_string whl; pr_space(); mcode print_string_box lp;
       expression exp; close_box(); mcode print_string rp
   | Ast.DoHeader(d) ->
-      print_string arity; mcode print_string d
+      pr_arity arity; mcode print_string d
   | Ast.WhileTail(whl,lp,exp,rp,sem) ->
-      print_string arity;
-      mcode print_string whl; print_string " "; mcode print_string_box lp;
+      pr_arity arity;
+      mcode print_string whl; pr_space(); mcode print_string_box lp;
       expression exp; close_box(); mcode print_string rp;
       mcode print_string sem
   | Ast.ForHeader(fr,lp,e1,sem1,e2,sem2,e3,rp) ->
-      print_string arity;
+      pr_arity arity;
       mcode print_string fr; mcode print_string_box lp;
       print_option expression e1; mcode print_string sem1;
       print_option expression e2; mcode print_string sem2;
       print_option expression e3; close_box();
       mcode print_string rp
   | Ast.IteratorHeader(nm,lp,args,rp) ->
-      print_string arity;
-      ident nm; print_string " "; mcode print_string_box lp;
+      pr_arity arity;
+      ident nm; pr_space(); mcode print_string_box lp;
       dots (function _ -> ()) expression args; close_box();
       mcode print_string rp
 
   | Ast.SwitchHeader(switch,lp,exp,rp) ->
-      print_string arity;
-      mcode print_string switch; print_string " "; mcode print_string_box lp;
+      pr_arity arity;
+      mcode print_string switch; pr_space(); mcode print_string_box lp;
       expression exp; close_box(); mcode print_string rp
 
   | Ast.Break(br,sem) ->
-      print_string arity; mcode print_string br; mcode print_string sem
+      pr_arity arity; mcode print_string br; mcode print_string sem
   | Ast.Continue(cont,sem) ->
-      print_string arity; mcode print_string cont; mcode print_string sem
+      pr_arity arity; mcode print_string cont; mcode print_string sem
   | Ast.Label(l,dd) -> ident l; mcode print_string dd
   | Ast.Goto(goto,l,sem) ->
       mcode print_string goto; ident l; mcode print_string sem
   | Ast.Return(ret,sem) ->
-      print_string arity; mcode print_string ret; 
+      pr_arity arity; mcode print_string ret; 
       mcode print_string sem
   | Ast.ReturnExpr(ret,exp,sem) ->
-      print_string arity; mcode print_string ret; print_string " ";
+      pr_arity arity; mcode print_string ret; pr_space();
       expression exp; mcode print_string sem
 
-  | Ast.Exp(exp) -> print_string arity; expression exp
-  | Ast.TopExp(exp) -> print_string arity; expression exp
-  | Ast.Ty(ty) -> print_string arity; fullType ty
+  | Ast.Exp(exp) -> pr_arity arity; expression exp
+  | Ast.TopExp(exp) -> pr_arity arity; expression exp
+  | Ast.Ty(ty) -> pr_arity arity; fullType ty
   | Ast.TopInit(init) -> initialiser false init
   | Ast.Include(inc,s) ->
-      mcode print_string inc; print_string " "; mcode inc_file s
+      mcode print_string inc; print_text " "; mcode inc_file s
   | Ast.DefineHeader(def,id,params) ->
-      mcode print_string def; print_string " "; ident id; 
+      mcode print_string def; pr_space(); ident id; 
       print_define_parameters params
   | Ast.Default(def,colon) ->
-      mcode print_string def; mcode print_string colon; print_string " "
+      mcode print_string def; mcode print_string colon; pr_space()
   | Ast.Case(case,exp,colon) ->
-      mcode print_string case; print_string " "; expression exp;
-      mcode print_string colon; print_string " "
+      mcode print_string case; pr_space(); expression exp;
+      mcode print_string colon; pr_space()
   | Ast.DisjRuleElem(res) ->
       if generating
       then
-       (print_string arity;
-        force_newline(); print_string "("; force_newline();
-        print_between
-          (function _ -> force_newline(); print_string "|"; force_newline())
-          (rule_elem arity)
+       (pr_arity arity; print_text "\n(\n";
+        print_between (function _ -> print_text "\n|\n") (rule_elem arity)
           res;
-        force_newline(); print_string ")")
+        print_text "\n)")
       else raise CantBeInPlus
 
   | Ast.MetaRuleElem(name,_,_) ->
@@ -718,27 +731,26 @@ and print_define_param param =
   | Ast.DPComma(comma) -> mcode print_string comma
   | Ast.DPdots(dots) -> mcode print_string dots
   | Ast.DPcircles(circles) -> mcode print_string circles
-  | Ast.OptDParam(dp) -> print_string "?"; print_define_param dp
-  | Ast.UniqueDParam(dp) -> print_string "!"; print_define_param dp
+  | Ast.OptDParam(dp) -> print_text "?"; print_define_param dp
+  | Ast.UniqueDParam(dp) -> print_text "!"; print_define_param dp
 
 and print_fninfo = function
     Ast.FStorage(stg) -> mcode storage stg
   | Ast.FType(ty) -> fullType ty
-  | Ast.FInline(inline) -> mcode print_string inline; print_string " "
-  | Ast.FAttr(attr) -> mcode print_string attr; print_string " " in
+  | Ast.FInline(inline) -> mcode print_string inline; pr_space()
+  | Ast.FAttr(attr) -> mcode print_string attr; pr_space() in
 
 let indent_if_needed s f =
   match Ast.unwrap s with
-    Ast.Seq(lbrace,decls,body,rbrace) -> pr_space(); f()
+    Ast.Seq(lbrace,body,rbrace) -> pr_space(); f()
   | _ ->
       (*no newline at the end - someone else will do that*)
       start_block(); f(); unindent() in
 
 let rec statement arity s =
   match Ast.unwrap s with
-    Ast.Seq(lbrace,decls,body,rbrace) ->
+    Ast.Seq(lbrace,body,rbrace) ->
       rule_elem arity lbrace;
-      dots force_newline (statement arity) decls;
       dots force_newline (statement arity) body;
       rule_elem arity rbrace
 
@@ -748,10 +760,9 @@ let rec statement arity s =
   | Ast.IfThenElse(header,branch1,els,branch2,_) ->
       rule_elem arity header;
       indent_if_needed branch1 (function _ -> statement arity branch1);
-      print_string " ";
+      force_newline();
       rule_elem arity els;
       indent_if_needed branch2 (function _ -> statement arity branch2)
-
   | Ast.While(header,body,_) ->
       rule_elem arity header;
       indent_if_needed body (function _ -> statement arity body)
@@ -765,43 +776,40 @@ let rec statement arity s =
   | Ast.Iterator(header,body,(_,_,_,aft)) ->
       rule_elem arity header;
       indent_if_needed body (function _ -> statement arity body);
-      mcode (function _ -> ()) ((),Ast.no_info,aft,Ast.NoMetaPos)
+      mcode (fun _ _ _ -> ()) ((),Ast.no_info,aft,Ast.NoMetaPos)
 
   | Ast.Switch(header,lb,cases,rb) ->
-      rule_elem arity header; print_string " "; rule_elem arity lb;
+      rule_elem arity header; pr_space(); rule_elem arity lb;
       List.iter (function x -> case_line arity x; force_newline()) cases;
       rule_elem arity rb
 
   | Ast.Atomic(re) -> rule_elem arity re
 
-  | Ast.FunDecl(header,lbrace,decls,body,rbrace) ->
+  | Ast.FunDecl(header,lbrace,body,rbrace) ->
       rule_elem arity header; rule_elem arity lbrace;
-      dots force_newline (statement arity) decls;
       dots force_newline (statement arity) body; rule_elem arity rbrace
 
   | Ast.Define(header,body) ->
-      rule_elem arity header; print_string " ";
+      rule_elem arity header; pr_space();
       dots force_newline (statement arity) body
 
   | Ast.Disj([stmt_dots]) ->
       if generating
       then
-       (print_string arity;
+       (pr_arity arity;
         dots force_newline (statement arity) stmt_dots)
       else raise CantBeInPlus
   | Ast.Disj(stmt_dots_list) -> (* ignores newline directive for readability *)
       if generating
       then
-       (print_string arity;
-        force_newline(); print_string "("; force_newline();
-        print_between
-          (function _ -> force_newline();print_string "|"; force_newline())
+       (pr_arity arity; print_text "\n(\n";
+        print_between (function _ -> print_text "\n|\n")
           (dots force_newline (statement arity))
           stmt_dots_list;
-        force_newline(); print_string ")")
+        print_text "\n)")
       else raise CantBeInPlus
   | Ast.Nest(stmt_dots,whn,multi,_,_) when generating ->
-      print_string arity;
+      pr_arity arity;
       nest_dots multi (statement arity)
        (function _ ->
          print_between force_newline
@@ -812,7 +820,7 @@ let rec statement arity s =
   | Ast.Dots(d,whn,_,_) | Ast.Circles(d,whn,_,_) | Ast.Stars(d,whn,_,_) ->
       if generating
       then
-       (print_string arity; mcode print_string d;
+       (pr_arity arity; mcode print_string d;
         print_between force_newline
           (whencode (dots force_newline (statement "")) (statement "")) whn;
         force_newline())
@@ -823,25 +831,25 @@ let rec statement arity s =
 
 and whencode notfn alwaysfn = function
     Ast.WhenNot a ->
-      print_string "   WHEN != "; notfn a
+      print_text "   WHEN != "; notfn a
   | Ast.WhenAlways a ->
-      print_string "   WHEN = "; alwaysfn a
-  | Ast.WhenModifier x -> print_string "   WHEN "; print_when_modif x
+      print_text "   WHEN = "; alwaysfn a
+  | Ast.WhenModifier x -> print_text "   WHEN "; print_when_modif x
   | Ast.WhenNotTrue a ->
-      print_string "   WHEN != TRUE "; rule_elem "" a
+      print_text "   WHEN != TRUE "; rule_elem "" a
   | Ast.WhenNotFalse a ->
-      print_string "   WHEN != FALSE "; rule_elem "" a
+      print_text "   WHEN != FALSE "; rule_elem "" a
 
 and print_when_modif = function
-  | Ast.WhenAny    -> print_string "ANY"
-  | Ast.WhenStrict -> print_string "STRICT"
-  | Ast.WhenForall -> print_string "FORALL"
-  | Ast.WhenExists -> print_string "EXISTS"
+  | Ast.WhenAny    -> print_text "ANY"
+  | Ast.WhenStrict -> print_text "STRICT"
+  | Ast.WhenForall -> print_text "FORALL"
+  | Ast.WhenExists -> print_text "EXISTS"
 
 and case_line arity c =
   match Ast.unwrap c with
     Ast.CaseLine(header,code) ->
-      rule_elem arity header; print_string " ";
+      rule_elem arity header; pr_space();
       dots force_newline (statement arity) code
   | Ast.OptCase(case) -> raise CantBeInPlus in
 
@@ -865,45 +873,44 @@ let if_open_brace  = function "{" -> true | _ -> false in
 let rec pp_any = function
   (* assert: normally there is only CONTEXT NOTHING tokens in any *)
     Ast.FullTypeTag(x) -> fullType x; false
-  | Ast.BaseTypeTag(x) -> baseType x; false
-  | Ast.StructUnionTag(x) -> structUnion x; false
-  | Ast.SignTag(x) -> sign x; false
+  | Ast.BaseTypeTag(x) -> baseType x unknown unknown; false
+  | Ast.StructUnionTag(x) -> structUnion x unknown unknown; false
+  | Ast.SignTag(x) -> sign x unknown unknown; false
 
   | Ast.IdentTag(x) -> ident x; false
 
   | Ast.ExpressionTag(x) -> expression x; false
 
-  | Ast.ConstantTag(x) -> constant x; false
-  | Ast.UnaryOpTag(x) -> unaryOp x; false
-  | Ast.AssignOpTag(x) -> assignOp x; false
-  | Ast.FixOpTag(x) -> fixOp x; false
-  | Ast.BinaryOpTag(x) -> binaryOp x; false
-  | Ast.ArithOpTag(x) -> arithOp x; false
-  | Ast.LogicalOpTag(x) -> logicalOp x; false
+  | Ast.ConstantTag(x) -> constant x unknown unknown; false
+  | Ast.UnaryOpTag(x) -> unaryOp x unknown unknown; false
+  | Ast.AssignOpTag(x) -> assignOp x unknown unknown; false
+  | Ast.FixOpTag(x) -> fixOp x unknown unknown; false
+  | Ast.BinaryOpTag(x) -> binaryOp x unknown unknown; false
+  | Ast.ArithOpTag(x) -> arithOp x unknown unknown; false
+  | Ast.LogicalOpTag(x) -> logicalOp x unknown unknown; false
 
   | Ast.InitTag(x) -> initialiser false x; false
   | Ast.DeclarationTag(x) -> declaration x; false
 
-  | Ast.StorageTag(x) -> storage x; false
-  | Ast.IncFileTag(x) -> inc_file x; false
+  | Ast.StorageTag(x) -> storage x unknown unknown; false
+  | Ast.IncFileTag(x) -> inc_file x unknown unknown; false
 
   | Ast.Rule_elemTag(x) -> rule_elem "" x; false
   | Ast.StatementTag(x) -> statement "" x; false
   | Ast.CaseLineTag(x) -> case_line "" x; false
 
-  | Ast.ConstVolTag(x) -> const_vol x; false
-  | Ast.Pragma(xs) -> print_between force_newline print_string xs; false
-  | Ast.Token(x,None) -> print_string x; if_open_brace x
+  | Ast.ConstVolTag(x) -> const_vol x unknown unknown; false
+  | Ast.Pragma(xs) -> print_between force_newline print_text xs; false
+  | Ast.Token(x,None) -> print_text x; if_open_brace x
   | Ast.Token(x,Some info) -> 
       mcode
-       (function x ->
+       (fun x line lcol ->
          (match x with
-           "else" -> pr "\n"
+           "else" -> force_newline()
          | _ -> ());
-         print_string x;
-         (* if x ==~ Common.regexp_alpha then print_string " "; *)
+         print_string x line lcol;
          (match x with
-           (*"return" |*) "else" -> print_string " "
+           "else" -> pr_space()
          | _ -> ()))
        (let nomcodekind = Ast.CONTEXT(Ast.DontCarePos,Ast.NOTHING) in
        (x,info,nomcodekind,Ast.NoMetaPos));
@@ -915,8 +922,8 @@ let rec pp_any = function
      normally there should be no '...' inside them *)
   | Ast.ExprDotsTag(x) -> dots (function _ -> ()) expression x; false
   | Ast.ParamDotsTag(x) -> parameter_list x; false
-  | Ast.StmtDotsTag(x) -> dots (function _ -> pr "\n") (statement "") x; false
-  | Ast.DeclDotsTag(x) -> dots (function _ -> pr "\n") declaration x; false
+  | Ast.StmtDotsTag(x) -> dots force_newline (statement "") x; false
+  | Ast.DeclDotsTag(x) -> dots force_newline declaration x; false
 
   | Ast.TypeCTag(x) -> typeC x; false
   | Ast.ParamTag(x) -> parameterTypeDef x; false
@@ -939,13 +946,14 @@ in
        | _ -> false in
       let prnl x =
        (if unindent_before x then unindent());
-       pr "\n" in
+       force_newline() in
       let newline_before _ =
        if before =*= After
        then
          let hd = List.hd xxs in
          match hd with
-            (Ast.StatementTag s::_) when isfn s -> pr "\n\n"
+            (Ast.StatementTag s::_) when isfn s ->
+             force_newline(); force_newline()
          | (Ast.Pragma _::_)
           | (Ast.Rule_elemTag _::_) | (Ast.StatementTag _::_)
          | (Ast.InitTag _::_)
@@ -956,10 +964,12 @@ in
        then
          match List.rev(List.hd(List.rev xxs)) with
            (Ast.StatementTag s::_) ->
-             if isfn s then pr "\n\n" else pr "\n"
+             (if isfn s then force_newline());
+             force_newline()
          | (Ast.Pragma _::_)
           | (Ast.Rule_elemTag _::_) | (Ast.InitTag _::_)
-         | (Ast.DeclarationTag _::_) | (Ast.Token ("{",_)::_) -> pr "\n"
+         | (Ast.DeclarationTag _::_) | (Ast.Token ("{",_)::_) ->
+             force_newline()
           | _ -> () in
       (* print a newline at the beginning, if needed *)
       newline_before();
@@ -970,10 +980,10 @@ in
            (if leading_newline
            then
              match (indent_needed,unindent_before x) with
-               (true,true) -> pr "\n"
-             | (true,false) -> pr "\n"; indent()
-             | (false,true) -> unindent(); pr "\n"
-             | (false,false) -> pr "\n");
+               (true,true) -> force_newline()
+             | (true,false) -> force_newline(); indent()
+             | (false,true) -> unindent(); force_newline()
+             | (false,false) -> force_newline());
            let indent_needed =
              List.fold_left (function indent_needed -> pp_any) false x in
            loop true indent_needed xs in
index 9500a99..f2544b7 100644 (file)
@@ -3,9 +3,14 @@ exception CantBeInPlus
 type pos = Before | After | InPlace
 
 val pp_list_list_any :
-  Ast_c.metavars_binding * 
-  (string -> unit) (* pr cocci *) * Pretty_print_c.pr_elem_func (* pr c *) *
+  Ast_c.metavars_binding *
+  (* pr cocci *)
+  (string -> int (*line*) -> int (*lcol*) -> int (*rcol*) -> unit) *
+    Pretty_print_c.pr_elem_func (* pr c *) *
+    (unit -> unit) (* pr C space *) *
     (unit -> unit) (* pr space *) *
+    (string -> unit) (* pr arity *) *
+    (int (*line*) -> int (*lcol*) -> unit) (* pr barrier *) *
     (unit -> unit) (* indent *) * (unit -> unit) (* unindent *) -> 
   bool (*true if generating*) -> Ast_cocci.anything list list -> pos ->
   unit
index 21fd4b7..54cbec1 100644 (file)
@@ -77,7 +77,7 @@ let get_function_name rule env =
       [] any_list_list in
   let mcode r mc =
     match Ast.get_mcodekind mc with
-      Ast.MINUS(_,any_list_list) -> do_any_list_list r any_list_list
+      Ast.MINUS(_,_,_,any_list_list) -> do_any_list_list r any_list_list
     | Ast.CONTEXT(_,any_befaft) ->
        (match any_befaft with
          Ast.BEFORE(any_list_list) | Ast.AFTER(any_list_list) ->
@@ -457,9 +457,10 @@ let pp_rule local_metas ast env srcfile =
       |        _ ->
          Printf.printf "line: %s\n" (Common.dump info);
          error rule "not an abstract line" in
+    let pr_space _ = pr " " in
     Unparse_cocci.pp_list_list_any
-      (env, pr, pr_c, (function _ -> pr " "),
-       (function _ -> ()), (function _ -> ()))
+      (env, (fun s _ _ _ -> pr s), pr_c, pr_space, pr_space, pr,
+       (fun _ _ -> ()), (function _ -> ()), (function _ -> ()))
       true printable Unparse_cocci.InPlace;
     print_end pr;
     pr "\n")
index 923b9c4..08ebbe8 100644 (file)
@@ -25,6 +25,11 @@ module F = Control_flow_c
  * disable_go_type_annotation ?
  *)
 
+(*****************************************************************************)
+(* Wrappers *)
+(*****************************************************************************)
+let pr2, pr2_once = Common.mk_pr2_wrappers Flag_parsing_c.verbose_visit
+
 (*****************************************************************************)
 (* Functions to visit the Ast, and now also the CFG nodes *)
 (*****************************************************************************)
@@ -358,7 +363,9 @@ and vk_statement = fun bigf (st: Ast_c.statement) ->
     let (unwrap_st, ii) = st in
     iif ii;
     match unwrap_st with
-    | Labeled (Label (s, st)) -> statf  st;
+    | Labeled (Label (name, st)) -> 
+        vk_name bigf name;
+        statf  st;
     | Labeled (Case  (e, st)) -> vk_expr bigf e; statf st;
     | Labeled (CaseRange  (e, e2, st)) -> 
         vk_expr bigf e; vk_expr bigf e2; statf st;
@@ -376,9 +383,9 @@ and vk_statement = fun bigf (st: Ast_c.statement) ->
         vk_expr bigf e; statf st;
     | Iteration  (DoWhile (st, e)) -> statf st; vk_expr bigf e; 
     | Iteration  (For ((e1opt,i1), (e2opt,i2), (e3opt,i3), st)) -> 
-        statf (ExprStatement (e1opt),i1); 
-        statf (ExprStatement (e2opt),i2); 
-        statf (ExprStatement (e3opt),i3); 
+        statf (mk_st (ExprStatement (e1opt)) i1); 
+        statf (mk_st (ExprStatement (e2opt)) i2); 
+        statf (mk_st (ExprStatement (e3opt)) i3); 
         statf st;
 
     | Iteration  (MacroIteration (s, es, st)) -> 
@@ -557,17 +564,15 @@ and vk_struct_field = fun bigf field ->
   let f = bigf.kfield in
   let rec k field = 
 
-    let (xfield, ii) = field in
-    iif ii;
-    match xfield with 
+    match field with 
     | DeclarationField 
         (FieldDeclList (onefield_multivars, iiptvirg)) -> 
         vk_struct_fieldkinds bigf onefield_multivars;
           iif iiptvirg;
-    | EmptyField -> ()
-    | MacroStructDeclTodo -> 
-        pr2_once "MacroStructDeclTodo";
-        ()
+    | EmptyField info -> iif [info]
+    | MacroDeclField ((s, args),ii) -> 
+        iif ii;
+        vk_argument_list bigf args;
 
     | CppDirectiveStruct directive -> 
         vk_cpp_directive bigf directive
@@ -603,7 +608,7 @@ and vk_def = fun bigf d ->
   let f = bigf.kdef in
   let rec k d = 
     match d with
-    | {f_name = s;
+    | {f_name = name;
        f_type = (returnt, (paramst, (b, iib)));
        f_storage = sto;
        f_body = statxs;
@@ -615,6 +620,7 @@ and vk_def = fun bigf d ->
         iif iib;
         attrs +> List.iter (vk_attribute bigf);
         vk_type bigf returnt;
+        vk_name bigf name;
         paramst +> List.iter (fun (param,iicomma) -> 
           vk_param bigf param;
           iif iicomma;
@@ -1086,8 +1092,8 @@ and vk_statement_s = fun bigf st ->
     let (unwrap_st, ii) = st in
     let st' = 
       match unwrap_st with
-      | Labeled (Label (s, st)) -> 
-          Labeled (Label (s, statf st))
+      | Labeled (Label (name, st)) -> 
+          Labeled (Label (vk_name_s bigf name, statf st))
       | Labeled (Case  (e, st)) -> 
           Labeled (Case  ((vk_expr_s bigf) e , statf st))
       | Labeled (CaseRange  (e, e2, st)) -> 
@@ -1108,12 +1114,21 @@ and vk_statement_s = fun bigf st ->
       | Iteration (DoWhile (st, e))  -> 
           Iteration  (DoWhile (statf st, (vk_expr_s bigf) e))
       | Iteration (For ((e1opt,i1), (e2opt,i2), (e3opt,i3), st)) -> 
-          let e1opt' = statf (ExprStatement (e1opt),i1) in
-          let e2opt' = statf (ExprStatement (e2opt),i2) in
-          let e3opt' = statf (ExprStatement (e3opt),i3) in
-          (match (e1opt', e2opt', e3opt') with
-          | ((ExprStatement x1,i1), (ExprStatement x2,i2), ((ExprStatement x3,i3))) -> 
-              Iteration (For ((x1,i1), (x2,i2), (x3,i3), statf st))
+          let e1opt' = statf (mk_st (ExprStatement (e1opt)) i1) in
+          let e2opt' = statf (mk_st (ExprStatement (e2opt)) i2) in
+          let e3opt' = statf (mk_st (ExprStatement (e3opt)) i3) in
+
+          let e1' = Ast_c.unwrap_st e1opt' in
+          let e2' = Ast_c.unwrap_st e2opt' in
+          let e3' = Ast_c.unwrap_st e3opt' in
+          let i1' = Ast_c.get_ii_st_take_care e1opt' in
+          let i2' = Ast_c.get_ii_st_take_care e2opt' in
+          let i3' = Ast_c.get_ii_st_take_care e3opt' in
+
+          (match (e1', e2', e3') with
+          | ((ExprStatement x1), (ExprStatement x2), ((ExprStatement x3))) -> 
+              Iteration (For ((x1,i1'), (x2,i2'), (x3,i3'), statf st))
+
           | x -> failwith "cant be here if iterator keep ExprStatement as is"
          )
 
@@ -1349,24 +1364,26 @@ and vk_struct_fields_s = fun bigf fields ->
 
   let iif ii = vk_ii_s bigf ii in
 
-  fields +> List.map (fun (xfield, iiptvirg) -> 
-    
-    (match xfield with
+  fields +> List.map (fun (field) -> 
+    (match field with
     | (DeclarationField (FieldDeclList (onefield_multivars, iiptvirg))) -> 
         DeclarationField
           (FieldDeclList 
               (vk_struct_fieldkinds_s bigf onefield_multivars, iif iiptvirg))
-    | EmptyField -> EmptyField
-    | MacroStructDeclTodo -> 
-        pr2_once "MacroStructDeclTodo";
-        MacroStructDeclTodo
+    | EmptyField info -> EmptyField (vk_info_s bigf info)
+    | MacroDeclField ((s, args),ii) -> 
+        MacroDeclField
+          ((s, 
+           args +> List.map (fun (e,ii) -> vk_argument_s bigf e, iif ii)
+           ),
+          iif ii)
 
     | CppDirectiveStruct directive -> 
         CppDirectiveStruct (vk_cpp_directive_s bigf directive)
     | IfdefStruct ifdef -> 
         IfdefStruct (vk_ifdef_directive_s bigf ifdef)
 
-    ), iif iiptvirg
+    )
   )
 
 
@@ -1375,7 +1392,7 @@ and vk_def_s = fun bigf d ->
   let iif ii = vk_ii_s bigf ii in
   let rec k d = 
     match d with
-    | {f_name = s;
+    | {f_name = name;
        f_type = (returnt, (paramst, (b, iib)));
        f_storage = sto;
        f_body = statxs;
@@ -1383,7 +1400,7 @@ and vk_def_s = fun bigf d ->
        f_old_c_style = oldstyle;
       }, ii  
         -> 
-        {f_name = s;
+        {f_name = vk_name_s bigf name;
          f_type = 
             (vk_type_s bigf returnt, 
             (paramst +> List.map (fun (param, iicomma) ->
index 777990c..d2f80c2 100644 (file)
@@ -1,3 +1,4 @@
+adjacency.cmi: ast0_cocci.cmi 
 adjust_pragmas.cmi: ast0_cocci.cmi 
 arity.cmi: ast0_cocci.cmi 
 ast0_cocci.cmi: type_cocci.cmi ast_cocci.cmi 
@@ -31,6 +32,10 @@ unitary_ast0.cmi: ast0_cocci.cmi
 unparse_ast0.cmi: ast0_cocci.cmi 
 visitor_ast.cmi: ast_cocci.cmi 
 visitor_ast0.cmi: visitor_ast0_types.cmo ast_cocci.cmi ast0_cocci.cmi 
+adjacency.cmo: visitor_ast0_types.cmo visitor_ast0.cmi ast0_cocci.cmi \
+    adjacency.cmi 
+adjacency.cmx: visitor_ast0_types.cmx visitor_ast0.cmx ast0_cocci.cmx \
+    adjacency.cmi 
 adjust_pragmas.cmo: visitor_ast0_types.cmo visitor_ast0.cmi ast0_cocci.cmi \
     adjust_pragmas.cmi 
 adjust_pragmas.cmx: visitor_ast0_types.cmx visitor_ast0.cmx ast0_cocci.cmx \
@@ -125,7 +130,7 @@ parse_cocci.cmo: visitor_ast0_types.cmo visitor_ast0.cmi unitary_ast0.cmi \
     ../globals/flag.cmo disjdistr.cmi data.cmi context_neg.cmi \
     compute_lines.cmi ../commons/common.cmi comm_assoc.cmi check_meta.cmi \
     ast_cocci.cmi ast0toast.cmi ast0_cocci.cmi arity.cmi adjust_pragmas.cmi \
-    parse_cocci.cmi 
+    adjacency.cmi parse_cocci.cmi 
 parse_cocci.cmx: visitor_ast0_types.cmx visitor_ast0.cmx unitary_ast0.cmx \
     type_infer.cmx test_exps.cmx single_statement.cmx simple_assignments.cmx \
     semantic_cocci.cmx pretty_print_cocci.cmx parse_aux.cmx iso_pattern.cmx \
@@ -134,7 +139,7 @@ parse_cocci.cmx: visitor_ast0_types.cmx visitor_ast0.cmx unitary_ast0.cmx \
     ../globals/flag.cmx disjdistr.cmx data.cmx context_neg.cmx \
     compute_lines.cmx ../commons/common.cmx comm_assoc.cmx check_meta.cmx \
     ast_cocci.cmx ast0toast.cmx ast0_cocci.cmx arity.cmx adjust_pragmas.cmx \
-    parse_cocci.cmi 
+    adjacency.cmx parse_cocci.cmi 
 plus.cmo: visitor_ast.cmi ast_cocci.cmi plus.cmi 
 plus.cmx: visitor_ast.cmx ast_cocci.cmx plus.cmi 
 pretty_print_cocci.cmo: type_cocci.cmi ../globals/flag.cmo \
index cf02ae3..51a86b4 100644 (file)
@@ -35,7 +35,7 @@ adjust_pragmas.ml insert_plus.ml function_prototypes.ml \
 unify_ast.ml semantic_cocci.ml data.ml free_vars.ml parse_aux.ml disjdistr.ml \
 $(LEXER_SOURCES:.mll=.ml) $(PARSER_SOURCES:.mly=.ml) \
 $(SCRIPT_LEXER_SOURCES:.mll=.ml) \
-get_constants.ml get_constants2.ml parse_cocci.ml
+get_constants.ml get_constants2.ml adjacency.ml parse_cocci.ml
 
 LIBS=../commons/commons.cma ../globals/globals.cma
 SYSLIBS = str.cma unix.cma
@@ -116,7 +116,7 @@ $(PARSER_SOURCES:.mly=.ml) $(PARSER_SOURCES:.mly=.mli) : $(PARSER_SOURCES)
 $(SCRIPT_LEXER_SOURCES:.mll=.ml): $(SCRIPT_LEXER_SOURCES)
        $(OCAMLLEX) $(SCRIPT_LEXER_SOURCES)
 
-clean::
+distclean::
        rm -f $(GENERATED)
 
 # clean rule for others files
diff --git a/parsing_cocci/adjacency.ml b/parsing_cocci/adjacency.ml
new file mode 100644 (file)
index 0000000..211cabb
--- /dev/null
@@ -0,0 +1,32 @@
+module Ast0 = Ast0_cocci
+module V0 = Visitor_ast0
+module VT0 = Visitor_ast0_types
+
+let compute_adjacency p =
+  let counter = ref 0 in
+  let mcode (a,b,c,d,e,_) = (a,b,c,d,e,!counter) in
+  let string_mcode ((str,_,info,mc,_,_) as x) =
+    match str with
+      "..." | "<..." | "...>" | "<+..." | "...+>" ->
+       (match mc with
+         Ast0.MINUS _ -> mcode x
+       | Ast0.CONTEXT _ -> counter := !counter + 1; x
+       | _ -> failwith "unexpected mcode for ...")
+    | _ -> mcode x in
+  let fn =
+    V0.rebuilder
+      {V0.rebuilder_functions with
+       VT0.rebuilder_meta_mcode = mcode;
+       VT0.rebuilder_string_mcode = string_mcode;
+       VT0.rebuilder_const_mcode = mcode;
+       VT0.rebuilder_assign_mcode = mcode;
+       VT0.rebuilder_fix_mcode = mcode;
+       VT0.rebuilder_unary_mcode = mcode;
+       VT0.rebuilder_binary_mcode = mcode;
+       VT0.rebuilder_cv_mcode = mcode;
+       VT0.rebuilder_sign_mcode = mcode;
+       VT0.rebuilder_struct_mcode = mcode;
+       VT0.rebuilder_storage_mcode = mcode;
+       VT0.rebuilder_inc_mcode = mcode;} in
+  List.map fn.VT0.rebuilder_rec_top_level p
+
diff --git a/parsing_cocci/adjacency.mli b/parsing_cocci/adjacency.mli
new file mode 100644 (file)
index 0000000..f076530
--- /dev/null
@@ -0,0 +1 @@
+val compute_adjacency : Ast0_cocci.rule -> Ast0_cocci.rule
index 8688e5c..7ea7419 100644 (file)
@@ -10,15 +10,15 @@ let call_right processor data s cont =
     None -> None
   | Some(pragmas,data) -> Some (pragmas,Ast0.rewrap s (cont data))
 
-let left_mcode (a,b,info,mcodekind,d) =
+let left_mcode (a,b,info,mcodekind,d,e) =
   match (info.Ast0.strings_before,mcodekind) with
     ([],_) | (_,Ast0.PLUS) -> None
-  | (l,_) -> Some(l,(a,b,{info with Ast0.strings_before = []},mcodekind,d))
+  | (l,_) -> Some(l,(a,b,{info with Ast0.strings_before = []},mcodekind,d,e))
 
-let right_mcode (a,b,info,mcodekind,d) =
+let right_mcode (a,b,info,mcodekind,d,e) =
   match (info.Ast0.strings_after,mcodekind) with
     ([],_) | (_,Ast0.PLUS) -> None
-  | (l,_) -> Some(l,(a,b,{info with Ast0.strings_after = []},mcodekind,d))
+  | (l,_) -> Some(l,(a,b,{info with Ast0.strings_after = []},mcodekind,d,e))
 
 let update_before pragmas (info,x) =
   ({info with Ast0.strings_before = pragmas @ info.Ast0.strings_before},
index 65863ec..c8da41d 100644 (file)
@@ -80,8 +80,8 @@ let allopt l fn =
 (* --------------------------------------------------------------------- *)
 (* Mcode *)
 
-let mcode2line (_,_,info,_,_) = info.Ast0.pos_info.Ast0.line_start
-let mcode2arity (_,arity,_,_,_) = arity
+let mcode2line (_,_,info,_,_,_) = info.Ast0.pos_info.Ast0.line_start
+let mcode2arity (_,arity,_,_,_,_) = arity
 
 let mcode x = x (* nothing to do ... *)
 
index cee3396..4256525 100644 (file)
@@ -52,7 +52,12 @@ type info = { pos_info : position_info;
              strings_before : (string * position_info) list;
              strings_after : (string * position_info) list }
 
-type 'a mcode = 'a * arity * info * mcodekind * meta_pos ref (* pos, - only *)
+(* adjacency index is incremented when we skip over dots or nest delimiters
+it is used in deciding how much to remove, when two adjacent code tokens are
+removed. *)
+type 'a mcode =
+    'a * arity * info * mcodekind * meta_pos ref (* pos, - only *) *
+      int (* adjacency_index *)
 (* int ref is an index *)
 and 'a wrap =
     { node : 'a;
@@ -470,15 +475,17 @@ let context_wrap x =
     true_if_test_exp = false;
     iso_info = [] }
 let unwrap x = x.node
-let unwrap_mcode (x,_,_,_,_) = x
+let unwrap_mcode (x,_,_,_,_,_) = x
 let rewrap model x = { model with node = x }
-let rewrap_mcode (_,arity,info,mcodekind,pos) x = (x,arity,info,mcodekind,pos)
+let rewrap_mcode (_,arity,info,mcodekind,pos,adj) x =
+  (x,arity,info,mcodekind,pos,adj)
 let copywrap model x =
   { model with node = x; index = ref !(model.index);
     mcodekind = ref !(model.mcodekind); exp_ty = ref !(model.exp_ty)}
-let get_pos (_,_,_,_,x) = !x
-let get_pos_ref (_,_,_,_,x) = x
-let set_pos pos (m,arity,info,mcodekind,_) = (m,arity,info,mcodekind,ref pos)
+let get_pos (_,_,_,_,x,_) = !x
+let get_pos_ref (_,_,_,_,x,_) = x
+let set_pos pos (m,arity,info,mcodekind,_,adj) =
+  (m,arity,info,mcodekind,ref pos,adj)
 let get_info x      = x.info
 let set_info x info = {x with info = info}
 let get_line x      = x.info.pos_info.line_start
@@ -486,7 +493,7 @@ let get_line_end x  = x.info.pos_info.line_end
 let get_index x     = !(x.index)
 let set_index x i   = x.index := i
 let get_mcodekind x = !(x.mcodekind)
-let get_mcode_mcodekind (_,_,_,mcodekind,_) = mcodekind
+let get_mcode_mcodekind (_,_,_,mcodekind,_,_) = mcodekind
 let get_mcodekind_ref x = x.mcodekind
 let set_mcodekind x mk  = x.mcodekind := mk
 let set_type x t        = x.exp_ty := t
@@ -501,7 +508,7 @@ let get_test_exp x      = x.true_if_test_exp
 let set_test_exp x      = {x with true_if_test_exp = true}
 let get_iso x           = x.iso_info
 let set_iso x i = if !Flag.track_iso_usage then {x with iso_info = i} else x
-let set_mcode_data data (_,ar,info,mc,pos) = (data,ar,info,mc,pos)
+let set_mcode_data data (_,ar,info,mc,pos,adj) = (data,ar,info,mc,pos,adj)
 
 (* --------------------------------------------------------------------- *)
 
@@ -596,8 +603,8 @@ and const_vol t =
 (* this function is a rather minimal attempt.  the problem is that information
 has been lost.  but since it is only used for metavariable types in the isos,
 perhaps it doesn't matter *)
-and make_mcode x = (x,NONE,default_info(),context_befaft(),ref NoMetaPos)
-let make_mcode_info x info = (x,NONE,info,context_befaft(),ref NoMetaPos)
+and make_mcode x = (x,NONE,default_info(),context_befaft(),ref NoMetaPos,-1)
+let make_mcode_info x info = (x,NONE,info,context_befaft(),ref NoMetaPos,-1)
 
 exception TyConv
 
index f6db914..6fadc1a 100644 (file)
@@ -27,7 +27,10 @@ type info = { pos_info : position_info;
              strings_before : (string * position_info) list;
              strings_after : (string * position_info) list }
 
-type 'a mcode = 'a * arity * info * mcodekind * meta_pos ref (* pos, - only *)
+type 'a mcode =
+    'a * arity * info * mcodekind * meta_pos ref (* pos, - only *) *
+      int (* adjacency_index *)
+
 and 'a wrap =
     { node : 'a;
       info : info;
index d8a0ed9..0809e95 100644 (file)
@@ -180,7 +180,7 @@ let check_allminus =
   let donothing r k e = k e in
   let bind x y = x && y in
   let option_default = true in
-  let mcode (_,_,_,mc,_) =
+  let mcode (_,_,_,mc,_,_) =
     match mc with
       Ast0.MINUS(r) -> let (plusses,_) = !r in plusses = []
     | _ -> false in
@@ -236,28 +236,28 @@ let convert_info info =
   { Ast.line = info.Ast0.pos_info.Ast0.line_start;
     Ast.column = info.Ast0.pos_info.Ast0.column;
     Ast.strbef = strings_to_s info.Ast0.strings_before;
-    Ast.straft = strings_to_s info.Ast0.strings_after; }
+    Ast.straft = strings_to_s info.Ast0.strings_after;}
 
-let convert_mcodekind = function
+let convert_mcodekind adj = function
     Ast0.MINUS(replacements) ->
       let (replacements,_) = !replacements in
-      Ast.MINUS(Ast.NoPos,replacements)
+      Ast.MINUS(Ast.NoPos,[],adj,replacements)
   | Ast0.PLUS -> Ast.PLUS
   | Ast0.CONTEXT(befaft) ->
       let (befaft,_,_) = !befaft in Ast.CONTEXT(Ast.NoPos,befaft)
   | Ast0.MIXED(_) -> failwith "not possible for mcode"
 
-let pos_mcode(term,_,info,mcodekind,pos) =
+let pos_mcode(term,_,info,mcodekind,pos,adj) =
   (* avoids a recursion problem *)
-  (term,convert_info info,convert_mcodekind mcodekind,Ast.NoMetaPos)
+  (term,convert_info info,convert_mcodekind adj mcodekind,Ast.NoMetaPos)
 
-let mcode(term,_,info,mcodekind,pos) =
+let mcode (term,_,info,mcodekind,pos,adj) =
   let pos =
     match !pos with
       Ast0.MetaPos(pos,constraints,per) ->
        Ast.MetaPos(pos_mcode pos,constraints,per,unitary,false)
     | _ -> Ast.NoMetaPos in
-  (term,convert_info info,convert_mcodekind mcodekind,pos)
+  (term,convert_info info,convert_mcodekind adj mcodekind,pos)
 
 (* --------------------------------------------------------------------- *)
 (* Dots *)
@@ -597,16 +597,16 @@ and statement s =
       (match Ast0.unwrap s with
        Ast0.Decl((_,bef),decl) ->
          Ast.Atomic(rewrap_rule_elem s
-                      (Ast.Decl(convert_mcodekind bef,
+                      (Ast.Decl(convert_mcodekind (-1) bef,
                                 check_allminus.VT0.combiner_rec_statement s,
                                 declaration decl)))
       | Ast0.Seq(lbrace,body,rbrace) ->
          let lbrace = mcode lbrace in
-         let (decls,body) = separate_decls seqible body in
+         let body = dots (statement seqible) body in
          let rbrace = mcode rbrace in
          Ast.Seq(iso_tokenwrap lbrace s (Ast.SeqStart(lbrace))
                    (do_isos (Ast0.get_iso s)),
-                 decls,body,
+                 body,
                  tokenwrap rbrace s (Ast.SeqEnd(rbrace)))
       | Ast0.ExprStatement(exp,sem) ->
          Ast.Atomic(rewrap_rule_elem s
@@ -616,7 +616,7 @@ and statement s =
            (rewrap_rule_elem s
               (Ast.IfHeader(mcode iff,mcode lp,expression exp,mcode rp)),
             statement Ast.NotSequencible branch,
-            ([],[],[],convert_mcodekind aft))
+            ([],[],[],convert_mcodekind (-1) aft))
       | Ast0.IfThenElse(iff,lp,exp,rp,branch1,els,branch2,(_,aft)) ->
          let els = mcode els in
          Ast.IfThenElse
@@ -625,13 +625,13 @@ and statement s =
             statement Ast.NotSequencible branch1,
             tokenwrap els s (Ast.Else(els)),
             statement Ast.NotSequencible branch2,
-            ([],[],[],convert_mcodekind aft))
+            ([],[],[],convert_mcodekind (-1) aft))
       | Ast0.While(wh,lp,exp,rp,body,(_,aft)) ->
          Ast.While(rewrap_rule_elem s
                      (Ast.WhileHeader
                         (mcode wh,mcode lp,expression exp,mcode rp)),
                    statement Ast.NotSequencible body,
-                   ([],[],[],convert_mcodekind aft))
+                   ([],[],[],convert_mcodekind (-1) aft))
       | Ast0.Do(d,body,wh,lp,exp,rp,sem) ->
          let wh = mcode wh in
          Ast.Do(rewrap_rule_elem s (Ast.DoHeader(mcode d)),
@@ -651,7 +651,7 @@ and statement s =
          let body = statement Ast.NotSequencible body in
          Ast.For(rewrap_rule_elem s
                    (Ast.ForHeader(fr,lp,exp1,sem1,exp2,sem2,exp3,rp)),
-                 body,([],[],[],convert_mcodekind aft))
+                 body,([],[],[],convert_mcodekind (-1) aft))
       | Ast0.Iterator(nm,lp,args,rp,body,(_,aft)) ->
          Ast.Iterator(rewrap_rule_elem s
                      (Ast.IteratorHeader
@@ -659,7 +659,7 @@ and statement s =
                          dots expression args,
                          mcode rp)),
                    statement Ast.NotSequencible body,
-                   ([],[],[],convert_mcodekind aft))
+                   ([],[],[],convert_mcodekind (-1) aft))
       |        Ast0.Switch(switch,lp,exp,rp,lb,cases,rb) ->
          let switch = mcode switch in
          let lp = mcode lp in
@@ -743,14 +743,14 @@ and statement s =
          let params = parameter_list params in
          let rp = mcode rp in
          let lbrace = mcode lbrace in
-         let (decls,body) = separate_decls seqible body in
+         let body = dots (statement seqible) body in
          let rbrace = mcode rbrace in
          let allminus = check_allminus.VT0.combiner_rec_statement s in
          Ast.FunDecl(rewrap_rule_elem s
-                       (Ast.FunHeader(convert_mcodekind bef,
+                       (Ast.FunHeader(convert_mcodekind (-1) bef,
                                       allminus,fi,name,lp,params,rp)),
                      tokenwrap lbrace s (Ast.SeqStart(lbrace)),
-                     decls,body,
+                     body,
                      tokenwrap rbrace s (Ast.SeqEnd(rbrace)))
       |        Ast0.Include(inc,str) ->
          Ast.Atomic(rewrap_rule_elem s (Ast.Include(mcode inc,mcode str)))
@@ -818,6 +818,20 @@ and statement s =
       | Ast0.CIRCLES(x) -> Ast.CIRCLES(process_list seqible isos x)
       | Ast0.STARS(x) -> Ast.STARS(process_list seqible isos x))
 
+  (* the following is no longer used.
+   the goal was to let one put a statement at the very beginning of a function
+   pattern and have it skip over the declarations in the C code.
+   that feature was removed a long time ago, however, in favor of
+   ... when != S, which also causes whatever comes after it to match the
+   first real statement.
+   the separation of declarations from the rest of the body means that the
+   quantifier of any variable shared between them comes out too high, posing
+   problems when there is ... decl ... stmt, as the quantifier of any shared
+   variable will be around the whole thing, making variables not free enough
+   in the first ..., and thus not implementing the expected shortest path
+   condition.  example: f() { ... int A; ... foo(A); }.
+   the quantifier for A should start just before int A, not at the top of the
+   function.
   and separate_decls seqible d =
     let rec collect_decls = function
        [] -> ([],[])
@@ -855,7 +869,7 @@ and statement s =
     match Ast0.unwrap d with
       Ast0.DOTS(x) -> process x d (function x -> Ast.DOTS x)
     | Ast0.CIRCLES(x) -> process x d (function x -> Ast.CIRCLES x)
-    | Ast0.STARS(x) -> process x d (function x -> Ast.STARS x) in
+    | Ast0.STARS(x) -> process x d (function x -> Ast.STARS x) *) in
 
   statement Ast.Sequencible s
 
index 164be27..0d9bd39 100644 (file)
@@ -54,8 +54,11 @@ and 'a befaft =
 and 'a mcode = 'a * info * mcodekind * meta_pos (* pos variable *)
  (* pos is an offset indicating where in the C code the mcodekind has an
  effect *)
+(* int list is the match instances, which are only meaningful in annotated
+C code *)
+(* int is the adjacency index, which is incremented on context dots *)
  and mcodekind =
-    MINUS       of pos * anything list list
+    MINUS       of pos * int list * int * anything list list
   | CONTEXT     of pos * anything befaft
   | PLUS
  and fixpos =
@@ -433,7 +436,7 @@ and metaStmtInfo =
 and rule_elem = base_rule_elem wrap
 
 and base_statement =
-    Seq           of rule_elem (* { *) * statement dots *
+    Seq           of rule_elem (* { *) *
                     statement dots * rule_elem (* } *)
   | IfThen        of rule_elem (* header *) * statement * end_info (* endif *)
   | IfThenElse    of rule_elem (* header *) * statement *
@@ -450,7 +453,7 @@ and base_statement =
                     (statement dots,statement) whencode list * multi *
                     dots_whencode list * dots_whencode list
   | FunDecl       of rule_elem (* header *) * rule_elem (* { *) *
-                    statement dots * statement dots * rule_elem (* } *)
+                    statement dots * rule_elem (* } *)
   | Define        of rule_elem (* header *) * statement dots
   | Dots          of string mcode (* ... *) *
                     (statement dots,statement) whencode list *
@@ -592,6 +595,7 @@ let unwrap_mcode (x,_,_,_)  = x
 let get_mcodekind (_,_,x,_) = x
 let get_line x             = x.node_line
 let get_mcode_line (_,l,_,_) = l.line
+let get_mcode_col (_,l,_,_)  = l.column
 let get_fvs x              = x.free_vars
 let set_fvs fvs x          = {x with free_vars = fvs}
 let get_mfvs x             = x.minus_free_vars
@@ -684,7 +688,7 @@ and tag2c = function
 
 (* --------------------------------------------------------------------- *)
 
-let no_info = { line = 0; column = 0; strbef = []; straft = [] }
+let no_info = { line = 0; column = -1; strbef = []; straft = [] }
 
 let make_term x =
   {node = x;
index ce55a57..3771a7a 100644 (file)
@@ -30,7 +30,7 @@ and 'a mcode = 'a * info * mcodekind * meta_pos (* pos variable *)
  (* pos is an offset indicating where in the C code the mcodekind has an
  effect *)
  and mcodekind =
-    MINUS       of pos * anything list list
+    MINUS       of pos * int list * int * anything list list
   | CONTEXT     of pos * anything befaft
   | PLUS
  and fixpos =
@@ -399,7 +399,7 @@ and metaStmtInfo =
 and rule_elem = base_rule_elem wrap
 
 and base_statement =
-    Seq           of rule_elem (* { *) * statement dots *
+    Seq           of rule_elem (* { *) *
                     statement dots * rule_elem (* } *)
   | IfThen        of rule_elem (* header *) * statement * end_info
   | IfThenElse    of rule_elem (* header *) * statement *
@@ -416,7 +416,7 @@ and base_statement =
                     (statement dots,statement) whencode list * multi *
                     dots_whencode list * dots_whencode list
   | FunDecl       of rule_elem (* header *) * rule_elem (* { *) *
-                    statement dots * statement dots * rule_elem (* } *)
+                    statement dots * rule_elem (* } *)
   | Define        of rule_elem (* header *) * statement dots
   | Dots          of string mcode (* ... *) *
                     (statement dots,statement) whencode list *
@@ -557,6 +557,7 @@ val unwrap_mcode : 'a mcode -> 'a
 val get_mcodekind : 'a mcode -> mcodekind
 val get_line : 'a wrap -> line
 val get_mcode_line : 'a mcode -> line
+val get_mcode_col : 'a mcode -> int
 val get_fvs : 'a wrap -> meta_name list
 val get_wcfvs : ('a wrap,'b wrap) whencode list -> meta_name list
 val set_fvs : meta_name list -> 'a wrap -> 'a wrap
index c1bf4b9..90bdd19 100644 (file)
@@ -35,7 +35,7 @@ let fresh_table = (Hashtbl.create(50) : ((string * string), unit) Hashtbl.t)
 
 let warning s = Printf.fprintf stderr "warning: %s\n" s
 
-let promote name = (name,(),Ast0.default_info(),(),None)
+let promote name = (name,(),Ast0.default_info(),(),None,-1)
 
 (* --------------------------------------------------------------------- *)
 
@@ -45,7 +45,7 @@ let find_loop table name =
     | x::xs -> (try Hashtbl.find x name with Not_found -> loop xs) in
   loop table
 
-let check_table table minus (name,_,info,_,_) =
+let check_table table minus (name,_,info,_,_,_) =
   let rl = info.Ast0.pos_info.Ast0.line_start in
   if minus
   then
@@ -83,7 +83,7 @@ let is_ifdef name =
 
 let ident context old_metas table minus i =
   match Ast0.unwrap i with
-    Ast0.Id((name,_,info,_,_) : string Ast0.mcode) ->
+    Ast0.Id((name,_,info,_,_,_) : string Ast0.mcode) ->
       let rl = info.Ast0.pos_info.Ast0.line_start in
       let err =
        if List.exists (function x -> x = name) old_metas
index b862e75..8e22419 100644 (file)
@@ -38,7 +38,7 @@ let mkres x e left right =
       Ast0.logical_start = lstart.Ast0.pos_info.Ast0.logical_start;
       Ast0.logical_end = lend.Ast0.pos_info.Ast0.logical_end;
       Ast0.column = lstart.Ast0.pos_info.Ast0.column;
-      Ast0.offset = lstart.Ast0.pos_info.Ast0.offset; } in
+      Ast0.offset = lstart.Ast0.pos_info.Ast0.offset;} in
   let info =
     { Ast0.pos_info = pos_info;
       Ast0.attachable_start = lstart.Ast0.attachable_start;
@@ -79,13 +79,13 @@ let get_option fn = function
 (* --------------------------------------------------------------------- *)
 (* Mcode *)
 
-let promote_mcode (_,_,info,mcodekind,_) =
+let promote_mcode (_,_,info,mcodekind,_,_) =
   let new_info =
     {info with
       Ast0.mcode_start = [mcodekind]; Ast0.mcode_end = [mcodekind]} in
   {(Ast0.wrap ()) with Ast0.info = new_info; Ast0.mcodekind = ref mcodekind}
 
-let promote_mcode_plus_one (_,_,info,mcodekind,_) =
+let promote_mcode_plus_one (_,_,info,mcodekind,_,_) =
   let new_pos_info = 
     {info.Ast0.pos_info with
       Ast0.line_start = info.Ast0.pos_info.Ast0.line_start + 1;
@@ -125,10 +125,10 @@ let promote_to_statement_start stm mcodekind =
   {(Ast0.wrap ()) with Ast0.info = new_info; Ast0.mcodekind = ref mcodekind}
 
 (* mcode is good by default *)
-let bad_mcode (t,a,info,mcodekind,pos) =
+let bad_mcode (t,a,info,mcodekind,pos,adj) =
   let new_info =
     {info with Ast0.attachable_start = false; Ast0.attachable_end = false} in
-  (t,a,new_info,mcodekind,pos)
+  (t,a,new_info,mcodekind,pos,adj)
 
 let get_all_start_info l =
   (List.for_all (function x -> (Ast0.get_info x).Ast0.attachable_start) l,
index 93de14b..f5c6dee 100644 (file)
@@ -139,7 +139,7 @@ let collect_plus_lines top =
   let bind x y = () in
   let option_default = () in
   let donothing r k e = k e in
-  let mcode (_,_,info,mcodekind,_) =
+  let mcode (_,_,info,mcodekind,_,_) =
     match mcodekind with
       Ast0.PLUS -> insert info.Ast0.pos_info.Ast0.line_start
     | _ -> () in
@@ -228,7 +228,7 @@ let bind c1 c2 =
 let option_default = (*Bind(Neutral,[],[],[],[],[])*)
   Recursor(Neutral,[],[],[])
 
-let mcode (_,_,info,mcodekind,pos) =
+let mcode (_,_,info,mcodekind,pos,_) =
   let offset = info.Ast0.pos_info.Ast0.offset in
   match mcodekind with
     Ast0.MINUS(_) -> Token(AllMarked,offset,mcodekind,[])
@@ -236,7 +236,7 @@ let mcode (_,_,info,mcodekind,pos) =
   | Ast0.CONTEXT(_) -> Token(NotAllMarked,offset,mcodekind,[offset])
   | _ -> failwith "not possible"
 
-let neutral_mcode (_,_,info,mcodekind,pos) =
+let neutral_mcode (_,_,info,mcodekind,pos,_) =
   let offset = info.Ast0.pos_info.Ast0.offset in
   match mcodekind with
     Ast0.MINUS(_) -> Token(Neutral,offset,mcodekind,[])
@@ -246,7 +246,7 @@ let neutral_mcode (_,_,info,mcodekind,pos) =
 
 (* neutral for context; used for mcode in bef aft nodes that don't represent
 anything if they don't contain some information *)
-let nc_mcode (_,_,info,mcodekind,pos) =
+let nc_mcode (_,_,info,mcodekind,pos,_) =
   let offset = info.Ast0.pos_info.Ast0.offset in
   match mcodekind with
     Ast0.MINUS(_) -> Token(AllMarked,offset,mcodekind,[])
@@ -403,13 +403,13 @@ let classify is_minus all_marked table code =
        (* cases for everything with extra mcode *)
       |        Ast0.FunDecl((info,bef),_,_,_,_,_,_,_,_)
       | Ast0.Decl((info,bef),_) ->
-         bind (nc_mcode ((),(),info,bef,())) (k s)
+         bind (nc_mcode ((),(),info,bef,(),-1)) (k s)
       | Ast0.IfThen(_,_,_,_,_,(info,aft))
       | Ast0.IfThenElse(_,_,_,_,_,_,_,(info,aft))
       | Ast0.Iterator(_,_,_,_,_,(info,aft))
       | Ast0.While(_,_,_,_,_,(info,aft))
       | Ast0.For(_,_,_,_,_,_,_,_,_,(info,aft)) ->
-         bind (k s) (nc_mcode ((),(),info,aft,()))
+         bind (k s) (nc_mcode ((),(),info,aft,(),-1))
       |        _ -> k s
 
 ) in
@@ -432,7 +432,7 @@ the same context children *)
 
 (* this is just a sanity check - really only need to look at the top-level
    structure *)
-let equal_mcode (_,_,info1,_,_) (_,_,info2,_,_) =
+let equal_mcode (_,_,info1,_,_,_) (_,_,info2,_,_,_) =
   info1.Ast0.pos_info.Ast0.offset = info2.Ast0.pos_info.Ast0.offset
 
 let equal_option e1 e2 =
index 108d0c9..be830b1 100644 (file)
@@ -281,7 +281,7 @@ let cip_mcodekind r mck =
       (List.map (function l -> List.fold_left (@) [] (List.map astfvs l))
         anythings) in
   match mck with
-    Ast.MINUS(_,anythings) -> process_anything_list_list anythings
+    Ast.MINUS(_,_,_,anythings) -> process_anything_list_list anythings
   | Ast.CONTEXT(_,befaft) ->
       (match befaft with
        Ast.BEFORE(ll) -> process_anything_list_list ll
index 95fe86b..0814be9 100644 (file)
@@ -38,8 +38,12 @@ let rec get_name name =
 (* --------------------------------------------------------------------- *)
 (* collect all of the functions *)
 
-let brace_to_semi (_,arity,info,mcodekind,pos) =
-  (";",Ast0.NONE,info,mcodekind,pos)
+let brace_to_semi (_,arity,info,mcodekind,pos,adj) =
+  let info =
+    (* drop column information, so that with -smpl_spacing the semicolon
+       will come out right after the close parenthesis *)
+    {info with Ast0.pos_info = {info.Ast0.pos_info with Ast0.column = -1}} in
+  (";",Ast0.NONE,info,mcodekind,pos,adj)
 
 let collect_function (stm : Ast0.statement) =
   match Ast0.unwrap stm with
@@ -123,8 +127,8 @@ let rec align all_minus all_plus =
 and strip =
   let donothing r k e =
     {(Ast0.wrap (Ast0.unwrap (k e))) with Ast0.mcodekind = ref Ast0.PLUS} in
-  let mcode (mc,_,_,_,_) =
-    (mc,Ast0.NONE,Ast0.default_info(),Ast0.PLUS,ref Ast0.NoMetaPos) in
+  let mcode (mc,_,_,_,_,_) =
+    (mc,Ast0.NONE,Ast0.default_info(),Ast0.PLUS,ref Ast0.NoMetaPos,-1) in
 
   (* need a case for everything that has an unvisited component and can be in
      a function prototype *)
@@ -221,12 +225,13 @@ let rec rename_param old_name all param =
   match Ast0.unwrap param with
     Ast0.Param(ty,Some id) when all ->
       (match Ast0.unwrap id with
-       Ast0.MetaId(((_,name),arity,info,mcodekind,pos),constraints,pure) ->
+       Ast0.MetaId
+         (((_,name),arity,info,mcodekind,pos,adj),constraints,pure) ->
          let nm = ("__no_name__",new_name name) in
          let new_id =
            Ast0.rewrap id
              (Ast0.MetaId
-                ((nm,arity,info,mcodekind,pos),constraints,Ast0.Pure)) in
+                ((nm,arity,info,mcodekind,pos,adj),constraints,Ast0.Pure)) in
          ([Ast.MetaIdDecl(Ast.NONE,nm)],
           Ast0.rewrap param (Ast0.Param(ty,Some new_id)))
       |        _ -> ([],param))
@@ -318,7 +323,7 @@ let no_names dec =
                                    Ast0.get_mcode_mcodekind lp in
                                  let pdots =
                                    ("...",Ast0.NONE,info,mcodekind,
-                                    ref Ast0.NoMetaPos) in
+                                    ref Ast0.NoMetaPos,-1) in
                                  Ast0.DOTS
                                    ([Ast0.rewrap params
                                         (Ast0.Pdots(pdots))])),
index ac9e629..814e9c1 100644 (file)
@@ -83,7 +83,7 @@ let get_minus_constants bind orbind =
        if !Flag.sgrep_mode2
        then
          match ty with
-           (_,_,Ast.MINUS(_,_),_) -> [Ast.unwrap_mcode ty]
+           (_,_,Ast.MINUS(_,_,_,_),_) -> [Ast.unwrap_mcode ty]
          | _ -> []
        else [Ast.unwrap_mcode ty]
     | _ -> k e in
@@ -130,7 +130,7 @@ let get_all_minus_constants =
   let option_default = [] in
   let mcode r (x,_,mcodekind,_) =
     match mcodekind with
-      Ast.MINUS(_,_) -> [x]
+      Ast.MINUS(_,_,_,_) -> [x]
     | _ -> [] in
   let other r (x,_,mcodekind,_) = [] in
 
@@ -156,7 +156,7 @@ let get_plus_constants =
               bind (fn.V.combiner_anything cur) prev))
        [] l in
     match mcodekind with
-      Ast.MINUS(_,anythings) -> recurse anythings
+      Ast.MINUS(_,_,_,anythings) -> recurse anythings
     | Ast.CONTEXT(_,Ast.BEFORE(a)) -> recurse a
     | Ast.CONTEXT(_,Ast.AFTER(a)) -> recurse a
     | Ast.CONTEXT(_,Ast.BEFOREAFTER(a1,a2)) ->
index 9c9f220..93e9ea6 100644 (file)
@@ -348,7 +348,7 @@ let get_all_constants minus_only =
   let option_default = [] in
   let mcode r (x,_,mcodekind,_) =
     match mcodekind with
-      Ast.MINUS(_,_) -> [x]
+      Ast.MINUS(_,_,_,_) -> [x]
     | _ when minus_only -> []
     | _ -> [x] in
   let other r _ = [] in
@@ -376,7 +376,7 @@ let get_plus_constants =
               bind ((get_all_constants false).V.combiner_anything cur) prev))
        [] l in
     match mcodekind with
-      Ast.MINUS(_,anythings) -> recurse anythings
+      Ast.MINUS(_,_,_,anythings) -> recurse anythings
     | Ast.CONTEXT(_,Ast.BEFORE(a)) -> recurse a
     | Ast.CONTEXT(_,Ast.AFTER(a)) -> recurse a
     | Ast.CONTEXT(_,Ast.BEFOREAFTER(a1,a2)) ->
index a6ddbfc..b828c12 100644 (file)
@@ -158,7 +158,7 @@ let collect_minus_join_points root =
   let bind x y = x @ y in
   let option_default = [] in
 
-  let mcode (_,_,info,mcodekind,_) =
+  let mcode (_,_,info,mcodekind,_,_) =
     if List.mem (info.Ast0.pos_info.Ast0.offset) unfavored_tokens
     then [(Unfavored,info,mcodekind)]
     else [(Favored,info,mcodekind)] in
@@ -472,13 +472,13 @@ let collect_plus_nodes root =
     let aft = extract info.Ast0.strings_after in
     (bef,aft) in
 
-  let mcode fn (term,_,info,mcodekind,_) =
+  let mcode fn (term,_,info,mcodekind,_,_) =
     match mcodekind with
       Ast0.PLUS -> [(info,fn term)]
     | Ast0.CONTEXT _ -> let (bef,aft) = extract_strings info in bef@aft
     | _ -> [] in
 
-  let imcode fn (term,_,info,mcodekind,_) =
+  let imcode fn (term,_,info,mcodekind,_,_) =
     match mcodekind with
       Ast0.PLUS -> [(info,fn term (Ast0toast.convert_info info))]
     | Ast0.CONTEXT _ -> let (bef,aft) = extract_strings info in bef@aft
@@ -980,7 +980,7 @@ let reevaluate_contextness =
    let bind = (@) in
    let option_default = [] in
 
-   let mcode (_,_,_,mc,_) =
+   let mcode (_,_,_,mc,_,_) =
      match mc with
        Ast0.CONTEXT(mc) -> let (ba,_,_) = !mc in [ba]
      | _ -> [] in
index 46e77e2..16d484b 100644 (file)
@@ -43,8 +43,8 @@ type isomorphism =
     Ast_cocci.metavar list * Ast0_cocci.anything list list * string (* name *)
 
 let strip_info =
-  let mcode (term,_,_,_,_) =
-    (term,Ast0.NONE,Ast0.default_info(),Ast0.PLUS,ref Ast0.NoMetaPos) in
+  let mcode (term,_,_,_,_,_) =
+    (term,Ast0.NONE,Ast0.default_info(),Ast0.PLUS,ref Ast0.NoMetaPos,-1) in
   let donothing r k e =
     let x = k e in
     {(Ast0.wrap (Ast0.unwrap x)) with
@@ -108,8 +108,8 @@ let anything_equal = function
       failwith "only for isos within iso phase"
   | _ -> false
 
-let term (var1,_,_,_,_) = var1
-let dot_term (var1,_,info,_,_) =
+let term (var1,_,_,_,_,_) = var1
+let dot_term (var1,_,info,_,_,_) =
   ("", var1 ^ (string_of_int info.Ast0.pos_info.Ast0.offset))
 
 
@@ -227,7 +227,7 @@ let rec conjunct_many_bindings = function
   | [x] -> x
   | x::xs -> conjunct_bindings x (conjunct_many_bindings xs)
 
-let mcode_equal (x,_,_,_,_) (y,_,_,_,_) = x = y
+let mcode_equal (x,_,_,_,_,_) (y,_,_,_,_,_) = x = y
 
 let return b binding = if b then OK binding else Fail NonMatch
 let return_false reason binding = Fail reason
@@ -1197,7 +1197,7 @@ let match_statement_dots dochecks context_required whencode_allowed =
 (* make an entire tree MINUS *)
 
 let make_minus =
-  let mcode (term,arity,info,mcodekind,pos) =
+  let mcode (term,arity,info,mcodekind,pos,adj) =
     let new_mcodekind =
      match mcodekind with
        Ast0.CONTEXT(mc) ->
@@ -1206,7 +1206,7 @@ let make_minus =
         | _ -> failwith "make_minus: unexpected befaft")
      | Ast0.MINUS(mc) -> mcodekind (* in the part copied from the src term *)
      | _ -> failwith "make_minus mcode: unexpected mcodekind" in
-    (term,arity,info,new_mcodekind,pos) in
+    (term,arity,info,new_mcodekind,pos,adj) in
 
   let update_mc mcodekind e =
     match !mcodekind with
@@ -1331,7 +1331,7 @@ let rebuild_mcode start_line =
           indices, and so we allow PLUS code as well *)
         Ast0.PLUS in
 
-  let mcode (term,arity,info,mcodekind,pos) =
+  let mcode (term,arity,info,mcodekind,pos,adj) =
     let info =
       match start_line with
        Some x ->
@@ -1341,7 +1341,7 @@ let rebuild_mcode start_line =
              Ast0.line_end = x; } in
          {info with Ast0.pos_info = new_pos_info}
       |        None -> info in
-    (term,arity,info,copy_mcodekind mcodekind,pos) in
+    (term,arity,info,copy_mcodekind mcodekind,pos,adj) in
 
   let copy_one x =
     let old_info = Ast0.get_info x in
@@ -1562,7 +1562,7 @@ let instantiate bindings mv_bindings =
                    let rec renamer = function
                        Type_cocci.MetaType(name,keep,inherited) ->
                          (match
-                           lookup (name,(),(),(),None) bindings mv_bindings
+                           lookup (name,(),(),(),None,-1) bindings mv_bindings
                          with
                            Common.Left(Ast0.TypeCTag(t)) ->
                              Ast0.ast0_type_to_type t
@@ -2356,7 +2356,7 @@ let transform (alts : isomorphism) t =
 
 (* should be done by functorizing the parser to use wrap or context_wrap *)
 let rewrap =
-  let mcode (x,a,i,mc,pos) = (x,a,i,Ast0.context_befaft(),pos) in
+  let mcode (x,a,i,mc,pos,adj) = (x,a,i,Ast0.context_befaft(),pos,adj) in
   let donothing r k e = Ast0.context_wrap(Ast0.unwrap(k e)) in
   V0.flat_rebuilder
     mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode
index 0761106..878edc5 100644 (file)
@@ -48,7 +48,7 @@ let get_current_line_type lexbuf =
   let lex_start = Lexing.lexeme_start lexbuf in
   let preceeding_spaces =
     if !line_start < 0 then 0 else lex_start - !line_start in
-  line_start := -1;
+  (*line_start := -1;*)
   prev_plus := (c = D.PLUS);
   (c,l,ll,lex_start,preceeding_spaces,[],[],Ast0.NoMetaPos)
 let current_line_started = ref false
@@ -297,6 +297,8 @@ let init _ =
   Hashtbl.clear metavariables;
   Hashtbl.clear type_names;
   Hashtbl.clear rule_names;
+  Hashtbl.clear iterator_names;
+  Hashtbl.clear declarer_names;
   let get_name (_,x) = x in
   Data.add_id_meta :=
     (fun name constraints pure ->
@@ -591,30 +593,31 @@ rule token = parse
   | "&"            { start_line true; TAnd    (get_current_line_type lexbuf) }
   | "^"            { start_line true; TXor(get_current_line_type lexbuf) }
 
-  | ( ("#" [' ' '\t']*  "define" [' ' '\t']+))
+  | (( ("#" [' ' '\t']*  "define" [' ' '\t']+)) as def)
     ( (letter (letter |digit)*) as ident)
       { start_line true;
        let (arity,line,lline,offset,col,strbef,straft,pos) as lt =
          get_current_line_type lexbuf in
-       let off = String.length "#define " in
+       let off = String.length def in
        (* -1 in the code below because the ident is not at the line start *)
        TDefine
          (lt,
           check_var ident
-            (arity,line,lline,offset+off,(-1),[],[],Ast0.NoMetaPos)) }
-  | ( ("#" [' ' '\t']*  "define" [' ' '\t']+))
+            (arity,line,lline,offset+off,col+off,[],[],Ast0.NoMetaPos)) }
+  | (( ("#" [' ' '\t']*  "define" [' ' '\t']+)) as def)
     ( (letter (letter | digit)*) as ident)
     '('
       { start_line true;
        let (arity,line,lline,offset,col,strbef,straft,pos) as lt =
          get_current_line_type lexbuf in
-       let off = String.length "#define " in
+       let off = String.length def in
        TDefineParam
         (lt,
         check_var ident
           (* why pos here but not above? *)
-          (arity,line,lline,offset+off,(-1),strbef,straft,pos),
-        offset + off + (String.length ident)) }
+          (arity,line,lline,offset+off,col+off,strbef,straft,pos),
+        offset + off + (String.length ident),
+        col + off + (String.length ident)) }
   | "#" [' ' '\t']* "include" [' ' '\t']* '"' [^ '"']+ '"'
       { TIncludeL
          (let str = tok lexbuf in
index f7f9e0e..8922a0c 100644 (file)
@@ -44,7 +44,7 @@ let make_info line logical_line offset col strbef straft =
   let new_pos_info =
     {Ast0.line_start = line; Ast0.line_end = line;
       Ast0.logical_start = logical_line; Ast0.logical_end = logical_line;
-      Ast0.column = col; Ast0.offset = offset;} in
+      Ast0.column = col; Ast0.offset = offset; } in
   { Ast0.pos_info = new_pos_info;
     Ast0.attachable_start = true; Ast0.attachable_end = true;
     Ast0.mcode_start = []; Ast0.mcode_end = [];
@@ -62,31 +62,31 @@ let drop_aft (arity,line,lline,offset,col,strbef,straft,pos) =
 let clt2mcode str = function
     (Data.MINUS,line,lline,offset,col,strbef,straft,pos)       ->
       (str,Ast0.NONE,make_info line lline offset col strbef straft,
-       Ast0.MINUS(ref([],Ast0.default_token_info)),ref pos)
+       Ast0.MINUS(ref([],Ast0.default_token_info)),ref pos,-1)
   | (Data.OPTMINUS,line,lline,offset,col,strbef,straft,pos)    ->
       (str,Ast0.OPT,make_info line lline offset col strbef straft,
-       Ast0.MINUS(ref([],Ast0.default_token_info)),ref pos)
+       Ast0.MINUS(ref([],Ast0.default_token_info)),ref pos,-1)
   | (Data.UNIQUEMINUS,line,lline,offset,col,strbef,straft,pos) ->
       (str,Ast0.UNIQUE,make_info line lline offset col strbef straft,
-       Ast0.MINUS(ref([],Ast0.default_token_info)),ref pos)
+       Ast0.MINUS(ref([],Ast0.default_token_info)),ref pos,-1)
   | (Data.PLUS,line,lline,offset,col,strbef,straft,pos)        ->
       (str,Ast0.NONE,make_info line lline offset col strbef straft,Ast0.PLUS,
-       ref pos)
+       ref pos,-1)
   | (Data.CONTEXT,line,lline,offset,col,strbef,straft,pos)     ->
       (str,Ast0.NONE,make_info line lline offset col strbef straft,
        Ast0.CONTEXT(ref(Ast.NOTHING,
                        Ast0.default_token_info,Ast0.default_token_info)),
-       ref pos)
+       ref pos,-1)
   | (Data.OPT,line,lline,offset,col,strbef,straft,pos)         ->
       (str,Ast0.OPT,make_info line lline offset col strbef straft,
        Ast0.CONTEXT(ref(Ast.NOTHING,
                        Ast0.default_token_info,Ast0.default_token_info)),
-       ref pos)
+       ref pos,-1)
   | (Data.UNIQUE,line,lline,offset,col,strbef,straft,pos)      ->
       (str,Ast0.UNIQUE,make_info line lline offset col strbef straft,
        Ast0.CONTEXT(ref(Ast.NOTHING,
                        Ast0.default_token_info,Ast0.default_token_info)),
-       ref pos)
+       ref pos,-1)
 
 let id2name   (name, clt) = name
 let id2clt    (name, clt) = clt
@@ -494,7 +494,7 @@ let make_generated_rule_name_result nm d i a e ee =
 
 let make_script_rule_name_result lang deps =
   let l = id2name lang in
-       Ast.ScriptRulename (l,deps)
+  Ast.ScriptRulename (l,deps)
 
 let make_initial_script_rule_name_result lang =
   let l = id2name lang in
index db75412..209ab97 100644 (file)
@@ -114,7 +114,7 @@ let token2c (tok,_) =
   | PC.TIncludeL(s,clt) -> (pr "#include \"%s\"" s)^(line_type2c clt)
   | PC.TIncludeNL(s,clt) -> (pr "#include <%s>" s)^(line_type2c clt)
   | PC.TDefine(clt,_) -> "#define"^(line_type2c clt)
-  | PC.TDefineParam(clt,_,_) -> "#define_param"^(line_type2c clt)
+  | PC.TDefineParam(clt,_,_,_) -> "#define_param"^(line_type2c clt)
   | PC.TMinusFile(s,clt) -> (pr "--- %s" s)^(line_type2c clt)
   | PC.TPlusFile(s,clt) -> (pr "+++ %s" s)^(line_type2c clt)
 
@@ -286,7 +286,7 @@ let plus_attachable only_plus (tok,_) =
   | PC.Textern(clt) | PC.Tconst(clt) | PC.Tvolatile(clt)
 
   | PC.TIncludeL(_,clt) | PC.TIncludeNL(_,clt) | PC.TDefine(clt,_)
-  | PC.TDefineParam(clt,_,_) | PC.TMinusFile(_,clt) | PC.TPlusFile(_,clt)
+  | PC.TDefineParam(clt,_,_,_) | PC.TMinusFile(_,clt) | PC.TPlusFile(_,clt)
 
   | PC.TInc(clt) | PC.TDec(clt)
 
@@ -351,7 +351,7 @@ let get_clt (tok,_) =
   | PC.Textern(clt) | PC.Tconst(clt) | PC.Tvolatile(clt)
 
   | PC.TIncludeL(_,clt) | PC.TIncludeNL(_,clt) | PC.TDefine(clt,_)
-  | PC.TDefineParam(clt,_,_) | PC.TMinusFile(_,clt) | PC.TPlusFile(_,clt)
+  | PC.TDefineParam(clt,_,_,_) | PC.TMinusFile(_,clt) | PC.TPlusFile(_,clt)
 
   | PC.TInc(clt) | PC.TDec(clt)
 
@@ -428,7 +428,7 @@ let update_clt (tok,x) clt =
   | PC.TIncludeL(s,_) -> (PC.TIncludeL(s,clt),x)
   | PC.TIncludeNL(s,_) -> (PC.TIncludeNL(s,clt),x)
   | PC.TDefine(_,a) -> (PC.TDefine(clt,a),x)
-  | PC.TDefineParam(_,a,b) -> (PC.TDefineParam(clt,a,b),x)
+  | PC.TDefineParam(_,a,b,c) -> (PC.TDefineParam(clt,a,b,c),x)
   | PC.TMinusFile(s,_) -> (PC.TMinusFile(s,clt),x)
   | PC.TPlusFile(s,_) -> (PC.TPlusFile(s,clt),x)
 
@@ -614,7 +614,7 @@ let split_token ((tok,_) as t) =
   | PC.TPlusFile(s,clt) | PC.TMinusFile(s,clt)
   | PC.TIncludeL(s,clt) | PC.TIncludeNL(s,clt) ->
       split t clt
-  | PC.TDefine(clt,_) | PC.TDefineParam(clt,_,_) -> split t clt
+  | PC.TDefine(clt,_) | PC.TDefineParam(clt,_,_,_) -> split t clt
 
   | PC.TIf(clt) | PC.TElse(clt)  | PC.TWhile(clt) | PC.TFor(clt) | PC.TDo(clt)
   | PC.TSwitch(clt) | PC.TCase(clt) | PC.TDefault(clt)
@@ -887,7 +887,7 @@ let token2line (tok,_) =
 
   | PC.TPtrOp(clt)
 
-  | PC.TDefine(clt,_) | PC.TDefineParam(clt,_,_)
+  | PC.TDefine(clt,_) | PC.TDefineParam(clt,_,_,_)
   | PC.TIncludeL(_,clt) | PC.TIncludeNL(_,clt)
 
   | PC.TEq(clt) | PC.TAssign(_,clt) | PC.TDot(clt) | PC.TComma(clt)
@@ -901,7 +901,7 @@ let rec insert_line_end = function
   | (((PC.TWhen(clt),q) as x)::xs) ->
       x::(find_line_end true (token2line x) clt q xs)
   | (((PC.TDefine(clt,_),q) as x)::xs)
-  | (((PC.TDefineParam(clt,_,_),q) as x)::xs) ->
+  | (((PC.TDefineParam(clt,_,_,_),q) as x)::xs) ->
       x::(find_line_end false (token2line x) clt q xs)
   | x::xs -> x::(insert_line_end xs)
 
@@ -1654,6 +1654,8 @@ let process file isofile verbose =
                      some restrictions on the -+ code *)
                   ([],_) | (_,Ast.Generated) -> ([],minus)
                 | _ -> Iso_pattern.apply_isos chosen_isos minus rule_name in
+              (* after iso, because iso can intro ... *)
+              let minus = Adjacency.compute_adjacency minus in
               let minus = Comm_assoc.comm_assoc minus rule_name dropiso in
               let minus =
                 if !Flag.sgrep_mode2 then minus
index 66f731b..a5bb657 100644 (file)
@@ -553,7 +553,7 @@ type token =
   | TDepends
   | TDefineParam of (
 # 82 "parser_cocci_menhir.mly"
-       (Data.clt * token * int)
+       (Data.clt * token * int * int)
 # 558 "parser_cocci_menhir.ml"
 )
   | TDefine of (
@@ -1529,7 +1529,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_aexpr = 
-# 1766 "parser_cocci_menhir.mly"
+# 1767 "parser_cocci_menhir.mly"
       ( Ast0.set_arg_exp _1 )
 # 1535 "parser_cocci_menhir.ml"
          in
@@ -1557,7 +1557,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_aexpr = 
-# 1768 "parser_cocci_menhir.mly"
+# 1769 "parser_cocci_menhir.mly"
       ( let (nm,lenname,pure,clt) = _1 in
       let nm = P.clt2mcode nm clt in
       let lenname =
@@ -1587,7 +1587,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_aexpr = 
-# 1776 "parser_cocci_menhir.mly"
+# 1777 "parser_cocci_menhir.mly"
       ( Ast0.set_arg_exp(Ast0.wrap(Ast0.TypeExp(_1))) )
 # 1593 "parser_cocci_menhir.ml"
          in
@@ -1609,7 +1609,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_any_strict = 
-# 1820 "parser_cocci_menhir.mly"
+# 1821 "parser_cocci_menhir.mly"
             ( Ast.WhenAny )
 # 1615 "parser_cocci_menhir.ml"
          in
@@ -1631,7 +1631,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_any_strict = 
-# 1821 "parser_cocci_menhir.mly"
+# 1822 "parser_cocci_menhir.mly"
             ( Ast.WhenStrict )
 # 1637 "parser_cocci_menhir.ml"
          in
@@ -1653,7 +1653,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_any_strict = 
-# 1822 "parser_cocci_menhir.mly"
+# 1823 "parser_cocci_menhir.mly"
             ( Ast.WhenForall )
 # 1659 "parser_cocci_menhir.ml"
          in
@@ -1675,7 +1675,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_any_strict = 
-# 1823 "parser_cocci_menhir.mly"
+# 1824 "parser_cocci_menhir.mly"
             ( Ast.WhenExists )
 # 1681 "parser_cocci_menhir.ml"
          in
@@ -1699,7 +1699,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1263 "parser_cocci_menhir.mly"
+# 1264 "parser_cocci_menhir.mly"
                                             ( _1 )
 # 1705 "parser_cocci_menhir.ml"
          in
@@ -1739,7 +1739,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1265 "parser_cocci_menhir.mly"
+# 1266 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Mul _1 _2 _3 )
 # 1745 "parser_cocci_menhir.ml"
          in
@@ -1779,7 +1779,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1267 "parser_cocci_menhir.mly"
+# 1268 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in P.arith_op op _1 clt _3 )
 # 1785 "parser_cocci_menhir.ml"
          in
@@ -1819,7 +1819,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1269 "parser_cocci_menhir.mly"
+# 1270 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Plus _1 _2 _3 )
 # 1825 "parser_cocci_menhir.ml"
          in
@@ -1859,7 +1859,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1271 "parser_cocci_menhir.mly"
+# 1272 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Minus _1 _2 _3 )
 # 1865 "parser_cocci_menhir.ml"
          in
@@ -1899,7 +1899,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1273 "parser_cocci_menhir.mly"
+# 1274 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in P.arith_op op _1 clt _3 )
 # 1905 "parser_cocci_menhir.ml"
          in
@@ -1939,7 +1939,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1275 "parser_cocci_menhir.mly"
+# 1276 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in P.logic_op op _1 clt _3 )
 # 1945 "parser_cocci_menhir.ml"
          in
@@ -1979,7 +1979,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1277 "parser_cocci_menhir.mly"
+# 1278 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.Eq _1 _2 _3 )
 # 1985 "parser_cocci_menhir.ml"
          in
@@ -2019,7 +2019,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1279 "parser_cocci_menhir.mly"
+# 1280 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.NotEq _1 _2 _3 )
 # 2025 "parser_cocci_menhir.ml"
          in
@@ -2059,7 +2059,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1281 "parser_cocci_menhir.mly"
+# 1282 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.And _1 _2 _3 )
 # 2065 "parser_cocci_menhir.ml"
          in
@@ -2099,7 +2099,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1283 "parser_cocci_menhir.mly"
+# 1284 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Or _1 _2 _3 )
 # 2105 "parser_cocci_menhir.ml"
          in
@@ -2139,7 +2139,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1285 "parser_cocci_menhir.mly"
+# 1286 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Xor _1 _2 _3 )
 # 2145 "parser_cocci_menhir.ml"
          in
@@ -2179,7 +2179,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1287 "parser_cocci_menhir.mly"
+# 1288 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.AndLog _1 _2 _3 )
 # 2185 "parser_cocci_menhir.ml"
          in
@@ -2219,7 +2219,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_dot_expressions_ = 
-# 1289 "parser_cocci_menhir.mly"
+# 1290 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.OrLog _1 _2 _3 )
 # 2225 "parser_cocci_menhir.ml"
          in
@@ -2243,7 +2243,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1263 "parser_cocci_menhir.mly"
+# 1264 "parser_cocci_menhir.mly"
                                             ( _1 )
 # 2249 "parser_cocci_menhir.ml"
          in
@@ -2283,7 +2283,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1265 "parser_cocci_menhir.mly"
+# 1266 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Mul _1 _2 _3 )
 # 2289 "parser_cocci_menhir.ml"
          in
@@ -2323,7 +2323,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1267 "parser_cocci_menhir.mly"
+# 1268 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in P.arith_op op _1 clt _3 )
 # 2329 "parser_cocci_menhir.ml"
          in
@@ -2363,7 +2363,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1269 "parser_cocci_menhir.mly"
+# 1270 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Plus _1 _2 _3 )
 # 2369 "parser_cocci_menhir.ml"
          in
@@ -2403,7 +2403,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1271 "parser_cocci_menhir.mly"
+# 1272 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Minus _1 _2 _3 )
 # 2409 "parser_cocci_menhir.ml"
          in
@@ -2443,7 +2443,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1273 "parser_cocci_menhir.mly"
+# 1274 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in P.arith_op op _1 clt _3 )
 # 2449 "parser_cocci_menhir.ml"
          in
@@ -2483,7 +2483,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1275 "parser_cocci_menhir.mly"
+# 1276 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in P.logic_op op _1 clt _3 )
 # 2489 "parser_cocci_menhir.ml"
          in
@@ -2523,7 +2523,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1277 "parser_cocci_menhir.mly"
+# 1278 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.Eq _1 _2 _3 )
 # 2529 "parser_cocci_menhir.ml"
          in
@@ -2563,7 +2563,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1279 "parser_cocci_menhir.mly"
+# 1280 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.NotEq _1 _2 _3 )
 # 2569 "parser_cocci_menhir.ml"
          in
@@ -2603,7 +2603,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1281 "parser_cocci_menhir.mly"
+# 1282 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.And _1 _2 _3 )
 # 2609 "parser_cocci_menhir.ml"
          in
@@ -2643,7 +2643,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1283 "parser_cocci_menhir.mly"
+# 1284 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Or _1 _2 _3 )
 # 2649 "parser_cocci_menhir.ml"
          in
@@ -2683,7 +2683,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1285 "parser_cocci_menhir.mly"
+# 1286 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Xor _1 _2 _3 )
 # 2689 "parser_cocci_menhir.ml"
          in
@@ -2723,7 +2723,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1287 "parser_cocci_menhir.mly"
+# 1288 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.AndLog _1 _2 _3 )
 # 2729 "parser_cocci_menhir.ml"
          in
@@ -2763,7 +2763,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_invalid_ = 
-# 1289 "parser_cocci_menhir.mly"
+# 1290 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.OrLog _1 _2 _3 )
 # 2769 "parser_cocci_menhir.ml"
          in
@@ -2787,7 +2787,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1263 "parser_cocci_menhir.mly"
+# 1264 "parser_cocci_menhir.mly"
                                             ( _1 )
 # 2793 "parser_cocci_menhir.ml"
          in
@@ -2827,7 +2827,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1265 "parser_cocci_menhir.mly"
+# 1266 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Mul _1 _2 _3 )
 # 2833 "parser_cocci_menhir.ml"
          in
@@ -2867,7 +2867,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1267 "parser_cocci_menhir.mly"
+# 1268 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in P.arith_op op _1 clt _3 )
 # 2873 "parser_cocci_menhir.ml"
          in
@@ -2907,7 +2907,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1269 "parser_cocci_menhir.mly"
+# 1270 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Plus _1 _2 _3 )
 # 2913 "parser_cocci_menhir.ml"
          in
@@ -2947,7 +2947,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1271 "parser_cocci_menhir.mly"
+# 1272 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Minus _1 _2 _3 )
 # 2953 "parser_cocci_menhir.ml"
          in
@@ -2987,7 +2987,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1273 "parser_cocci_menhir.mly"
+# 1274 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in P.arith_op op _1 clt _3 )
 # 2993 "parser_cocci_menhir.ml"
          in
@@ -3027,7 +3027,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1275 "parser_cocci_menhir.mly"
+# 1276 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in P.logic_op op _1 clt _3 )
 # 3033 "parser_cocci_menhir.ml"
          in
@@ -3067,7 +3067,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1277 "parser_cocci_menhir.mly"
+# 1278 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.Eq _1 _2 _3 )
 # 3073 "parser_cocci_menhir.ml"
          in
@@ -3107,7 +3107,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1279 "parser_cocci_menhir.mly"
+# 1280 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.NotEq _1 _2 _3 )
 # 3113 "parser_cocci_menhir.ml"
          in
@@ -3147,7 +3147,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1281 "parser_cocci_menhir.mly"
+# 1282 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.And _1 _2 _3 )
 # 3153 "parser_cocci_menhir.ml"
          in
@@ -3187,7 +3187,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1283 "parser_cocci_menhir.mly"
+# 1284 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Or _1 _2 _3 )
 # 3193 "parser_cocci_menhir.ml"
          in
@@ -3227,7 +3227,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1285 "parser_cocci_menhir.mly"
+# 1286 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Xor _1 _2 _3 )
 # 3233 "parser_cocci_menhir.ml"
          in
@@ -3267,7 +3267,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1287 "parser_cocci_menhir.mly"
+# 1288 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.AndLog _1 _2 _3 )
 # 3273 "parser_cocci_menhir.ml"
          in
@@ -3307,7 +3307,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_eexpr_nest_expressions_ = 
-# 1289 "parser_cocci_menhir.mly"
+# 1290 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.OrLog _1 _2 _3 )
 # 3313 "parser_cocci_menhir.ml"
          in
@@ -3331,7 +3331,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1263 "parser_cocci_menhir.mly"
+# 1264 "parser_cocci_menhir.mly"
                                             ( _1 )
 # 3337 "parser_cocci_menhir.ml"
          in
@@ -3371,7 +3371,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1265 "parser_cocci_menhir.mly"
+# 1266 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Mul _1 _2 _3 )
 # 3377 "parser_cocci_menhir.ml"
          in
@@ -3411,7 +3411,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1267 "parser_cocci_menhir.mly"
+# 1268 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in P.arith_op op _1 clt _3 )
 # 3417 "parser_cocci_menhir.ml"
          in
@@ -3451,7 +3451,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1269 "parser_cocci_menhir.mly"
+# 1270 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Plus _1 _2 _3 )
 # 3457 "parser_cocci_menhir.ml"
          in
@@ -3491,7 +3491,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1271 "parser_cocci_menhir.mly"
+# 1272 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Minus _1 _2 _3 )
 # 3497 "parser_cocci_menhir.ml"
          in
@@ -3531,7 +3531,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1273 "parser_cocci_menhir.mly"
+# 1274 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in P.arith_op op _1 clt _3 )
 # 3537 "parser_cocci_menhir.ml"
          in
@@ -3571,7 +3571,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1275 "parser_cocci_menhir.mly"
+# 1276 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in P.logic_op op _1 clt _3 )
 # 3577 "parser_cocci_menhir.ml"
          in
@@ -3611,7 +3611,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1277 "parser_cocci_menhir.mly"
+# 1278 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.Eq _1 _2 _3 )
 # 3617 "parser_cocci_menhir.ml"
          in
@@ -3651,7 +3651,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1279 "parser_cocci_menhir.mly"
+# 1280 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.NotEq _1 _2 _3 )
 # 3657 "parser_cocci_menhir.ml"
          in
@@ -3691,7 +3691,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1281 "parser_cocci_menhir.mly"
+# 1282 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.And _1 _2 _3 )
 # 3697 "parser_cocci_menhir.ml"
          in
@@ -3731,7 +3731,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1283 "parser_cocci_menhir.mly"
+# 1284 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Or _1 _2 _3 )
 # 3737 "parser_cocci_menhir.ml"
          in
@@ -3771,7 +3771,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1285 "parser_cocci_menhir.mly"
+# 1286 "parser_cocci_menhir.mly"
       ( P.arith_op Ast.Xor _1 _2 _3 )
 # 3777 "parser_cocci_menhir.ml"
          in
@@ -3811,7 +3811,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1287 "parser_cocci_menhir.mly"
+# 1288 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.AndLog _1 _2 _3 )
 # 3817 "parser_cocci_menhir.ml"
          in
@@ -3851,7 +3851,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_arith_expr_expr_invalid_ = 
-# 1289 "parser_cocci_menhir.mly"
+# 1290 "parser_cocci_menhir.mly"
       ( P.logic_op Ast.OrLog _1 _2 _3 )
 # 3857 "parser_cocci_menhir.ml"
          in
@@ -3978,7 +3978,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_l_ in
         let _endpos = _endpos_r_ in
         let _v : 'tv_array_dec = 
-# 1070 "parser_cocci_menhir.mly"
+# 1071 "parser_cocci_menhir.mly"
                                            ( (l,i,r) )
 # 3984 "parser_cocci_menhir.ml"
          in
@@ -4002,7 +4002,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_assign_expr_eexpr_dot_expressions_ = 
-# 1235 "parser_cocci_menhir.mly"
+# 1236 "parser_cocci_menhir.mly"
                                            ( _1 )
 # 4008 "parser_cocci_menhir.ml"
          in
@@ -4042,7 +4042,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_assign_expr_eexpr_dot_expressions_ = 
-# 1237 "parser_cocci_menhir.mly"
+# 1238 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in
       Ast0.wrap(Ast0.Assignment(_1,P.clt2mcode op clt,
                                Ast0.set_arg_exp _3,false)) )
@@ -4084,7 +4084,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_assign_expr_eexpr_dot_expressions_ = 
-# 1241 "parser_cocci_menhir.mly"
+# 1242 "parser_cocci_menhir.mly"
       ( Ast0.wrap
          (Ast0.Assignment
             (_1,P.clt2mcode Ast.SimpleAssign _2,Ast0.set_arg_exp _3,false)) )
@@ -4110,7 +4110,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_assign_expr_eexpr_nest_expressions_ = 
-# 1235 "parser_cocci_menhir.mly"
+# 1236 "parser_cocci_menhir.mly"
                                            ( _1 )
 # 4116 "parser_cocci_menhir.ml"
          in
@@ -4150,7 +4150,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_assign_expr_eexpr_nest_expressions_ = 
-# 1237 "parser_cocci_menhir.mly"
+# 1238 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in
       Ast0.wrap(Ast0.Assignment(_1,P.clt2mcode op clt,
                                Ast0.set_arg_exp _3,false)) )
@@ -4192,7 +4192,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_assign_expr_eexpr_nest_expressions_ = 
-# 1241 "parser_cocci_menhir.mly"
+# 1242 "parser_cocci_menhir.mly"
       ( Ast0.wrap
          (Ast0.Assignment
             (_1,P.clt2mcode Ast.SimpleAssign _2,Ast0.set_arg_exp _3,false)) )
@@ -4218,7 +4218,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_assign_expr_expr_invalid_ = 
-# 1235 "parser_cocci_menhir.mly"
+# 1236 "parser_cocci_menhir.mly"
                                            ( _1 )
 # 4224 "parser_cocci_menhir.ml"
          in
@@ -4258,7 +4258,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_assign_expr_expr_invalid_ = 
-# 1237 "parser_cocci_menhir.mly"
+# 1238 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in
       Ast0.wrap(Ast0.Assignment(_1,P.clt2mcode op clt,
                                Ast0.set_arg_exp _3,false)) )
@@ -4300,7 +4300,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_assign_expr_expr_invalid_ = 
-# 1241 "parser_cocci_menhir.mly"
+# 1242 "parser_cocci_menhir.mly"
       ( Ast0.wrap
          (Ast0.Assignment
             (_1,P.clt2mcode Ast.SimpleAssign _2,Ast0.set_arg_exp _3,false)) )
@@ -4326,7 +4326,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_assign_expr_bis = 
-# 1246 "parser_cocci_menhir.mly"
+# 1247 "parser_cocci_menhir.mly"
                                                             ( _1 )
 # 4332 "parser_cocci_menhir.ml"
          in
@@ -4366,7 +4366,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_assign_expr_bis = 
-# 1248 "parser_cocci_menhir.mly"
+# 1249 "parser_cocci_menhir.mly"
       ( let (op,clt) = _2 in
       Ast0.wrap(Ast0.Assignment(_1,P.clt2mcode op clt,
                                Ast0.set_arg_exp _3,false)) )
@@ -4408,7 +4408,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_assign_expr_bis = 
-# 1252 "parser_cocci_menhir.mly"
+# 1253 "parser_cocci_menhir.mly"
       ( Ast0.wrap
          (Ast0.Assignment
             (_1,P.clt2mcode Ast.SimpleAssign _2,Ast0.set_arg_exp _3,false)) )
@@ -4434,7 +4434,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_basic_expr_eexpr_dot_expressions_ = 
-# 1232 "parser_cocci_menhir.mly"
+# 1233 "parser_cocci_menhir.mly"
                                                              ( _1 )
 # 4440 "parser_cocci_menhir.ml"
          in
@@ -4458,7 +4458,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_basic_expr_eexpr_nest_expressions_ = 
-# 1232 "parser_cocci_menhir.mly"
+# 1233 "parser_cocci_menhir.mly"
                                                              ( _1 )
 # 4464 "parser_cocci_menhir.ml"
          in
@@ -4482,7 +4482,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_basic_expr_expr_invalid_ = 
-# 1232 "parser_cocci_menhir.mly"
+# 1233 "parser_cocci_menhir.mly"
                                                              ( _1 )
 # 4488 "parser_cocci_menhir.ml"
          in
@@ -4526,7 +4526,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_case_line = 
-# 942 "parser_cocci_menhir.mly"
+# 943 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Default(P.clt2mcode "default" _1,P.clt2mcode ":" _2,_3)) )
 # 4532 "parser_cocci_menhir.ml"
          in
@@ -4576,7 +4576,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
         let _v : 'tv_case_line = 
-# 944 "parser_cocci_menhir.mly"
+# 945 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Case(P.clt2mcode "case" _1,_2,P.clt2mcode ":" _3,_4)) )
 # 4582 "parser_cocci_menhir.ml"
          in
@@ -4600,7 +4600,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_cast_expr_eexpr_dot_expressions_ = 
-# 1292 "parser_cocci_menhir.mly"
+# 1293 "parser_cocci_menhir.mly"
                                           ( _1 )
 # 4606 "parser_cocci_menhir.ml"
          in
@@ -4650,7 +4650,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_lp_ in
         let _endpos = _endpos_e_ in
         let _v : 'tv_cast_expr_eexpr_dot_expressions_ = 
-# 1294 "parser_cocci_menhir.mly"
+# 1295 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Cast (P.clt2mcode "(" lp, t,
                             P.clt2mcode ")" rp, e)) )
 # 4657 "parser_cocci_menhir.ml"
@@ -4675,7 +4675,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_cast_expr_eexpr_invalid_ = 
-# 1292 "parser_cocci_menhir.mly"
+# 1293 "parser_cocci_menhir.mly"
                                           ( _1 )
 # 4681 "parser_cocci_menhir.ml"
          in
@@ -4725,7 +4725,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_lp_ in
         let _endpos = _endpos_e_ in
         let _v : 'tv_cast_expr_eexpr_invalid_ = 
-# 1294 "parser_cocci_menhir.mly"
+# 1295 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Cast (P.clt2mcode "(" lp, t,
                             P.clt2mcode ")" rp, e)) )
 # 4732 "parser_cocci_menhir.ml"
@@ -4750,7 +4750,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_cast_expr_eexpr_nest_expressions_ = 
-# 1292 "parser_cocci_menhir.mly"
+# 1293 "parser_cocci_menhir.mly"
                                           ( _1 )
 # 4756 "parser_cocci_menhir.ml"
          in
@@ -4800,7 +4800,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_lp_ in
         let _endpos = _endpos_e_ in
         let _v : 'tv_cast_expr_eexpr_nest_expressions_ = 
-# 1294 "parser_cocci_menhir.mly"
+# 1295 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Cast (P.clt2mcode "(" lp, t,
                             P.clt2mcode ")" rp, e)) )
 # 4807 "parser_cocci_menhir.ml"
@@ -4825,7 +4825,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_cast_expr_expr_invalid_ = 
-# 1292 "parser_cocci_menhir.mly"
+# 1293 "parser_cocci_menhir.mly"
                                           ( _1 )
 # 4831 "parser_cocci_menhir.ml"
          in
@@ -4875,7 +4875,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_lp_ in
         let _endpos = _endpos_e_ in
         let _v : 'tv_cast_expr_expr_invalid_ = 
-# 1294 "parser_cocci_menhir.mly"
+# 1295 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Cast (P.clt2mcode "(" lp, t,
                             P.clt2mcode ")" rp, e)) )
 # 4882 "parser_cocci_menhir.ml"
@@ -4942,7 +4942,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_comma_decls_TEllipsis_decl_ = 
-# 1567 "parser_cocci_menhir.mly"
+# 1568 "parser_cocci_menhir.mly"
     ( function dot_builder ->
       [Ast0.wrap(Ast0.PComma(P.clt2mcode "," _1));
        dot_builder _2] )
@@ -4978,7 +4978,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_comma_decls_TEllipsis_decl_ = 
-# 1571 "parser_cocci_menhir.mly"
+# 1572 "parser_cocci_menhir.mly"
     ( function dot_builder ->
       [Ast0.wrap(Ast0.PComma(P.clt2mcode "," _1)); _2] )
 # 4985 "parser_cocci_menhir.ml"
@@ -5017,7 +5017,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_comma_decls_TEllipsis_name_opt_decl_ = 
-# 1567 "parser_cocci_menhir.mly"
+# 1568 "parser_cocci_menhir.mly"
     ( function dot_builder ->
       [Ast0.wrap(Ast0.PComma(P.clt2mcode "," _1));
        dot_builder _2] )
@@ -5053,7 +5053,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_comma_decls_TEllipsis_name_opt_decl_ = 
-# 1571 "parser_cocci_menhir.mly"
+# 1572 "parser_cocci_menhir.mly"
     ( function dot_builder ->
       [Ast0.wrap(Ast0.PComma(P.clt2mcode "," _1)); _2] )
 # 5060 "parser_cocci_menhir.ml"
@@ -5071,7 +5071,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_comma_initializers_edots_when_TEllipsis_initialize__ = 
-# 1123 "parser_cocci_menhir.mly"
+# 1124 "parser_cocci_menhir.mly"
               ( [] )
 # 5077 "parser_cocci_menhir.ml"
          in
@@ -5101,7 +5101,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_d_ in
         let _endpos = _endpos_r_ in
         let _v : 'tv_comma_initializers_edots_when_TEllipsis_initialize__ = 
-# 1125 "parser_cocci_menhir.mly"
+# 1126 "parser_cocci_menhir.mly"
       ( (function dot_builder -> [dot_builder d])::r )
 # 5107 "parser_cocci_menhir.ml"
          in
@@ -5141,7 +5141,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_i_ in
         let _endpos = _endpos_r_ in
         let _v : 'tv_comma_initializers_edots_when_TEllipsis_initialize__ = 
-# 1127 "parser_cocci_menhir.mly"
+# 1128 "parser_cocci_menhir.mly"
     ( (function dot_builder -> [i; Ast0.wrap(Ast0.IComma(P.clt2mcode "," c))])::
       r )
 # 5148 "parser_cocci_menhir.ml"
@@ -5159,7 +5159,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_comma_initializers2_edots_when_TEllipsis_initialize__ = 
-# 1131 "parser_cocci_menhir.mly"
+# 1132 "parser_cocci_menhir.mly"
               ( [] )
 # 5165 "parser_cocci_menhir.ml"
          in
@@ -5199,7 +5199,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_i_ in
         let _endpos = _endpos_r_ in
         let _v : 'tv_comma_initializers2_edots_when_TEllipsis_initialize__ = 
-# 1133 "parser_cocci_menhir.mly"
+# 1134 "parser_cocci_menhir.mly"
     ( (function dot_builder -> [i; Ast0.wrap(Ast0.IComma(P.clt2mcode "," c))])::
       r )
 # 5206 "parser_cocci_menhir.ml"
@@ -5224,7 +5224,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_comma_list_any_strict_ = 
-# 1798 "parser_cocci_menhir.mly"
+# 1799 "parser_cocci_menhir.mly"
                                        ( _1 )
 # 5230 "parser_cocci_menhir.ml"
          in
@@ -5248,7 +5248,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_comma_list_ctype_ = 
-# 1798 "parser_cocci_menhir.mly"
+# 1799 "parser_cocci_menhir.mly"
                                        ( _1 )
 # 5254 "parser_cocci_menhir.ml"
          in
@@ -5272,7 +5272,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_comma_list_d_ident_ = 
-# 1798 "parser_cocci_menhir.mly"
+# 1799 "parser_cocci_menhir.mly"
                                        ( _1 )
 # 5278 "parser_cocci_menhir.ml"
          in
@@ -5296,7 +5296,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_comma_list_dexpr_ = 
-# 1798 "parser_cocci_menhir.mly"
+# 1799 "parser_cocci_menhir.mly"
                                        ( _1 )
 # 5302 "parser_cocci_menhir.ml"
          in
@@ -5320,7 +5320,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_comma_list_ident_or_const_ = 
-# 1798 "parser_cocci_menhir.mly"
+# 1799 "parser_cocci_menhir.mly"
                                        ( _1 )
 # 5326 "parser_cocci_menhir.ml"
          in
@@ -5344,7 +5344,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_comma_list_meta_ident_ = 
-# 1798 "parser_cocci_menhir.mly"
+# 1799 "parser_cocci_menhir.mly"
                                        ( _1 )
 # 5350 "parser_cocci_menhir.ml"
          in
@@ -5368,7 +5368,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_comma_list_pure_ident_ = 
-# 1798 "parser_cocci_menhir.mly"
+# 1799 "parser_cocci_menhir.mly"
                                        ( _1 )
 # 5374 "parser_cocci_menhir.ml"
          in
@@ -5392,7 +5392,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_comma_list_pure_ident_or_meta_ident_ = 
-# 1798 "parser_cocci_menhir.mly"
+# 1799 "parser_cocci_menhir.mly"
                                        ( _1 )
 # 5398 "parser_cocci_menhir.ml"
          in
@@ -5416,7 +5416,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_comma_list_pure_ident_or_meta_ident_with_not_eq_not_ceq__ = 
-# 1798 "parser_cocci_menhir.mly"
+# 1799 "parser_cocci_menhir.mly"
                                        ( _1 )
 # 5422 "parser_cocci_menhir.ml"
          in
@@ -5440,7 +5440,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_comma_list_pure_ident_or_meta_ident_with_not_eq_not_eq__ = 
-# 1798 "parser_cocci_menhir.mly"
+# 1799 "parser_cocci_menhir.mly"
                                        ( _1 )
 # 5446 "parser_cocci_menhir.ml"
          in
@@ -5464,7 +5464,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_comma_list_pure_ident_or_meta_ident_with_not_eq_not_eqe__ = 
-# 1798 "parser_cocci_menhir.mly"
+# 1799 "parser_cocci_menhir.mly"
                                        ( _1 )
 # 5470 "parser_cocci_menhir.ml"
          in
@@ -5488,7 +5488,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_comma_list_pure_ident_or_meta_ident_with_not_eq_not_pos__ = 
-# 1798 "parser_cocci_menhir.mly"
+# 1799 "parser_cocci_menhir.mly"
                                        ( _1 )
 # 5494 "parser_cocci_menhir.ml"
          in
@@ -5512,7 +5512,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_comma_list_pure_ident_or_meta_ident_with_seed_ = 
-# 1798 "parser_cocci_menhir.mly"
+# 1799 "parser_cocci_menhir.mly"
                                        ( _1 )
 # 5518 "parser_cocci_menhir.ml"
          in
@@ -5536,7 +5536,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_cond_expr_eexpr_dot_expressions_ = 
-# 1257 "parser_cocci_menhir.mly"
+# 1258 "parser_cocci_menhir.mly"
                                              ( _1 )
 # 5542 "parser_cocci_menhir.ml"
          in
@@ -5592,7 +5592,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_l_ in
         let _endpos = _endpos_r_ in
         let _v : 'tv_cond_expr_eexpr_dot_expressions_ = 
-# 1259 "parser_cocci_menhir.mly"
+# 1260 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.CondExpr (l, P.clt2mcode "?" w, t,
                                 P.clt2mcode ":" dd, r)) )
 # 5599 "parser_cocci_menhir.ml"
@@ -5617,7 +5617,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_cond_expr_eexpr_nest_expressions_ = 
-# 1257 "parser_cocci_menhir.mly"
+# 1258 "parser_cocci_menhir.mly"
                                              ( _1 )
 # 5623 "parser_cocci_menhir.ml"
          in
@@ -5673,7 +5673,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_l_ in
         let _endpos = _endpos_r_ in
         let _v : 'tv_cond_expr_eexpr_nest_expressions_ = 
-# 1259 "parser_cocci_menhir.mly"
+# 1260 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.CondExpr (l, P.clt2mcode "?" w, t,
                                 P.clt2mcode ":" dd, r)) )
 # 5680 "parser_cocci_menhir.ml"
@@ -5698,7 +5698,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_cond_expr_expr_invalid_ = 
-# 1257 "parser_cocci_menhir.mly"
+# 1258 "parser_cocci_menhir.mly"
                                              ( _1 )
 # 5704 "parser_cocci_menhir.ml"
          in
@@ -5754,7 +5754,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_l_ in
         let _endpos = _endpos_r_ in
         let _v : 'tv_cond_expr_expr_invalid_ = 
-# 1259 "parser_cocci_menhir.mly"
+# 1260 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.CondExpr (l, P.clt2mcode "?" w, t,
                                 P.clt2mcode ":" dd, r)) )
 # 5761 "parser_cocci_menhir.ml"
@@ -5783,7 +5783,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_const_vol = 
-# 851 "parser_cocci_menhir.mly"
+# 852 "parser_cocci_menhir.mly"
                    ( P.clt2mcode Ast.Const _1 )
 # 5789 "parser_cocci_menhir.ml"
          in
@@ -5811,7 +5811,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_const_vol = 
-# 852 "parser_cocci_menhir.mly"
+# 853 "parser_cocci_menhir.mly"
                    ( P.clt2mcode Ast.Volatile _1 )
 # 5817 "parser_cocci_menhir.ml"
          in
@@ -6352,7 +6352,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_d_ident = 
-# 1061 "parser_cocci_menhir.mly"
+# 1062 "parser_cocci_menhir.mly"
       ( (_1,
         function t ->
           List.fold_right
@@ -6389,7 +6389,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_t_ in
         let _endpos = _endpos_i_ in
         let _v : 'tv_decl = 
-# 821 "parser_cocci_menhir.mly"
+# 822 "parser_cocci_menhir.mly"
  ( Ast0.wrap(Ast0.Param(t, Some i)) )
 # 6395 "parser_cocci_menhir.ml"
          in
@@ -6475,7 +6475,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_t_ in
         let _endpos = _endpos_rp1_ in
         let _v : 'tv_decl = 
-# 824 "parser_cocci_menhir.mly"
+# 825 "parser_cocci_menhir.mly"
         ( let fnptr =
          Ast0.wrap
            (Ast0.FunctionPointer
@@ -6508,7 +6508,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_t_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_decl = 
-# 831 "parser_cocci_menhir.mly"
+# 832 "parser_cocci_menhir.mly"
  ( let ty =
          Ast0.wrap(Ast0.BaseType(Ast.VoidType,[P.clt2mcode "void" t])) in
           Ast0.wrap(Ast0.VoidParam(ty)) )
@@ -6538,7 +6538,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_decl = 
-# 835 "parser_cocci_menhir.mly"
+# 836 "parser_cocci_menhir.mly"
  ( let (nm,pure,clt) = _1 in
        Ast0.wrap(Ast0.MetaParam(P.clt2mcode nm clt,pure)) )
 # 6545 "parser_cocci_menhir.ml"
@@ -6567,7 +6567,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_decl_ident = 
-# 1516 "parser_cocci_menhir.mly"
+# 1517 "parser_cocci_menhir.mly"
          ( Ast0.wrap(Ast0.Id(P.id2mcode _1)) )
 # 6573 "parser_cocci_menhir.ml"
          in
@@ -6595,7 +6595,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_decl_ident = 
-# 1518 "parser_cocci_menhir.mly"
+# 1519 "parser_cocci_menhir.mly"
          ( let (nm,constraints,pure,clt) = _1 in
          Ast0.wrap(Ast0.MetaId(P.clt2mcode nm clt,constraints,pure)) )
 # 6602 "parser_cocci_menhir.ml"
@@ -6613,7 +6613,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_decl_list_decl_ = 
-# 1538 "parser_cocci_menhir.mly"
+# 1539 "parser_cocci_menhir.mly"
               ( Ast0.wrap(Ast0.DOTS([])) )
 # 6619 "parser_cocci_menhir.ml"
          in
@@ -6637,7 +6637,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_decl_list_decl_ = 
-# 1540 "parser_cocci_menhir.mly"
+# 1541 "parser_cocci_menhir.mly"
      (let circle x =
        match Ast0.unwrap x with Ast0.Pcircles(_) -> true | _ -> false in
      if List.exists circle _1
@@ -6658,7 +6658,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_decl_list_name_opt_decl_ = 
-# 1538 "parser_cocci_menhir.mly"
+# 1539 "parser_cocci_menhir.mly"
               ( Ast0.wrap(Ast0.DOTS([])) )
 # 6664 "parser_cocci_menhir.ml"
          in
@@ -6682,7 +6682,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_decl_list_name_opt_decl_ = 
-# 1540 "parser_cocci_menhir.mly"
+# 1541 "parser_cocci_menhir.mly"
      (let circle x =
        match Ast0.unwrap x with Ast0.Pcircles(_) -> true | _ -> false in
      if List.exists circle _1
@@ -6710,7 +6710,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_decl_list_start_decl_ = 
-# 1547 "parser_cocci_menhir.mly"
+# 1548 "parser_cocci_menhir.mly"
                  ( [_1] )
 # 6716 "parser_cocci_menhir.ml"
          in
@@ -6750,7 +6750,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_decl_list_start_decl_ = 
-# 1549 "parser_cocci_menhir.mly"
+# 1550 "parser_cocci_menhir.mly"
     ( _1::Ast0.wrap(Ast0.PComma(P.clt2mcode "," _2))::_3 )
 # 6756 "parser_cocci_menhir.ml"
          in
@@ -6784,7 +6784,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_decl_list_start_decl_ = 
-# 1551 "parser_cocci_menhir.mly"
+# 1552 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.Pdots(P.clt2mcode "..." _1))::
       (List.concat(List.map (function x -> x (P.mkpdots "...")) _2)) )
 # 6791 "parser_cocci_menhir.ml"
@@ -6809,7 +6809,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_decl_list_start_name_opt_decl_ = 
-# 1547 "parser_cocci_menhir.mly"
+# 1548 "parser_cocci_menhir.mly"
                  ( [_1] )
 # 6815 "parser_cocci_menhir.ml"
          in
@@ -6849,7 +6849,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_decl_list_start_name_opt_decl_ = 
-# 1549 "parser_cocci_menhir.mly"
+# 1550 "parser_cocci_menhir.mly"
     ( _1::Ast0.wrap(Ast0.PComma(P.clt2mcode "," _2))::_3 )
 # 6855 "parser_cocci_menhir.ml"
          in
@@ -6883,7 +6883,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_decl_list_start_name_opt_decl_ = 
-# 1551 "parser_cocci_menhir.mly"
+# 1552 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.Pdots(P.clt2mcode "..." _1))::
       (List.concat(List.map (function x -> x (P.mkpdots "...")) _2)) )
 # 6890 "parser_cocci_menhir.ml"
@@ -6912,7 +6912,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_decl_statement = 
-# 1139 "parser_cocci_menhir.mly"
+# 1140 "parser_cocci_menhir.mly"
       ( let (nm,pure,clt) = _1 in
       [Ast0.wrap(Ast0.MetaStmt(P.clt2mcode nm clt,pure))] )
 # 6919 "parser_cocci_menhir.ml"
@@ -6937,7 +6937,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_decl_statement = 
-# 1142 "parser_cocci_menhir.mly"
+# 1143 "parser_cocci_menhir.mly"
       ( List.map
          (function x ->
            Ast0.wrap
@@ -6965,7 +6965,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_decl_statement = 
-# 1147 "parser_cocci_menhir.mly"
+# 1148 "parser_cocci_menhir.mly"
               ( [_1] )
 # 6971 "parser_cocci_menhir.ml"
          in
@@ -7009,7 +7009,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_decl_statement = 
-# 1156 "parser_cocci_menhir.mly"
+# 1157 "parser_cocci_menhir.mly"
       ( let (mids,code) = t in
        if List.for_all
            (function x ->
@@ -7045,7 +7045,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_decl_statement_expr = 
-# 1169 "parser_cocci_menhir.mly"
+# 1170 "parser_cocci_menhir.mly"
       ( let (nm,pure,clt) = _1 in
       [Ast0.wrap(Ast0.MetaStmt(P.clt2mcode nm clt,pure))] )
 # 7052 "parser_cocci_menhir.ml"
@@ -7070,7 +7070,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_decl_statement_expr = 
-# 1172 "parser_cocci_menhir.mly"
+# 1173 "parser_cocci_menhir.mly"
       ( List.map
          (function x ->
            Ast0.wrap
@@ -7098,7 +7098,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_decl_statement_expr = 
-# 1177 "parser_cocci_menhir.mly"
+# 1178 "parser_cocci_menhir.mly"
               ( [_1] )
 # 7104 "parser_cocci_menhir.ml"
          in
@@ -7142,7 +7142,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_decl_statement_expr = 
-# 1186 "parser_cocci_menhir.mly"
+# 1187 "parser_cocci_menhir.mly"
       ( let (mids,code) = t in
        if List.for_all (function [] -> true | _ -> false) code
       then []
@@ -7183,7 +7183,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_t_ in
         let _endpos = _endpos_pv_ in
         let _v : 'tv_decl_var = 
-# 952 "parser_cocci_menhir.mly"
+# 953 "parser_cocci_menhir.mly"
       ( [Ast0.wrap(Ast0.TyDecl(t,P.clt2mcode ";" pv))] )
 # 7189 "parser_cocci_menhir.ml"
          in
@@ -7230,7 +7230,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 954 "parser_cocci_menhir.mly"
+# 955 "parser_cocci_menhir.mly"
       ( List.map
          (function (id,fn) ->
            Ast0.wrap(Ast0.UnInit(s,fn t,id,P.clt2mcode ";" pv)))
@@ -7287,7 +7287,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 954 "parser_cocci_menhir.mly"
+# 955 "parser_cocci_menhir.mly"
       ( List.map
          (function (id,fn) ->
            Ast0.wrap(Ast0.UnInit(s,fn t,id,P.clt2mcode ";" pv)))
@@ -7314,7 +7314,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_f_ in
         let _endpos = _endpos_f_ in
         let _v : 'tv_decl_var = 
-# 958 "parser_cocci_menhir.mly"
+# 959 "parser_cocci_menhir.mly"
                ( [f] )
 # 7320 "parser_cocci_menhir.ml"
          in
@@ -7377,7 +7377,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 960 "parser_cocci_menhir.mly"
+# 961 "parser_cocci_menhir.mly"
       (let (id,fn) = d in
       [Ast0.wrap(Ast0.Init(s,fn t,id,P.clt2mcode "=" q,e,P.clt2mcode ";" pv))])
 # 7384 "parser_cocci_menhir.ml"
@@ -7448,7 +7448,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 960 "parser_cocci_menhir.mly"
+# 961 "parser_cocci_menhir.mly"
       (let (id,fn) = d in
       [Ast0.wrap(Ast0.Init(s,fn t,id,P.clt2mcode "=" q,e,P.clt2mcode ";" pv))])
 # 7455 "parser_cocci_menhir.ml"
@@ -7503,7 +7503,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 965 "parser_cocci_menhir.mly"
+# 966 "parser_cocci_menhir.mly"
       ( List.map
          (function (id,fn) ->
            let idtype =
@@ -7569,7 +7569,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 965 "parser_cocci_menhir.mly"
+# 966 "parser_cocci_menhir.mly"
       ( List.map
          (function (id,fn) ->
            let idtype =
@@ -7635,7 +7635,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 965 "parser_cocci_menhir.mly"
+# 966 "parser_cocci_menhir.mly"
       ( List.map
          (function (id,fn) ->
            let idtype =
@@ -7708,7 +7708,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 965 "parser_cocci_menhir.mly"
+# 966 "parser_cocci_menhir.mly"
       ( List.map
          (function (id,fn) ->
            let idtype =
@@ -7783,7 +7783,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 973 "parser_cocci_menhir.mly"
+# 974 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
       !Data.add_type_name (P.id2name i);
       let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
@@ -7864,7 +7864,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 973 "parser_cocci_menhir.mly"
+# 974 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
       !Data.add_type_name (P.id2name i);
       let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
@@ -7945,7 +7945,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 973 "parser_cocci_menhir.mly"
+# 974 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
       !Data.add_type_name (P.id2name i);
       let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
@@ -8033,7 +8033,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 973 "parser_cocci_menhir.mly"
+# 974 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
       !Data.add_type_name (P.id2name i);
       let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
@@ -8140,7 +8140,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 983 "parser_cocci_menhir.mly"
+# 984 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         let t =
          Ast0.wrap
@@ -8256,7 +8256,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 983 "parser_cocci_menhir.mly"
+# 984 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         let t =
          Ast0.wrap
@@ -8322,7 +8322,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__5_ in
         let _v : 'tv_decl_var = 
-# 991 "parser_cocci_menhir.mly"
+# 992 "parser_cocci_menhir.mly"
       ( [Ast0.wrap(Ast0.MacroDecl(_1,P.clt2mcode "(" _2,_3,
                                  P.clt2mcode ")" _4,P.clt2mcode ";" _5))] )
 # 8329 "parser_cocci_menhir.ml"
@@ -8442,7 +8442,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 997 "parser_cocci_menhir.mly"
+# 998 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         let t =
          Ast0.wrap
@@ -8574,7 +8574,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
         in
         
-# 997 "parser_cocci_menhir.mly"
+# 998 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         let t =
          Ast0.wrap
@@ -8630,7 +8630,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_s_ in
         let _endpos = _endpos_pv_ in
         let _v : 'tv_decl_var = 
-# 1005 "parser_cocci_menhir.mly"
+# 1006 "parser_cocci_menhir.mly"
       ( let s = P.clt2mcode "typedef" s in
         [Ast0.wrap(Ast0.Typedef(s,t,id,P.clt2mcode ";" pv))] )
 # 8637 "parser_cocci_menhir.ml"
@@ -8655,7 +8655,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_define_param_list = 
-# 713 "parser_cocci_menhir.mly"
+# 714 "parser_cocci_menhir.mly"
      (let circle x =
        match Ast0.unwrap x with Ast0.DPcircles(_) -> true | _ -> false in
      if List.exists circle _1
@@ -8683,7 +8683,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_define_param_list_option = 
-# 737 "parser_cocci_menhir.mly"
+# 738 "parser_cocci_menhir.mly"
                                             ( _1 )
 # 8689 "parser_cocci_menhir.ml"
          in
@@ -8700,7 +8700,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_define_param_list_option = 
-# 738 "parser_cocci_menhir.mly"
+# 739 "parser_cocci_menhir.mly"
                            ( Ast0.wrap(Ast0.DOTS([])) )
 # 8706 "parser_cocci_menhir.ml"
          in
@@ -8724,7 +8724,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_define_param_list_start = 
-# 720 "parser_cocci_menhir.mly"
+# 721 "parser_cocci_menhir.mly"
           ( [Ast0.wrap(Ast0.DParam _1)] )
 # 8730 "parser_cocci_menhir.ml"
          in
@@ -8764,7 +8764,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_define_param_list_start = 
-# 722 "parser_cocci_menhir.mly"
+# 723 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.DParam _1)::
        Ast0.wrap(Ast0.DPComma(P.clt2mcode "," _2))::_3 )
 # 8771 "parser_cocci_menhir.ml"
@@ -8799,7 +8799,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_d_ in
         let _endpos = _endpos_r_ in
         let _v : 'tv_define_param_list_start = 
-# 725 "parser_cocci_menhir.mly"
+# 726 "parser_cocci_menhir.mly"
       ( (P.mkdpdots "..." d)::
        (List.concat (List.map (function x -> x (P.mkdpdots "...")) r)) )
 # 8806 "parser_cocci_menhir.ml"
@@ -8881,18 +8881,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : 'tv_define_param_list_option = Obj.magic _2 in
         let _1 : (
 # 82 "parser_cocci_menhir.mly"
-       (Data.clt * token * int)
+       (Data.clt * token * int * int)
 # 8886 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_defineop = 
 # 690 "parser_cocci_menhir.mly"
-    ( let (clt,ident,parenoff) = _1 in
+    ( let (clt,ident,parenoff,parencol) = _1 in
+      (* clt is the start of the #define itself *)
       let (arity,line,lline,offset,col,strbef,straft,pos) = clt in
       let lp =
        P.clt2mcode "("
-         (arity,line,lline,parenoff,0,[],[],Ast0.NoMetaPos) in
+         (arity,line,lline,parenoff,parencol,[],[],Ast0.NoMetaPos) in
       function body ->
        Ast0.wrap
          (Ast0.Define
@@ -8907,7 +8908,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
                    (Semantic_cocci.Semantic
                       "unexpected name for a #define")),
              Ast0.wrap (Ast0.DParams (lp,_2,P.clt2mcode ")" _3)),body)) )
-# 8911 "parser_cocci_menhir.ml"
+# 8912 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -8931,7 +8932,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_dep = 
 # 225 "parser_cocci_menhir.mly"
                    ( _1 )
-# 8935 "parser_cocci_menhir.ml"
+# 8936 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -8965,7 +8966,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_dep = 
 # 226 "parser_cocci_menhir.mly"
                    ( Ast.AndDep(_1, _3) )
-# 8969 "parser_cocci_menhir.ml"
+# 8970 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -8999,7 +9000,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_dep = 
 # 227 "parser_cocci_menhir.mly"
                    ( Ast.OrDep (_1, _3) )
-# 9003 "parser_cocci_menhir.ml"
+# 9004 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9016,7 +9017,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_depends = 
 # 221 "parser_cocci_menhir.mly"
                            ( Ast.NoDep )
-# 9020 "parser_cocci_menhir.ml"
+# 9021 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9048,7 +9049,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_depends = 
 # 222 "parser_cocci_menhir.mly"
                            ( parents )
-# 9052 "parser_cocci_menhir.ml"
+# 9053 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9075,14 +9076,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9079 "parser_cocci_menhir.ml"
+# 9080 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_designator = 
-# 1103 "parser_cocci_menhir.mly"
+# 1104 "parser_cocci_menhir.mly"
      ( Ast0.DesignatorField (P.clt2mcode "." _1,_2) )
-# 9086 "parser_cocci_menhir.ml"
+# 9087 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9113,20 +9114,20 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 102 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9117 "parser_cocci_menhir.ml"
+# 9118 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_eexpr = Obj.magic _2 in
         let _1 : (
 # 102 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9123 "parser_cocci_menhir.ml"
+# 9124 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_designator = 
-# 1105 "parser_cocci_menhir.mly"
+# 1106 "parser_cocci_menhir.mly"
      ( Ast0.DesignatorIndex (P.clt2mcode "[" _1,_2,P.clt2mcode "]" _3) )
-# 9130 "parser_cocci_menhir.ml"
+# 9131 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9167,27 +9168,27 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _5 : (
 # 102 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9171 "parser_cocci_menhir.ml"
+# 9172 "parser_cocci_menhir.ml"
         ) = Obj.magic _5 in
         let _4 : 'tv_eexpr = Obj.magic _4 in
         let _3 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9177 "parser_cocci_menhir.ml"
+# 9178 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_eexpr = Obj.magic _2 in
         let _1 : (
 # 102 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9183 "parser_cocci_menhir.ml"
+# 9184 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__5_ in
         let _v : 'tv_designator = 
-# 1107 "parser_cocci_menhir.mly"
+# 1108 "parser_cocci_menhir.mly"
      ( Ast0.DesignatorRange (P.clt2mcode "[" _1,_2,P.clt2mcode "..." _3,
                             _4,P.clt2mcode "]" _5) )
-# 9191 "parser_cocci_menhir.ml"
+# 9192 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9209,9 +9210,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_dexpr = 
-# 1206 "parser_cocci_menhir.mly"
+# 1207 "parser_cocci_menhir.mly"
                                           ( _1 )
-# 9215 "parser_cocci_menhir.ml"
+# 9216 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9239,7 +9240,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_disable = 
 # 240 "parser_cocci_menhir.mly"
                                                       ( List.map P.id2name _2 )
-# 9243 "parser_cocci_menhir.ml"
+# 9244 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9260,14 +9261,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9264 "parser_cocci_menhir.ml"
+# 9265 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_dot_expressions = 
-# 1215 "parser_cocci_menhir.mly"
+# 1216 "parser_cocci_menhir.mly"
             ( Ast0.wrap(Ast0.Edots(P.clt2mcode "..." _1,None)) )
-# 9271 "parser_cocci_menhir.ml"
+# 9272 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9289,9 +9290,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_dot_expressions = 
-# 1216 "parser_cocci_menhir.mly"
+# 1217 "parser_cocci_menhir.mly"
                    ( _1 )
-# 9295 "parser_cocci_menhir.ml"
+# 9296 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9317,20 +9318,20 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let d : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9321 "parser_cocci_menhir.ml"
+# 9322 "parser_cocci_menhir.ml"
         ) = Obj.magic d in
         let c : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9326 "parser_cocci_menhir.ml"
+# 9327 "parser_cocci_menhir.ml"
         ) = Obj.magic c in
         let _startpos = _startpos_c_ in
         let _endpos = _endpos_d_ in
         let _v : 'tv_dp_comma_args_TEllipsis_ = 
-# 730 "parser_cocci_menhir.mly"
+# 731 "parser_cocci_menhir.mly"
     ( function dot_builder ->
       [Ast0.wrap(Ast0.DPComma(P.clt2mcode "," c)); dot_builder d] )
-# 9334 "parser_cocci_menhir.ml"
+# 9335 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9357,16 +9358,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9361 "parser_cocci_menhir.ml"
+# 9362 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_dp_comma_args_TEllipsis_ = 
-# 733 "parser_cocci_menhir.mly"
+# 734 "parser_cocci_menhir.mly"
     ( function dot_builder ->
       [Ast0.wrap(Ast0.DPComma(P.clt2mcode "," _1));
        Ast0.wrap(Ast0.DParam _2)] )
-# 9370 "parser_cocci_menhir.ml"
+# 9371 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9387,14 +9388,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let d : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9391 "parser_cocci_menhir.ml"
+# 9392 "parser_cocci_menhir.ml"
         ) = Obj.magic d in
         let _startpos = _startpos_d_ in
         let _endpos = _endpos_d_ in
         let _v : 'tv_edots_when_TEllipsis_eexpr_ = 
-# 1808 "parser_cocci_menhir.mly"
+# 1809 "parser_cocci_menhir.mly"
                                                   ( (d,None) )
-# 9398 "parser_cocci_menhir.ml"
+# 9399 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9433,14 +9434,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let d : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9437 "parser_cocci_menhir.ml"
+# 9438 "parser_cocci_menhir.ml"
         ) = Obj.magic d in
         let _startpos = _startpos_d_ in
         let _endpos = _endpos__5_ in
         let _v : 'tv_edots_when_TEllipsis_eexpr_ = 
-# 1809 "parser_cocci_menhir.mly"
+# 1810 "parser_cocci_menhir.mly"
                                                   ( (d,Some w) )
-# 9444 "parser_cocci_menhir.ml"
+# 9445 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9461,14 +9462,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let d : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9465 "parser_cocci_menhir.ml"
+# 9466 "parser_cocci_menhir.ml"
         ) = Obj.magic d in
         let _startpos = _startpos_d_ in
         let _endpos = _endpos_d_ in
         let _v : 'tv_edots_when_TEllipsis_initialize_ = 
-# 1808 "parser_cocci_menhir.mly"
+# 1809 "parser_cocci_menhir.mly"
                                                   ( (d,None) )
-# 9472 "parser_cocci_menhir.ml"
+# 9473 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9507,14 +9508,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let d : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9511 "parser_cocci_menhir.ml"
+# 9512 "parser_cocci_menhir.ml"
         ) = Obj.magic d in
         let _startpos = _startpos_d_ in
         let _endpos = _endpos__5_ in
         let _v : 'tv_edots_when_TEllipsis_initialize_ = 
-# 1809 "parser_cocci_menhir.mly"
+# 1810 "parser_cocci_menhir.mly"
                                                   ( (d,Some w) )
-# 9518 "parser_cocci_menhir.ml"
+# 9519 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9535,14 +9536,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let d : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9539 "parser_cocci_menhir.ml"
+# 9540 "parser_cocci_menhir.ml"
         ) = Obj.magic d in
         let _startpos = _startpos_d_ in
         let _endpos = _endpos_d_ in
         let _v : 'tv_edots_when_TEllipsis_struct_decl_ = 
-# 1808 "parser_cocci_menhir.mly"
+# 1809 "parser_cocci_menhir.mly"
                                                   ( (d,None) )
-# 9546 "parser_cocci_menhir.ml"
+# 9547 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9581,14 +9582,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let d : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9585 "parser_cocci_menhir.ml"
+# 9586 "parser_cocci_menhir.ml"
         ) = Obj.magic d in
         let _startpos = _startpos_d_ in
         let _endpos = _endpos__5_ in
         let _v : 'tv_edots_when_TEllipsis_struct_decl_ = 
-# 1809 "parser_cocci_menhir.mly"
+# 1810 "parser_cocci_menhir.mly"
                                                   ( (d,Some w) )
-# 9592 "parser_cocci_menhir.ml"
+# 9593 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9610,9 +9611,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_eexpr = 
-# 1204 "parser_cocci_menhir.mly"
+# 1205 "parser_cocci_menhir.mly"
                                          ( _1 )
-# 9616 "parser_cocci_menhir.ml"
+# 9617 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9634,7 +9635,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_eexpr_list = 
-# 1752 "parser_cocci_menhir.mly"
+# 1753 "parser_cocci_menhir.mly"
      (let circle x =
        match Ast0.unwrap x with Ast0.Ecircles(_) -> true | _ -> false in
      let star x =
@@ -9645,7 +9646,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
        if List.exists star _1
        then Ast0.wrap(Ast0.STARS(_1))
        else Ast0.wrap(Ast0.DOTS(_1)) )
-# 9649 "parser_cocci_menhir.ml"
+# 9650 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9667,9 +9668,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_eexpr_list_option = 
-# 1791 "parser_cocci_menhir.mly"
+# 1792 "parser_cocci_menhir.mly"
                               ( _1 )
-# 9673 "parser_cocci_menhir.ml"
+# 9674 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9684,9 +9685,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_eexpr_list_option = 
-# 1792 "parser_cocci_menhir.mly"
+# 1793 "parser_cocci_menhir.mly"
                            ( Ast0.wrap(Ast0.DOTS([])) )
-# 9690 "parser_cocci_menhir.ml"
+# 9691 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9708,9 +9709,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_eexpr_list_start = 
-# 1779 "parser_cocci_menhir.mly"
+# 1780 "parser_cocci_menhir.mly"
           ( [_1] )
-# 9714 "parser_cocci_menhir.ml"
+# 9715 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9742,15 +9743,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 9746 "parser_cocci_menhir.ml"
+# 9747 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_aexpr = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_eexpr_list_start = 
-# 1781 "parser_cocci_menhir.mly"
+# 1782 "parser_cocci_menhir.mly"
       ( _1::Ast0.wrap(Ast0.EComma(P.clt2mcode "," _2))::_3 )
-# 9754 "parser_cocci_menhir.ml"
+# 9755 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9792,9 +9793,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__6_ in
         let _v : 'tv_error_words = 
-# 1578 "parser_cocci_menhir.mly"
+# 1579 "parser_cocci_menhir.mly"
       ( [Ast0.wrap(Ast0.ERRORWORDS(cl))] )
-# 9798 "parser_cocci_menhir.ml"
+# 9799 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9816,7 +9817,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_exists = 
 # 243 "parser_cocci_menhir.mly"
           ( Ast.Exists )
-# 9820 "parser_cocci_menhir.ml"
+# 9821 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9838,7 +9839,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_exists = 
 # 244 "parser_cocci_menhir.mly"
           ( Ast.Forall )
-# 9842 "parser_cocci_menhir.ml"
+# 9843 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9864,7 +9865,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_exists = 
 # 245 "parser_cocci_menhir.mly"
                    ( Ast.ReverseForall )
-# 9868 "parser_cocci_menhir.ml"
+# 9869 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9881,7 +9882,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_exists = 
 # 246 "parser_cocci_menhir.mly"
           ( Ast.Undetermined )
-# 9885 "parser_cocci_menhir.ml"
+# 9886 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9903,9 +9904,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_expr = 
-# 1202 "parser_cocci_menhir.mly"
+# 1203 "parser_cocci_menhir.mly"
                                 ( _1 )
-# 9909 "parser_cocci_menhir.ml"
+# 9910 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9927,9 +9928,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_r_ in
         let _endpos = _endpos_r_ in
         let _v : 'tv_expr_dots_TEllipsis_ = 
-# 1384 "parser_cocci_menhir.mly"
+# 1385 "parser_cocci_menhir.mly"
                                                        ( r )
-# 9933 "parser_cocci_menhir.ml"
+# 9934 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9946,7 +9947,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_extends = 
 # 216 "parser_cocci_menhir.mly"
                                                   ( () )
-# 9950 "parser_cocci_menhir.ml"
+# 9951 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -9971,14 +9972,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let parent : (
 # 47 "parser_cocci_menhir.mly"
       (string)
-# 9975 "parser_cocci_menhir.ml"
+# 9976 "parser_cocci_menhir.ml"
         ) = Obj.magic parent in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_parent_ in
         let _v : 'tv_extends = 
 # 218 "parser_cocci_menhir.mly"
     ( !Data.install_bindings (parent) )
-# 9982 "parser_cocci_menhir.ml"
+# 9983 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10004,12 +10005,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 83 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 10008 "parser_cocci_menhir.ml"
+# 10009 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 83 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 10013 "parser_cocci_menhir.ml"
+# 10014 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
@@ -10018,7 +10019,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( [Ast0.wrap
          (Ast0.FILEINFO(P.id2mcode _1,
                         P.id2mcode _2))] )
-# 10022 "parser_cocci_menhir.ml"
+# 10023 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10048,7 +10049,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_fn_ctype = 
 # 581 "parser_cocci_menhir.mly"
                                      ( P.pointerify ty m )
-# 10052 "parser_cocci_menhir.ml"
+# 10053 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10075,7 +10076,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let t : (
 # 50 "parser_cocci_menhir.mly"
       (Data.clt)
-# 10079 "parser_cocci_menhir.ml"
+# 10080 "parser_cocci_menhir.ml"
         ) = Obj.magic t in
         let _startpos = _startpos_t_ in
         let _endpos = _endpos_m_ in
@@ -10084,7 +10085,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
          ( P.pointerify
             (Ast0.wrap(Ast0.BaseType(Ast.VoidType,[P.clt2mcode "void" t])))
             m )
-# 10088 "parser_cocci_menhir.ml"
+# 10089 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10099,9 +10100,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_fninfo = 
-# 776 "parser_cocci_menhir.mly"
+# 777 "parser_cocci_menhir.mly"
                 ( [] )
-# 10105 "parser_cocci_menhir.ml"
+# 10106 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10129,13 +10130,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fninfo = 
-# 778 "parser_cocci_menhir.mly"
+# 779 "parser_cocci_menhir.mly"
       ( try
        let _ =
          List.find (function Ast0.FStorage(_) -> true | _ -> false) _2 in
        raise (Semantic_cocci.Semantic "duplicate storage")
       with Not_found -> (Ast0.FStorage(_1))::_2 )
-# 10139 "parser_cocci_menhir.ml"
+# 10140 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10163,9 +10164,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_t_ in
         let _endpos = _endpos_r_ in
         let _v : 'tv_fninfo = 
-# 783 "parser_cocci_menhir.mly"
+# 784 "parser_cocci_menhir.mly"
                            ( (Ast0.FType(t))::r )
-# 10169 "parser_cocci_menhir.ml"
+# 10170 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10192,17 +10193,17 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 53 "parser_cocci_menhir.mly"
       (Data.clt)
-# 10196 "parser_cocci_menhir.ml"
+# 10197 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fninfo = 
-# 785 "parser_cocci_menhir.mly"
+# 786 "parser_cocci_menhir.mly"
       ( try
        let _ = List.find (function Ast0.FInline(_) -> true | _ -> false) _2 in
        raise (Semantic_cocci.Semantic "duplicate inline")
       with Not_found -> (Ast0.FInline(P.clt2mcode "inline" _1))::_2 )
-# 10206 "parser_cocci_menhir.ml"
+# 10207 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10229,17 +10230,17 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 55 "parser_cocci_menhir.mly"
       (string * Data.clt)
-# 10233 "parser_cocci_menhir.ml"
+# 10234 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fninfo = 
-# 790 "parser_cocci_menhir.mly"
+# 791 "parser_cocci_menhir.mly"
       ( try
        let _ = List.find (function Ast0.FAttr(_) -> true | _ -> false) _2 in
        raise (Semantic_cocci.Semantic "multiple attributes")
       with Not_found -> (Ast0.FAttr(P.id2mcode _1))::_2 )
-# 10243 "parser_cocci_menhir.ml"
+# 10244 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10254,9 +10255,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_fninfo_nt = 
-# 796 "parser_cocci_menhir.mly"
+# 797 "parser_cocci_menhir.mly"
                 ( [] )
-# 10260 "parser_cocci_menhir.ml"
+# 10261 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10284,13 +10285,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fninfo_nt = 
-# 798 "parser_cocci_menhir.mly"
+# 799 "parser_cocci_menhir.mly"
       ( try
        let _ =
          List.find (function Ast0.FStorage(_) -> true | _ -> false) _2 in
        raise (Semantic_cocci.Semantic "duplicate storage")
       with Not_found -> (Ast0.FStorage(_1))::_2 )
-# 10294 "parser_cocci_menhir.ml"
+# 10295 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10317,17 +10318,17 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 53 "parser_cocci_menhir.mly"
       (Data.clt)
-# 10321 "parser_cocci_menhir.ml"
+# 10322 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fninfo_nt = 
-# 804 "parser_cocci_menhir.mly"
+# 805 "parser_cocci_menhir.mly"
       ( try
        let _ = List.find (function Ast0.FInline(_) -> true | _ -> false) _2 in
        raise (Semantic_cocci.Semantic "duplicate inline")
       with Not_found -> (Ast0.FInline(P.clt2mcode "inline" _1))::_2 )
-# 10331 "parser_cocci_menhir.ml"
+# 10332 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10354,17 +10355,17 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 55 "parser_cocci_menhir.mly"
       (string * Data.clt)
-# 10358 "parser_cocci_menhir.ml"
+# 10359 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fninfo_nt = 
-# 809 "parser_cocci_menhir.mly"
+# 810 "parser_cocci_menhir.mly"
       ( try
        let _ = List.find (function Ast0.FAttr(_) -> true | _ -> false) _2 in
        raise (Semantic_cocci.Semantic "duplicate init")
       with Not_found -> (Ast0.FAttr(P.id2mcode _1))::_2 )
-# 10368 "parser_cocci_menhir.ml"
+# 10369 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10379,9 +10380,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_fun_after_dots = 
-# 1700 "parser_cocci_menhir.mly"
+# 1701 "parser_cocci_menhir.mly"
                                ([])
-# 10385 "parser_cocci_menhir.ml"
+# 10386 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10407,9 +10408,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fun_after_dots = 
-# 1701 "parser_cocci_menhir.mly"
+# 1702 "parser_cocci_menhir.mly"
                                (_2)
-# 10413 "parser_cocci_menhir.ml"
+# 10414 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10437,9 +10438,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fun_after_dots = 
-# 1702 "parser_cocci_menhir.mly"
+# 1703 "parser_cocci_menhir.mly"
                                (Ast0.wrap(Ast0.Exp(_1))::_2)
-# 10443 "parser_cocci_menhir.ml"
+# 10444 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10467,9 +10468,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fun_after_dots = 
-# 1703 "parser_cocci_menhir.mly"
+# 1704 "parser_cocci_menhir.mly"
                                     (_1@_2)
-# 10473 "parser_cocci_menhir.ml"
+# 10474 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10484,9 +10485,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_fun_after_dots_or = 
-# 1710 "parser_cocci_menhir.mly"
+# 1711 "parser_cocci_menhir.mly"
                                ([])
-# 10490 "parser_cocci_menhir.ml"
+# 10491 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10512,9 +10513,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fun_after_dots_or = 
-# 1711 "parser_cocci_menhir.mly"
+# 1712 "parser_cocci_menhir.mly"
                                (_2)
-# 10518 "parser_cocci_menhir.ml"
+# 10519 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10542,9 +10543,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fun_after_dots_or = 
-# 1712 "parser_cocci_menhir.mly"
+# 1713 "parser_cocci_menhir.mly"
                                (Ast0.wrap(Ast0.Exp(_1))::_2)
-# 10548 "parser_cocci_menhir.ml"
+# 10549 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10572,9 +10573,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fun_after_dots_or = 
-# 1713 "parser_cocci_menhir.mly"
+# 1714 "parser_cocci_menhir.mly"
                                     (_1@_2)
-# 10578 "parser_cocci_menhir.ml"
+# 10579 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10602,9 +10603,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fun_after_exp = 
-# 1706 "parser_cocci_menhir.mly"
+# 1707 "parser_cocci_menhir.mly"
                                (_1::_2)
-# 10608 "parser_cocci_menhir.ml"
+# 10609 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10619,9 +10620,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_fun_after_exp_or = 
-# 1716 "parser_cocci_menhir.mly"
+# 1717 "parser_cocci_menhir.mly"
                                ([])
-# 10625 "parser_cocci_menhir.ml"
+# 10626 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10649,9 +10650,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fun_after_exp_or = 
-# 1717 "parser_cocci_menhir.mly"
+# 1718 "parser_cocci_menhir.mly"
                                (_1::_2)
-# 10655 "parser_cocci_menhir.ml"
+# 10656 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10666,9 +10667,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_fun_after_stm = 
-# 1695 "parser_cocci_menhir.mly"
+# 1696 "parser_cocci_menhir.mly"
                                ([])
-# 10672 "parser_cocci_menhir.ml"
+# 10673 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10696,9 +10697,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fun_after_stm = 
-# 1696 "parser_cocci_menhir.mly"
+# 1697 "parser_cocci_menhir.mly"
                                (_1::_2)
-# 10702 "parser_cocci_menhir.ml"
+# 10703 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10726,9 +10727,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_fun_after_stm = 
-# 1697 "parser_cocci_menhir.mly"
+# 1698 "parser_cocci_menhir.mly"
                                (_1@_2)
-# 10732 "parser_cocci_menhir.ml"
+# 10733 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10750,9 +10751,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_fun_start = 
-# 1692 "parser_cocci_menhir.mly"
+# 1693 "parser_cocci_menhir.mly"
                  ( Ast0.wrap(Ast0.DOTS(_1)) )
-# 10756 "parser_cocci_menhir.ml"
+# 10757 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10774,9 +10775,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_func_ident = 
-# 1496 "parser_cocci_menhir.mly"
+# 1497 "parser_cocci_menhir.mly"
          ( Ast0.wrap(Ast0.Id(P.id2mcode _1)) )
-# 10780 "parser_cocci_menhir.ml"
+# 10781 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10797,15 +10798,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 61 "parser_cocci_menhir.mly"
        (Parse_aux.idinfo)
-# 10801 "parser_cocci_menhir.ml"
+# 10802 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_func_ident = 
-# 1498 "parser_cocci_menhir.mly"
+# 1499 "parser_cocci_menhir.mly"
          ( let (nm,constraints,pure,clt) = _1 in
         Ast0.wrap(Ast0.MetaId(P.clt2mcode nm clt,constraints,pure)) )
-# 10809 "parser_cocci_menhir.ml"
+# 10810 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10826,15 +10827,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 61 "parser_cocci_menhir.mly"
        (Parse_aux.idinfo)
-# 10830 "parser_cocci_menhir.ml"
+# 10831 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_func_ident = 
-# 1501 "parser_cocci_menhir.mly"
+# 1502 "parser_cocci_menhir.mly"
          ( let (nm,constraints,pure,clt) = _1 in
         Ast0.wrap(Ast0.MetaFunc(P.clt2mcode nm clt,constraints,pure)) )
-# 10838 "parser_cocci_menhir.ml"
+# 10839 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10855,16 +10856,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 61 "parser_cocci_menhir.mly"
        (Parse_aux.idinfo)
-# 10859 "parser_cocci_menhir.ml"
+# 10860 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_func_ident = 
-# 1504 "parser_cocci_menhir.mly"
+# 1505 "parser_cocci_menhir.mly"
   ( let (nm,constraints,pure,clt) = _1 in
         Ast0.wrap
           (Ast0.MetaLocalFunc(P.clt2mcode nm clt,constraints,pure)) )
-# 10868 "parser_cocci_menhir.ml"
+# 10869 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -10924,38 +10925,38 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let rb : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 10928 "parser_cocci_menhir.ml"
+# 10929 "parser_cocci_menhir.ml"
         ) = Obj.magic rb in
         let b : 'tv_fun_start = Obj.magic b in
         let lb : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 10934 "parser_cocci_menhir.ml"
+# 10935 "parser_cocci_menhir.ml"
         ) = Obj.magic lb in
         let rp : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 10939 "parser_cocci_menhir.ml"
+# 10940 "parser_cocci_menhir.ml"
         ) = Obj.magic rp in
         let d : 'tv_decl_list_decl_ = Obj.magic d in
         let lp : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 10945 "parser_cocci_menhir.ml"
+# 10946 "parser_cocci_menhir.ml"
         ) = Obj.magic lp in
         let i : 'tv_func_ident = Obj.magic i in
         let f : 'tv_fninfo = Obj.magic f in
         let _startpos = _startpos_f_ in
         let _endpos = _endpos_rb_ in
         let _v : 'tv_fundecl = 
-# 768 "parser_cocci_menhir.mly"
+# 769 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.FunDecl((Ast0.default_info(),Ast0.context_befaft()),
                               f, i,
                               P.clt2mcode "(" lp, d,
                               P.clt2mcode ")" rp,
                               P.clt2mcode "{" lb, b,
                               P.clt2mcode "}" rb)) )
-# 10959 "parser_cocci_menhir.ml"
+# 10960 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11001,18 +11002,18 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pt : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 11005 "parser_cocci_menhir.ml"
+# 11006 "parser_cocci_menhir.ml"
         ) = Obj.magic pt in
         let rp : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 11010 "parser_cocci_menhir.ml"
+# 11011 "parser_cocci_menhir.ml"
         ) = Obj.magic rp in
         let d : 'tv_decl_list_name_opt_decl_ = Obj.magic d in
         let lp : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 11016 "parser_cocci_menhir.ml"
+# 11017 "parser_cocci_menhir.ml"
         ) = Obj.magic lp in
         let id : 'tv_func_ident = Obj.magic id in
         let t : 'tv_ctype = Obj.magic t in
@@ -11022,11 +11023,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 39 "standard.mly"
     ( None )
-# 11026 "parser_cocci_menhir.ml"
+# 11027 "parser_cocci_menhir.ml"
           
         in
         
-# 745 "parser_cocci_menhir.mly"
+# 746 "parser_cocci_menhir.mly"
       ( Ast0.wrap
          (Ast0.UnInit
             (s,
@@ -11034,7 +11035,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
                (Ast0.FunctionType(Some t,
                                   P.clt2mcode "(" lp, d, P.clt2mcode ")" rp)),
              id, P.clt2mcode ";" pt)) )
-# 11038 "parser_cocci_menhir.ml"
+# 11039 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11085,18 +11086,18 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pt : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 11089 "parser_cocci_menhir.ml"
+# 11090 "parser_cocci_menhir.ml"
         ) = Obj.magic pt in
         let rp : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 11094 "parser_cocci_menhir.ml"
+# 11095 "parser_cocci_menhir.ml"
         ) = Obj.magic rp in
         let d : 'tv_decl_list_name_opt_decl_ = Obj.magic d in
         let lp : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 11100 "parser_cocci_menhir.ml"
+# 11101 "parser_cocci_menhir.ml"
         ) = Obj.magic lp in
         let id : 'tv_func_ident = Obj.magic id in
         let t : 'tv_ctype = Obj.magic t in
@@ -11108,11 +11109,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 11112 "parser_cocci_menhir.ml"
+# 11113 "parser_cocci_menhir.ml"
           
         in
         
-# 745 "parser_cocci_menhir.mly"
+# 746 "parser_cocci_menhir.mly"
       ( Ast0.wrap
          (Ast0.UnInit
             (s,
@@ -11120,7 +11121,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
                (Ast0.FunctionType(Some t,
                                   P.clt2mcode "(" lp, d, P.clt2mcode ")" rp)),
              id, P.clt2mcode ";" pt)) )
-# 11124 "parser_cocci_menhir.ml"
+# 11125 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11166,24 +11167,24 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pt : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 11170 "parser_cocci_menhir.ml"
+# 11171 "parser_cocci_menhir.ml"
         ) = Obj.magic pt in
         let rp : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 11175 "parser_cocci_menhir.ml"
+# 11176 "parser_cocci_menhir.ml"
         ) = Obj.magic rp in
         let d : 'tv_decl_list_name_opt_decl_ = Obj.magic d in
         let lp : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 11181 "parser_cocci_menhir.ml"
+# 11182 "parser_cocci_menhir.ml"
         ) = Obj.magic lp in
         let id : 'tv_func_ident = Obj.magic id in
         let t : (
 # 50 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11187 "parser_cocci_menhir.ml"
+# 11188 "parser_cocci_menhir.ml"
         ) = Obj.magic t in
         let _startpos = _startpos_t_ in
         let _endpos = _endpos_pt_ in
@@ -11191,11 +11192,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 39 "standard.mly"
     ( None )
-# 11195 "parser_cocci_menhir.ml"
+# 11196 "parser_cocci_menhir.ml"
           
         in
         
-# 754 "parser_cocci_menhir.mly"
+# 755 "parser_cocci_menhir.mly"
     ( let t = Ast0.wrap(Ast0.BaseType(Ast.VoidType,[P.clt2mcode "void" t])) in
       Ast0.wrap
         (Ast0.UnInit
@@ -11204,7 +11205,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
              (Ast0.FunctionType(Some t,
                                 P.clt2mcode "(" lp, d, P.clt2mcode ")" rp)),
            id, P.clt2mcode ";" pt)) )
-# 11208 "parser_cocci_menhir.ml"
+# 11209 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11255,24 +11256,24 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pt : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 11259 "parser_cocci_menhir.ml"
+# 11260 "parser_cocci_menhir.ml"
         ) = Obj.magic pt in
         let rp : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 11264 "parser_cocci_menhir.ml"
+# 11265 "parser_cocci_menhir.ml"
         ) = Obj.magic rp in
         let d : 'tv_decl_list_name_opt_decl_ = Obj.magic d in
         let lp : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 11270 "parser_cocci_menhir.ml"
+# 11271 "parser_cocci_menhir.ml"
         ) = Obj.magic lp in
         let id : 'tv_func_ident = Obj.magic id in
         let t : (
 # 50 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11276 "parser_cocci_menhir.ml"
+# 11277 "parser_cocci_menhir.ml"
         ) = Obj.magic t in
         let x0 : 'tv_storage = Obj.magic x0 in
         let _startpos = _startpos_x0_ in
@@ -11282,11 +11283,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 11286 "parser_cocci_menhir.ml"
+# 11287 "parser_cocci_menhir.ml"
           
         in
         
-# 754 "parser_cocci_menhir.mly"
+# 755 "parser_cocci_menhir.mly"
     ( let t = Ast0.wrap(Ast0.BaseType(Ast.VoidType,[P.clt2mcode "void" t])) in
       Ast0.wrap
         (Ast0.UnInit
@@ -11295,7 +11296,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
              (Ast0.FunctionType(Some t,
                                 P.clt2mcode "(" lp, d, P.clt2mcode ")" rp)),
            id, P.clt2mcode ";" pt)) )
-# 11299 "parser_cocci_menhir.ml"
+# 11300 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11316,7 +11317,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let r0 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11320 "parser_cocci_menhir.ml"
+# 11321 "parser_cocci_menhir.ml"
         ) = Obj.magic r0 in
         let _startpos = _startpos_r0_ in
         let _endpos = _endpos_r0_ in
@@ -11325,13 +11326,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 589 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Unsigned r,x)) )
-# 11329 "parser_cocci_menhir.ml"
+# 11330 "parser_cocci_menhir.ml"
           
         in
         
 # 513 "parser_cocci_menhir.mly"
                           ( q None )
-# 11335 "parser_cocci_menhir.ml"
+# 11336 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11352,7 +11353,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let r0 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11356 "parser_cocci_menhir.ml"
+# 11357 "parser_cocci_menhir.ml"
         ) = Obj.magic r0 in
         let _startpos = _startpos_r0_ in
         let _endpos = _endpos_r0_ in
@@ -11361,13 +11362,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 591 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Signed r,x)) )
-# 11365 "parser_cocci_menhir.ml"
+# 11366 "parser_cocci_menhir.ml"
           
         in
         
 # 513 "parser_cocci_menhir.mly"
                           ( q None )
-# 11371 "parser_cocci_menhir.ml"
+# 11372 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11391,7 +11392,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_generic_ctype = 
 # 514 "parser_cocci_menhir.mly"
                           ( _1 )
-# 11395 "parser_cocci_menhir.ml"
+# 11396 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11417,12 +11418,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11421 "parser_cocci_menhir.ml"
+# 11422 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let r00 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11426 "parser_cocci_menhir.ml"
+# 11427 "parser_cocci_menhir.ml"
         ) = Obj.magic r00 in
         let _startpos = _startpos_r00_ in
         let _endpos = _endpos_ty_ in
@@ -11433,19 +11434,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 589 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Unsigned r,x)) )
-# 11437 "parser_cocci_menhir.ml"
+# 11438 "parser_cocci_menhir.ml"
             
           in
           
 # 594 "parser_cocci_menhir.mly"
                   ( function x -> s (Some x) )
-# 11443 "parser_cocci_menhir.ml"
+# 11444 "parser_cocci_menhir.ml"
           
         in
         
 # 466 "parser_cocci_menhir.mly"
         ( q (Ast0.wrap(Ast0.BaseType(Ast.CharType,[P.clt2mcode "char" ty]))) )
-# 11449 "parser_cocci_menhir.ml"
+# 11450 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11471,12 +11472,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11475 "parser_cocci_menhir.ml"
+# 11476 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let r00 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11480 "parser_cocci_menhir.ml"
+# 11481 "parser_cocci_menhir.ml"
         ) = Obj.magic r00 in
         let _startpos = _startpos_r00_ in
         let _endpos = _endpos_ty_ in
@@ -11487,19 +11488,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 591 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Signed r,x)) )
-# 11491 "parser_cocci_menhir.ml"
+# 11492 "parser_cocci_menhir.ml"
             
           in
           
 # 594 "parser_cocci_menhir.mly"
                   ( function x -> s (Some x) )
-# 11497 "parser_cocci_menhir.ml"
+# 11498 "parser_cocci_menhir.ml"
           
         in
         
 # 466 "parser_cocci_menhir.mly"
         ( q (Ast0.wrap(Ast0.BaseType(Ast.CharType,[P.clt2mcode "char" ty]))) )
-# 11503 "parser_cocci_menhir.ml"
+# 11504 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11520,7 +11521,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11524 "parser_cocci_menhir.ml"
+# 11525 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let _startpos = _startpos_ty_ in
         let _endpos = _endpos_ty_ in
@@ -11528,13 +11529,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 595 "parser_cocci_menhir.mly"
                 ( function x -> x )
-# 11532 "parser_cocci_menhir.ml"
+# 11533 "parser_cocci_menhir.ml"
           
         in
         
 # 466 "parser_cocci_menhir.mly"
         ( q (Ast0.wrap(Ast0.BaseType(Ast.CharType,[P.clt2mcode "char" ty]))) )
-# 11538 "parser_cocci_menhir.ml"
+# 11539 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11560,12 +11561,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11564 "parser_cocci_menhir.ml"
+# 11565 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let r00 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11569 "parser_cocci_menhir.ml"
+# 11570 "parser_cocci_menhir.ml"
         ) = Obj.magic r00 in
         let _startpos = _startpos_r00_ in
         let _endpos = _endpos_ty_ in
@@ -11576,19 +11577,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 589 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Unsigned r,x)) )
-# 11580 "parser_cocci_menhir.ml"
+# 11581 "parser_cocci_menhir.ml"
             
           in
           
 # 594 "parser_cocci_menhir.mly"
                   ( function x -> s (Some x) )
-# 11586 "parser_cocci_menhir.ml"
+# 11587 "parser_cocci_menhir.ml"
           
         in
         
 # 468 "parser_cocci_menhir.mly"
         ( q (Ast0.wrap(Ast0.BaseType(Ast.ShortType,[P.clt2mcode "short" ty]))))
-# 11592 "parser_cocci_menhir.ml"
+# 11593 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11614,12 +11615,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11618 "parser_cocci_menhir.ml"
+# 11619 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let r00 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11623 "parser_cocci_menhir.ml"
+# 11624 "parser_cocci_menhir.ml"
         ) = Obj.magic r00 in
         let _startpos = _startpos_r00_ in
         let _endpos = _endpos_ty_ in
@@ -11630,19 +11631,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 591 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Signed r,x)) )
-# 11634 "parser_cocci_menhir.ml"
+# 11635 "parser_cocci_menhir.ml"
             
           in
           
 # 594 "parser_cocci_menhir.mly"
                   ( function x -> s (Some x) )
-# 11640 "parser_cocci_menhir.ml"
+# 11641 "parser_cocci_menhir.ml"
           
         in
         
 # 468 "parser_cocci_menhir.mly"
         ( q (Ast0.wrap(Ast0.BaseType(Ast.ShortType,[P.clt2mcode "short" ty]))))
-# 11646 "parser_cocci_menhir.ml"
+# 11647 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11663,7 +11664,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11667 "parser_cocci_menhir.ml"
+# 11668 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let _startpos = _startpos_ty_ in
         let _endpos = _endpos_ty_ in
@@ -11671,13 +11672,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 595 "parser_cocci_menhir.mly"
                 ( function x -> x )
-# 11675 "parser_cocci_menhir.ml"
+# 11676 "parser_cocci_menhir.ml"
           
         in
         
 # 468 "parser_cocci_menhir.mly"
         ( q (Ast0.wrap(Ast0.BaseType(Ast.ShortType,[P.clt2mcode "short" ty]))))
-# 11681 "parser_cocci_menhir.ml"
+# 11682 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11703,12 +11704,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11707 "parser_cocci_menhir.ml"
+# 11708 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let r00 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11712 "parser_cocci_menhir.ml"
+# 11713 "parser_cocci_menhir.ml"
         ) = Obj.magic r00 in
         let _startpos = _startpos_r00_ in
         let _endpos = _endpos_ty_ in
@@ -11719,19 +11720,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 589 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Unsigned r,x)) )
-# 11723 "parser_cocci_menhir.ml"
+# 11724 "parser_cocci_menhir.ml"
             
           in
           
 # 594 "parser_cocci_menhir.mly"
                   ( function x -> s (Some x) )
-# 11729 "parser_cocci_menhir.ml"
+# 11730 "parser_cocci_menhir.ml"
           
         in
         
 # 470 "parser_cocci_menhir.mly"
          ( q (Ast0.wrap(Ast0.BaseType(Ast.IntType,[P.clt2mcode "int" ty]))) )
-# 11735 "parser_cocci_menhir.ml"
+# 11736 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11757,12 +11758,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11761 "parser_cocci_menhir.ml"
+# 11762 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let r00 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11766 "parser_cocci_menhir.ml"
+# 11767 "parser_cocci_menhir.ml"
         ) = Obj.magic r00 in
         let _startpos = _startpos_r00_ in
         let _endpos = _endpos_ty_ in
@@ -11773,19 +11774,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 591 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Signed r,x)) )
-# 11777 "parser_cocci_menhir.ml"
+# 11778 "parser_cocci_menhir.ml"
             
           in
           
 # 594 "parser_cocci_menhir.mly"
                   ( function x -> s (Some x) )
-# 11783 "parser_cocci_menhir.ml"
+# 11784 "parser_cocci_menhir.ml"
           
         in
         
 # 470 "parser_cocci_menhir.mly"
          ( q (Ast0.wrap(Ast0.BaseType(Ast.IntType,[P.clt2mcode "int" ty]))) )
-# 11789 "parser_cocci_menhir.ml"
+# 11790 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11806,7 +11807,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11810 "parser_cocci_menhir.ml"
+# 11811 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let _startpos = _startpos_ty_ in
         let _endpos = _endpos_ty_ in
@@ -11814,13 +11815,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 595 "parser_cocci_menhir.mly"
                 ( function x -> x )
-# 11818 "parser_cocci_menhir.ml"
+# 11819 "parser_cocci_menhir.ml"
           
         in
         
 # 470 "parser_cocci_menhir.mly"
          ( q (Ast0.wrap(Ast0.BaseType(Ast.IntType,[P.clt2mcode "int" ty]))) )
-# 11824 "parser_cocci_menhir.ml"
+# 11825 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11841,14 +11842,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let t : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11845 "parser_cocci_menhir.ml"
+# 11846 "parser_cocci_menhir.ml"
         ) = Obj.magic t in
         let _startpos = _startpos_t_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_generic_ctype_full = 
 # 472 "parser_cocci_menhir.mly"
          ( Ast0.wrap(Ast0.BaseType(Ast.DoubleType,[P.clt2mcode "double" t])) )
-# 11852 "parser_cocci_menhir.ml"
+# 11853 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11869,14 +11870,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let t : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11873 "parser_cocci_menhir.ml"
+# 11874 "parser_cocci_menhir.ml"
         ) = Obj.magic t in
         let _startpos = _startpos_t_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_generic_ctype_full = 
 # 474 "parser_cocci_menhir.mly"
          ( Ast0.wrap(Ast0.BaseType(Ast.FloatType,[P.clt2mcode "float" t])) )
-# 11880 "parser_cocci_menhir.ml"
+# 11881 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11902,12 +11903,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11906 "parser_cocci_menhir.ml"
+# 11907 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let r00 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11911 "parser_cocci_menhir.ml"
+# 11912 "parser_cocci_menhir.ml"
         ) = Obj.magic r00 in
         let _startpos = _startpos_r00_ in
         let _endpos = _endpos_ty_ in
@@ -11918,19 +11919,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 589 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Unsigned r,x)) )
-# 11922 "parser_cocci_menhir.ml"
+# 11923 "parser_cocci_menhir.ml"
             
           in
           
 # 594 "parser_cocci_menhir.mly"
                   ( function x -> s (Some x) )
-# 11928 "parser_cocci_menhir.ml"
+# 11929 "parser_cocci_menhir.ml"
           
         in
         
 # 476 "parser_cocci_menhir.mly"
          ( q (Ast0.wrap(Ast0.BaseType(Ast.LongType,[P.clt2mcode "long" ty]))) )
-# 11934 "parser_cocci_menhir.ml"
+# 11935 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -11956,12 +11957,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11960 "parser_cocci_menhir.ml"
+# 11961 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let r00 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 11965 "parser_cocci_menhir.ml"
+# 11966 "parser_cocci_menhir.ml"
         ) = Obj.magic r00 in
         let _startpos = _startpos_r00_ in
         let _endpos = _endpos_ty_ in
@@ -11972,19 +11973,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 591 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Signed r,x)) )
-# 11976 "parser_cocci_menhir.ml"
+# 11977 "parser_cocci_menhir.ml"
             
           in
           
 # 594 "parser_cocci_menhir.mly"
                   ( function x -> s (Some x) )
-# 11982 "parser_cocci_menhir.ml"
+# 11983 "parser_cocci_menhir.ml"
           
         in
         
 # 476 "parser_cocci_menhir.mly"
          ( q (Ast0.wrap(Ast0.BaseType(Ast.LongType,[P.clt2mcode "long" ty]))) )
-# 11988 "parser_cocci_menhir.ml"
+# 11989 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12005,7 +12006,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 12009 "parser_cocci_menhir.ml"
+# 12010 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let _startpos = _startpos_ty_ in
         let _endpos = _endpos_ty_ in
@@ -12013,13 +12014,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 595 "parser_cocci_menhir.mly"
                 ( function x -> x )
-# 12017 "parser_cocci_menhir.ml"
+# 12018 "parser_cocci_menhir.ml"
           
         in
         
 # 476 "parser_cocci_menhir.mly"
          ( q (Ast0.wrap(Ast0.BaseType(Ast.LongType,[P.clt2mcode "long" ty]))) )
-# 12023 "parser_cocci_menhir.ml"
+# 12024 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12050,17 +12051,17 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty1 : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 12054 "parser_cocci_menhir.ml"
+# 12055 "parser_cocci_menhir.ml"
         ) = Obj.magic ty1 in
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 12059 "parser_cocci_menhir.ml"
+# 12060 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let r00 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 12064 "parser_cocci_menhir.ml"
+# 12065 "parser_cocci_menhir.ml"
         ) = Obj.magic r00 in
         let _startpos = _startpos_r00_ in
         let _endpos = _endpos_ty1_ in
@@ -12071,13 +12072,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 589 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Unsigned r,x)) )
-# 12075 "parser_cocci_menhir.ml"
+# 12076 "parser_cocci_menhir.ml"
             
           in
           
 # 594 "parser_cocci_menhir.mly"
                   ( function x -> s (Some x) )
-# 12081 "parser_cocci_menhir.ml"
+# 12082 "parser_cocci_menhir.ml"
           
         in
         
@@ -12086,7 +12087,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
                (Ast0.BaseType
                   (Ast.LongLongType,
                      [P.clt2mcode "long" ty;P.clt2mcode "long" ty1]))) )
-# 12090 "parser_cocci_menhir.ml"
+# 12091 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12117,17 +12118,17 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty1 : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 12121 "parser_cocci_menhir.ml"
+# 12122 "parser_cocci_menhir.ml"
         ) = Obj.magic ty1 in
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 12126 "parser_cocci_menhir.ml"
+# 12127 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let r00 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 12131 "parser_cocci_menhir.ml"
+# 12132 "parser_cocci_menhir.ml"
         ) = Obj.magic r00 in
         let _startpos = _startpos_r00_ in
         let _endpos = _endpos_ty1_ in
@@ -12138,13 +12139,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 591 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Signed r,x)) )
-# 12142 "parser_cocci_menhir.ml"
+# 12143 "parser_cocci_menhir.ml"
             
           in
           
 # 594 "parser_cocci_menhir.mly"
                   ( function x -> s (Some x) )
-# 12148 "parser_cocci_menhir.ml"
+# 12149 "parser_cocci_menhir.ml"
           
         in
         
@@ -12153,7 +12154,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
                (Ast0.BaseType
                   (Ast.LongLongType,
                      [P.clt2mcode "long" ty;P.clt2mcode "long" ty1]))) )
-# 12157 "parser_cocci_menhir.ml"
+# 12158 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12179,12 +12180,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let ty1 : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 12183 "parser_cocci_menhir.ml"
+# 12184 "parser_cocci_menhir.ml"
         ) = Obj.magic ty1 in
         let ty : (
 # 49 "parser_cocci_menhir.mly"
       (Data.clt)
-# 12188 "parser_cocci_menhir.ml"
+# 12189 "parser_cocci_menhir.ml"
         ) = Obj.magic ty in
         let _startpos = _startpos_ty_ in
         let _endpos = _endpos_ty1_ in
@@ -12192,7 +12193,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 595 "parser_cocci_menhir.mly"
                 ( function x -> x )
-# 12196 "parser_cocci_menhir.ml"
+# 12197 "parser_cocci_menhir.ml"
           
         in
         
@@ -12201,7 +12202,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
                (Ast0.BaseType
                   (Ast.LongLongType,
                      [P.clt2mcode "long" ty;P.clt2mcode "long" ty1]))) )
-# 12205 "parser_cocci_menhir.ml"
+# 12206 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12228,14 +12229,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let s : (
 # 50 "parser_cocci_menhir.mly"
       (Data.clt)
-# 12232 "parser_cocci_menhir.ml"
+# 12233 "parser_cocci_menhir.ml"
         ) = Obj.magic s in
         let _startpos = _startpos_s_ in
         let _endpos = _endpos_i_ in
         let _v : 'tv_generic_ctype_full = 
 # 483 "parser_cocci_menhir.mly"
   ( Ast0.wrap(Ast0.EnumName(P.clt2mcode "enum" s, i)) )
-# 12239 "parser_cocci_menhir.ml"
+# 12240 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12265,7 +12266,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_generic_ctype_full = 
 # 485 "parser_cocci_menhir.mly"
   ( Ast0.wrap(Ast0.StructUnionName(s, Some i)) )
-# 12269 "parser_cocci_menhir.ml"
+# 12270 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12301,13 +12302,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let r : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 12305 "parser_cocci_menhir.ml"
+# 12306 "parser_cocci_menhir.ml"
         ) = Obj.magic r in
         let d : 'tv_struct_decl_list = Obj.magic d in
         let l : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 12311 "parser_cocci_menhir.ml"
+# 12312 "parser_cocci_menhir.ml"
         ) = Obj.magic l in
         let s : 'tv_struct_or_union = Obj.magic s in
         let _startpos = _startpos_s_ in
@@ -12316,7 +12317,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 39 "standard.mly"
     ( None )
-# 12320 "parser_cocci_menhir.ml"
+# 12321 "parser_cocci_menhir.ml"
           
         in
         
@@ -12326,7 +12327,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
            Ast0.wrap(Ast0.StructUnionDef(Ast0.wrap(Ast0.StructUnionName(s, i)),
                                         P.clt2mcode "{" l,
                                         d, P.clt2mcode "}" r)) )
-# 12330 "parser_cocci_menhir.ml"
+# 12331 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12367,13 +12368,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let r : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 12371 "parser_cocci_menhir.ml"
+# 12372 "parser_cocci_menhir.ml"
         ) = Obj.magic r in
         let d : 'tv_struct_decl_list = Obj.magic d in
         let l : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 12377 "parser_cocci_menhir.ml"
+# 12378 "parser_cocci_menhir.ml"
         ) = Obj.magic l in
         let x0 : 'tv_ident = Obj.magic x0 in
         let s : 'tv_struct_or_union = Obj.magic s in
@@ -12384,7 +12385,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 12388 "parser_cocci_menhir.ml"
+# 12389 "parser_cocci_menhir.ml"
           
         in
         
@@ -12394,7 +12395,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
            Ast0.wrap(Ast0.StructUnionDef(Ast0.wrap(Ast0.StructUnionName(s, i)),
                                         P.clt2mcode "{" l,
                                         d, P.clt2mcode "}" r)) )
-# 12398 "parser_cocci_menhir.ml"
+# 12399 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12430,18 +12431,18 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let r : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 12434 "parser_cocci_menhir.ml"
+# 12435 "parser_cocci_menhir.ml"
         ) = Obj.magic r in
         let d : 'tv_struct_decl_list = Obj.magic d in
         let l : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 12440 "parser_cocci_menhir.ml"
+# 12441 "parser_cocci_menhir.ml"
         ) = Obj.magic l in
         let s : (
 # 64 "parser_cocci_menhir.mly"
        (Parse_aux.info)
-# 12445 "parser_cocci_menhir.ml"
+# 12446 "parser_cocci_menhir.ml"
         ) = Obj.magic s in
         let _startpos = _startpos_s_ in
         let _endpos = _endpos_r_ in
@@ -12452,7 +12453,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           Ast0.wrap(Ast0.MetaType(P.clt2mcode nm clt,pure)) in
         Ast0.wrap
           (Ast0.StructUnionDef(ty,P.clt2mcode "{" l,d,P.clt2mcode "}" r)) )
-# 12456 "parser_cocci_menhir.ml"
+# 12457 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12482,12 +12483,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let p : (
 # 59 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 12486 "parser_cocci_menhir.ml"
+# 12487 "parser_cocci_menhir.ml"
         ) = Obj.magic p in
         let r : (
 # 47 "parser_cocci_menhir.mly"
       (string)
-# 12491 "parser_cocci_menhir.ml"
+# 12492 "parser_cocci_menhir.ml"
         ) = Obj.magic r in
         let _startpos = _startpos_r_ in
         let _endpos = _endpos_p_ in
@@ -12499,7 +12500,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _ = P.check_meta(Ast.MetaTypeDecl(Ast.NONE,nm)) in
         Ast0.wrap(Ast0.MetaType(P.clt2mcode nm (P.id2clt p),
                                 Ast0.Impure (*will be ignored*))) )
-# 12503 "parser_cocci_menhir.ml"
+# 12504 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12520,14 +12521,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let p : (
 # 59 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 12524 "parser_cocci_menhir.ml"
+# 12525 "parser_cocci_menhir.ml"
         ) = Obj.magic p in
         let _startpos = _startpos_p_ in
         let _endpos = _endpos_p_ in
         let _v : 'tv_generic_ctype_full = 
 # 507 "parser_cocci_menhir.mly"
   ( Ast0.wrap(Ast0.TypeName(P.id2mcode p)) )
-# 12531 "parser_cocci_menhir.ml"
+# 12532 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12553,12 +12554,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let p : (
 # 64 "parser_cocci_menhir.mly"
        (Parse_aux.info)
-# 12557 "parser_cocci_menhir.ml"
+# 12558 "parser_cocci_menhir.ml"
         ) = Obj.magic p in
         let r00 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 12562 "parser_cocci_menhir.ml"
+# 12563 "parser_cocci_menhir.ml"
         ) = Obj.magic r00 in
         let _startpos = _startpos_r00_ in
         let _endpos = _endpos_p_ in
@@ -12569,20 +12570,20 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 589 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Unsigned r,x)) )
-# 12573 "parser_cocci_menhir.ml"
+# 12574 "parser_cocci_menhir.ml"
             
           in
           
 # 594 "parser_cocci_menhir.mly"
                   ( function x -> s (Some x) )
-# 12579 "parser_cocci_menhir.ml"
+# 12580 "parser_cocci_menhir.ml"
           
         in
         
 # 509 "parser_cocci_menhir.mly"
   ( let (nm,pure,clt) = p in
         q (Ast0.wrap(Ast0.MetaType(P.clt2mcode nm clt,pure))) )
-# 12586 "parser_cocci_menhir.ml"
+# 12587 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12608,12 +12609,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let p : (
 # 64 "parser_cocci_menhir.mly"
        (Parse_aux.info)
-# 12612 "parser_cocci_menhir.ml"
+# 12613 "parser_cocci_menhir.ml"
         ) = Obj.magic p in
         let r00 : (
 # 51 "parser_cocci_menhir.mly"
       (Data.clt)
-# 12617 "parser_cocci_menhir.ml"
+# 12618 "parser_cocci_menhir.ml"
         ) = Obj.magic r00 in
         let _startpos = _startpos_r00_ in
         let _endpos = _endpos_p_ in
@@ -12624,20 +12625,20 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 591 "parser_cocci_menhir.mly"
    ( function x -> Ast0.wrap(Ast0.Signed(P.clt2mcode Ast.Signed r,x)) )
-# 12628 "parser_cocci_menhir.ml"
+# 12629 "parser_cocci_menhir.ml"
             
           in
           
 # 594 "parser_cocci_menhir.mly"
                   ( function x -> s (Some x) )
-# 12634 "parser_cocci_menhir.ml"
+# 12635 "parser_cocci_menhir.ml"
           
         in
         
 # 509 "parser_cocci_menhir.mly"
   ( let (nm,pure,clt) = p in
         q (Ast0.wrap(Ast0.MetaType(P.clt2mcode nm clt,pure))) )
-# 12641 "parser_cocci_menhir.ml"
+# 12642 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12658,7 +12659,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let p : (
 # 64 "parser_cocci_menhir.mly"
        (Parse_aux.info)
-# 12662 "parser_cocci_menhir.ml"
+# 12663 "parser_cocci_menhir.ml"
         ) = Obj.magic p in
         let _startpos = _startpos_p_ in
         let _endpos = _endpos_p_ in
@@ -12666,14 +12667,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 595 "parser_cocci_menhir.mly"
                 ( function x -> x )
-# 12670 "parser_cocci_menhir.ml"
+# 12671 "parser_cocci_menhir.ml"
           
         in
         
 # 509 "parser_cocci_menhir.mly"
   ( let (nm,pure,clt) = p in
         q (Ast0.wrap(Ast0.MetaType(P.clt2mcode nm clt,pure))) )
-# 12677 "parser_cocci_menhir.ml"
+# 12678 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12695,9 +12696,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_ident = 
-# 1509 "parser_cocci_menhir.mly"
+# 1510 "parser_cocci_menhir.mly"
          ( Ast0.wrap(Ast0.Id(P.id2mcode _1)) )
-# 12701 "parser_cocci_menhir.ml"
+# 12702 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12718,15 +12719,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 61 "parser_cocci_menhir.mly"
        (Parse_aux.idinfo)
-# 12722 "parser_cocci_menhir.ml"
+# 12723 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_ident = 
-# 1511 "parser_cocci_menhir.mly"
+# 1512 "parser_cocci_menhir.mly"
          ( let (nm,constraints,pure,clt) = _1 in
          Ast0.wrap(Ast0.MetaId(P.clt2mcode nm clt,constraints,pure)) )
-# 12730 "parser_cocci_menhir.ml"
+# 12731 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12748,9 +12749,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_i_ in
         let _endpos = _endpos_i_ in
         let _v : 'tv_ident_or_const = 
-# 1463 "parser_cocci_menhir.mly"
+# 1464 "parser_cocci_menhir.mly"
                     ( Ast0.wrap(Ast0.Ident(Ast0.wrap(Ast0.Id(P.id2mcode i)))) )
-# 12754 "parser_cocci_menhir.ml"
+# 12755 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12771,15 +12772,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 12775 "parser_cocci_menhir.ml"
+# 12776 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_ident_or_const = 
-# 1465 "parser_cocci_menhir.mly"
+# 1466 "parser_cocci_menhir.mly"
   ( let (x,clt) = _1 in
         Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.Int x) clt)) )
-# 12783 "parser_cocci_menhir.ml"
+# 12784 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12804,14 +12805,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 12808 "parser_cocci_menhir.ml"
+# 12809 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_incl = 
 # 257 "parser_cocci_menhir.mly"
                       ( Common.Left(P.id2name _2) )
-# 12815 "parser_cocci_menhir.ml"
+# 12816 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12836,14 +12837,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 79 "parser_cocci_menhir.mly"
        (string)
-# 12840 "parser_cocci_menhir.ml"
+# 12841 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_incl = 
 # 258 "parser_cocci_menhir.mly"
                       ( Common.Right _2 )
-# 12847 "parser_cocci_menhir.ml"
+# 12848 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12871,11 +12872,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 146 "parser_cocci_menhir.mly"
       ((string,string) Common.either list)
-# 12875 "parser_cocci_menhir.ml"
+# 12876 "parser_cocci_menhir.ml"
         ) = 
 # 253 "parser_cocci_menhir.mly"
                        ( _1 )
-# 12879 "parser_cocci_menhir.ml"
+# 12880 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12903,11 +12904,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 146 "parser_cocci_menhir.mly"
       ((string,string) Common.either list)
-# 12907 "parser_cocci_menhir.ml"
+# 12908 "parser_cocci_menhir.ml"
         ) = 
 # 254 "parser_cocci_menhir.mly"
                        ( _1 )
-# 12911 "parser_cocci_menhir.ml"
+# 12912 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12928,7 +12929,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 80 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 12932 "parser_cocci_menhir.ml"
+# 12933 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
@@ -12943,7 +12944,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
                            P.clt2mcode
                              (Ast.Local (Parse_aux.str2inc (P.id2name _1)))
                              (P.drop_bef clt))) )
-# 12947 "parser_cocci_menhir.ml"
+# 12948 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -12964,7 +12965,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 80 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 12968 "parser_cocci_menhir.ml"
+# 12969 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
@@ -12979,7 +12980,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
                            P.clt2mcode
                              (Ast.NonLocal (Parse_aux.str2inc (P.id2name _1)))
                              (P.drop_bef clt))) )
-# 12983 "parser_cocci_menhir.ml"
+# 12984 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13014,7 +13015,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
 # 658 "parser_cocci_menhir.mly"
     ( let ty = Ast0.wrap(Ast0.TopExp(Ast0.wrap(Ast0.TypeExp(t)))) in
       d (Ast0.wrap(Ast0.DOTS([ty]))) )
-# 13018 "parser_cocci_menhir.ml"
+# 13019 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13056,7 +13057,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
            | _ -> b)
        | _ -> b in
       _1 (Ast0.wrap(Ast0.DOTS(body))) )
-# 13060 "parser_cocci_menhir.ml"
+# 13061 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13078,9 +13079,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_initialize = 
-# 1074 "parser_cocci_menhir.mly"
+# 1075 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.InitExpr(_1)) )
-# 13084 "parser_cocci_menhir.ml"
+# 13085 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13111,20 +13112,20 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 13115 "parser_cocci_menhir.ml"
+# 13116 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_initialize_list = Obj.magic _2 in
         let _1 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 13121 "parser_cocci_menhir.ml"
+# 13122 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_initialize = 
-# 1076 "parser_cocci_menhir.mly"
+# 1077 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.InitList(P.clt2mcode "{" _1,_2,P.clt2mcode "}" _3)) )
-# 13128 "parser_cocci_menhir.ml"
+# 13129 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13150,21 +13151,21 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 13154 "parser_cocci_menhir.ml"
+# 13155 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 13159 "parser_cocci_menhir.ml"
+# 13160 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_initialize = 
-# 1078 "parser_cocci_menhir.mly"
+# 1079 "parser_cocci_menhir.mly"
       ( Ast0.wrap
          (Ast0.InitList(P.clt2mcode "{" _1,Ast0.wrap(Ast0.DOTS []),
                         P.clt2mcode "}" _2)) )
-# 13168 "parser_cocci_menhir.ml"
+# 13169 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13185,15 +13186,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 65 "parser_cocci_menhir.mly"
        (Parse_aux.info)
-# 13189 "parser_cocci_menhir.ml"
+# 13190 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_initialize = 
-# 1082 "parser_cocci_menhir.mly"
+# 1083 "parser_cocci_menhir.mly"
       (let (nm,pure,clt) = _1 in
       Ast0.wrap(Ast0.MetaInit(P.clt2mcode nm clt,pure)) )
-# 13197 "parser_cocci_menhir.ml"
+# 13198 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13215,9 +13216,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_initialize2 = 
-# 1088 "parser_cocci_menhir.mly"
+# 1089 "parser_cocci_menhir.mly"
                             ( Ast0.wrap(Ast0.InitExpr(_1)) )
-# 13221 "parser_cocci_menhir.ml"
+# 13222 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13248,20 +13249,20 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 13252 "parser_cocci_menhir.ml"
+# 13253 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_initialize_list = Obj.magic _2 in
         let _1 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 13258 "parser_cocci_menhir.ml"
+# 13259 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_initialize2 = 
-# 1090 "parser_cocci_menhir.mly"
+# 1091 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.InitList(P.clt2mcode "{" _1,_2,P.clt2mcode "}" _3)) )
-# 13265 "parser_cocci_menhir.ml"
+# 13266 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13287,21 +13288,21 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 13291 "parser_cocci_menhir.ml"
+# 13292 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 13296 "parser_cocci_menhir.ml"
+# 13297 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_initialize2 = 
-# 1092 "parser_cocci_menhir.mly"
+# 1093 "parser_cocci_menhir.mly"
     ( Ast0.wrap
        (Ast0.InitList(P.clt2mcode "{" _1,Ast0.wrap(Ast0.DOTS []),
                       P.clt2mcode "}" _2)) )
-# 13305 "parser_cocci_menhir.ml"
+# 13306 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13333,15 +13334,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 13337 "parser_cocci_menhir.ml"
+# 13338 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_list_designator_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_initialize2 = 
-# 1097 "parser_cocci_menhir.mly"
+# 1098 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.InitGccExt(_1,P.clt2mcode "=" _2,_3)) )
-# 13345 "parser_cocci_menhir.ml"
+# 13346 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13373,15 +13374,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 13377 "parser_cocci_menhir.ml"
+# 13378 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_ident = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_initialize2 = 
-# 1099 "parser_cocci_menhir.mly"
+# 1100 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.InitGccName(_1,P.clt2mcode ":" _2,_3)) )
-# 13385 "parser_cocci_menhir.ml"
+# 13386 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13403,9 +13404,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_initialize_list = 
-# 1111 "parser_cocci_menhir.mly"
+# 1112 "parser_cocci_menhir.mly"
                          ( Ast0.wrap(Ast0.DOTS(_1)) )
-# 13409 "parser_cocci_menhir.ml"
+# 13410 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13431,15 +13432,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 13435 "parser_cocci_menhir.ml"
+# 13436 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_initialize2 = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_initialize_list_start = 
-# 1114 "parser_cocci_menhir.mly"
+# 1115 "parser_cocci_menhir.mly"
                      ( [_1;Ast0.wrap(Ast0.IComma(P.clt2mcode "," _2))] )
-# 13443 "parser_cocci_menhir.ml"
+# 13444 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13471,15 +13472,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 13475 "parser_cocci_menhir.ml"
+# 13476 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_initialize2 = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_initialize_list_start = 
-# 1116 "parser_cocci_menhir.mly"
+# 1117 "parser_cocci_menhir.mly"
     ( _1::Ast0.wrap(Ast0.IComma(P.clt2mcode "," _2))::_3 )
-# 13483 "parser_cocci_menhir.ml"
+# 13484 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13507,10 +13508,10 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_d_ in
         let _endpos = _endpos_r_ in
         let _v : 'tv_initialize_list_start = 
-# 1119 "parser_cocci_menhir.mly"
+# 1120 "parser_cocci_menhir.mly"
     ( (P.mkidots "..." d)::
       (List.concat(List.map (function x -> x (P.mkidots "...")) r)) )
-# 13514 "parser_cocci_menhir.ml"
+# 13515 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13530,9 +13531,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_invalid = 
-# 1212 "parser_cocci_menhir.mly"
+# 1213 "parser_cocci_menhir.mly"
            ( raise (Semantic_cocci.Semantic "not matchable") )
-# 13536 "parser_cocci_menhir.ml"
+# 13537 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13549,7 +13550,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_is_expression = 
 # 249 "parser_cocci_menhir.mly"
               ( false )
-# 13553 "parser_cocci_menhir.ml"
+# 13554 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13571,7 +13572,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_is_expression = 
 # 250 "parser_cocci_menhir.mly"
               ( true )
-# 13575 "parser_cocci_menhir.ml"
+# 13576 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13597,9 +13598,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_iso_ctype_ = 
-# 1860 "parser_cocci_menhir.mly"
+# 1866 "parser_cocci_menhir.mly"
                 ( Common.Left t )
-# 13603 "parser_cocci_menhir.ml"
+# 13604 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13625,9 +13626,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_iso_ctype_ = 
-# 1861 "parser_cocci_menhir.mly"
+# 1867 "parser_cocci_menhir.mly"
                      ( Common.Right t )
-# 13631 "parser_cocci_menhir.ml"
+# 13632 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13653,9 +13654,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_iso_decl_var_ = 
-# 1860 "parser_cocci_menhir.mly"
+# 1866 "parser_cocci_menhir.mly"
                 ( Common.Left t )
-# 13659 "parser_cocci_menhir.ml"
+# 13660 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13681,9 +13682,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_iso_decl_var_ = 
-# 1861 "parser_cocci_menhir.mly"
+# 1867 "parser_cocci_menhir.mly"
                      ( Common.Right t )
-# 13687 "parser_cocci_menhir.ml"
+# 13688 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13709,9 +13710,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_iso_dexpr_ = 
-# 1860 "parser_cocci_menhir.mly"
+# 1866 "parser_cocci_menhir.mly"
                 ( Common.Left t )
-# 13715 "parser_cocci_menhir.ml"
+# 13716 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13737,9 +13738,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_iso_dexpr_ = 
-# 1861 "parser_cocci_menhir.mly"
+# 1867 "parser_cocci_menhir.mly"
                      ( Common.Right t )
-# 13743 "parser_cocci_menhir.ml"
+# 13744 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13765,9 +13766,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_iso_nest_start_ = 
-# 1860 "parser_cocci_menhir.mly"
+# 1866 "parser_cocci_menhir.mly"
                 ( Common.Left t )
-# 13771 "parser_cocci_menhir.ml"
+# 13772 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13793,9 +13794,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_iso_nest_start_ = 
-# 1861 "parser_cocci_menhir.mly"
+# 1867 "parser_cocci_menhir.mly"
                      ( Common.Right t )
-# 13799 "parser_cocci_menhir.ml"
+# 13800 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13821,9 +13822,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_iso_single_statement_ = 
-# 1860 "parser_cocci_menhir.mly"
+# 1866 "parser_cocci_menhir.mly"
                 ( Common.Left t )
-# 13827 "parser_cocci_menhir.ml"
+# 13828 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13849,9 +13850,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_iso_single_statement_ = 
-# 1861 "parser_cocci_menhir.mly"
+# 1867 "parser_cocci_menhir.mly"
                      ( Common.Right t )
-# 13855 "parser_cocci_menhir.ml"
+# 13856 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13889,11 +13890,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 162 "parser_cocci_menhir.mly"
       (Ast0_cocci.anything list list)
-# 13893 "parser_cocci_menhir.ml"
+# 13894 "parser_cocci_menhir.ml"
         ) = 
-# 1832 "parser_cocci_menhir.mly"
+# 1838 "parser_cocci_menhir.mly"
     ( P.iso_adjust (function x -> Ast0.ExprTag x) e1 el )
-# 13897 "parser_cocci_menhir.ml"
+# 13898 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13931,11 +13932,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 162 "parser_cocci_menhir.mly"
       (Ast0_cocci.anything list list)
-# 13935 "parser_cocci_menhir.ml"
+# 13936 "parser_cocci_menhir.ml"
         ) = 
-# 1834 "parser_cocci_menhir.mly"
+# 1840 "parser_cocci_menhir.mly"
     ( P.iso_adjust (function x -> Ast0.ArgExprTag x) e1 el )
-# 13939 "parser_cocci_menhir.ml"
+# 13940 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -13973,11 +13974,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 162 "parser_cocci_menhir.mly"
       (Ast0_cocci.anything list list)
-# 13977 "parser_cocci_menhir.ml"
+# 13978 "parser_cocci_menhir.ml"
         ) = 
-# 1836 "parser_cocci_menhir.mly"
+# 1842 "parser_cocci_menhir.mly"
     ( P.iso_adjust (function x -> Ast0.TestExprTag x) e1 el )
-# 13981 "parser_cocci_menhir.ml"
+# 13982 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14015,11 +14016,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 162 "parser_cocci_menhir.mly"
       (Ast0_cocci.anything list list)
-# 14019 "parser_cocci_menhir.ml"
+# 14020 "parser_cocci_menhir.ml"
         ) = 
-# 1838 "parser_cocci_menhir.mly"
+# 1844 "parser_cocci_menhir.mly"
     ( P.iso_adjust (function x -> Ast0.StmtTag x) s1 sl )
-# 14023 "parser_cocci_menhir.ml"
+# 14024 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14057,11 +14058,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 162 "parser_cocci_menhir.mly"
       (Ast0_cocci.anything list list)
-# 14061 "parser_cocci_menhir.ml"
+# 14062 "parser_cocci_menhir.ml"
         ) = 
-# 1840 "parser_cocci_menhir.mly"
+# 1846 "parser_cocci_menhir.mly"
     ( P.iso_adjust (function x -> Ast0.TypeCTag x) t1 tl )
-# 14065 "parser_cocci_menhir.ml"
+# 14066 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14099,11 +14100,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 162 "parser_cocci_menhir.mly"
       (Ast0_cocci.anything list list)
-# 14103 "parser_cocci_menhir.ml"
+# 14104 "parser_cocci_menhir.ml"
         ) = 
-# 1842 "parser_cocci_menhir.mly"
+# 1848 "parser_cocci_menhir.mly"
     ( P.iso_adjust (function x -> Ast0.DotsStmtTag x) e1 el )
-# 14107 "parser_cocci_menhir.ml"
+# 14108 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14141,9 +14142,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 162 "parser_cocci_menhir.mly"
       (Ast0_cocci.anything list list)
-# 14145 "parser_cocci_menhir.ml"
+# 14146 "parser_cocci_menhir.ml"
         ) = 
-# 1844 "parser_cocci_menhir.mly"
+# 1850 "parser_cocci_menhir.mly"
     ( let check_one = function
        [x] -> x
       | _ ->
@@ -14158,7 +14159,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
          | Common.Right x -> Common.Right(check_one x))
        dl in
     P.iso_adjust (function x -> Ast0.DeclTag x) d1 dl )
-# 14162 "parser_cocci_menhir.ml"
+# 14163 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14182,11 +14183,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 165 "parser_cocci_menhir.mly"
       ((Ast_cocci.metavar,Ast_cocci.metavar) Common.either list)
-# 14186 "parser_cocci_menhir.ml"
+# 14187 "parser_cocci_menhir.ml"
         ) = 
 # 182 "parser_cocci_menhir.mly"
                          ( m "" )
-# 14190 "parser_cocci_menhir.ml"
+# 14191 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14214,11 +14215,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 149 "parser_cocci_menhir.mly"
       (Ast_cocci.rulename)
-# 14218 "parser_cocci_menhir.ml"
+# 14219 "parser_cocci_menhir.ml"
         ) = 
 # 197 "parser_cocci_menhir.mly"
                       ( P.make_iso_rule_name_result (P.id2name nm) )
-# 14222 "parser_cocci_menhir.ml"
+# 14223 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14239,14 +14240,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 59 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 14243 "parser_cocci_menhir.ml"
+# 14244 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_iter_ident = 
-# 1523 "parser_cocci_menhir.mly"
+# 1524 "parser_cocci_menhir.mly"
          ( Ast0.wrap(Ast0.Id(P.id2mcode _1)) )
-# 14250 "parser_cocci_menhir.ml"
+# 14251 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14267,15 +14268,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 62 "parser_cocci_menhir.mly"
        (Parse_aux.idinfo)
-# 14271 "parser_cocci_menhir.ml"
+# 14272 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_iter_ident = 
-# 1525 "parser_cocci_menhir.mly"
+# 1526 "parser_cocci_menhir.mly"
          ( let (nm,constraints,pure,clt) = _1 in
          Ast0.wrap(Ast0.MetaId(P.clt2mcode nm clt,constraints,pure)) )
-# 14279 "parser_cocci_menhir.ml"
+# 14280 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14292,7 +14293,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_TMul_ = 
 # 114 "standard.mly"
     ( [] )
-# 14296 "parser_cocci_menhir.ml"
+# 14297 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14319,14 +14320,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let x : (
 # 99 "parser_cocci_menhir.mly"
        (Data.clt)
-# 14323 "parser_cocci_menhir.ml"
+# 14324 "parser_cocci_menhir.ml"
         ) = Obj.magic x in
         let _startpos = _startpos_x_ in
         let _endpos = _endpos_xs_ in
         let _v : 'tv_list_TMul_ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14330 "parser_cocci_menhir.ml"
+# 14331 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14343,7 +14344,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_array_dec_ = 
 # 114 "standard.mly"
     ( [] )
-# 14347 "parser_cocci_menhir.ml"
+# 14348 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14373,7 +14374,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_array_dec_ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14377 "parser_cocci_menhir.ml"
+# 14378 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14390,7 +14391,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_case_line_ = 
 # 114 "standard.mly"
     ( [] )
-# 14394 "parser_cocci_menhir.ml"
+# 14395 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14420,7 +14421,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_case_line_ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14424 "parser_cocci_menhir.ml"
+# 14425 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14437,7 +14438,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_comma_decls_TEllipsis_decl__ = 
 # 114 "standard.mly"
     ( [] )
-# 14441 "parser_cocci_menhir.ml"
+# 14442 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14467,7 +14468,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_comma_decls_TEllipsis_decl__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14471 "parser_cocci_menhir.ml"
+# 14472 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14484,7 +14485,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_comma_decls_TEllipsis_name_opt_decl__ = 
 # 114 "standard.mly"
     ( [] )
-# 14488 "parser_cocci_menhir.ml"
+# 14489 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14514,7 +14515,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_comma_decls_TEllipsis_name_opt_decl__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14518 "parser_cocci_menhir.ml"
+# 14519 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14531,7 +14532,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_designator_ = 
 # 114 "standard.mly"
     ( [] )
-# 14535 "parser_cocci_menhir.ml"
+# 14536 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14561,7 +14562,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_designator_ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14565 "parser_cocci_menhir.ml"
+# 14566 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14578,7 +14579,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_dp_comma_args_TEllipsis__ = 
 # 114 "standard.mly"
     ( [] )
-# 14582 "parser_cocci_menhir.ml"
+# 14583 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14608,7 +14609,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_dp_comma_args_TEllipsis__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14612 "parser_cocci_menhir.ml"
+# 14613 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14625,7 +14626,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_incl_ = 
 # 114 "standard.mly"
     ( [] )
-# 14629 "parser_cocci_menhir.ml"
+# 14630 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14655,7 +14656,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_incl_ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14659 "parser_cocci_menhir.ml"
+# 14660 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14672,7 +14673,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_iso_ctype__ = 
 # 114 "standard.mly"
     ( [] )
-# 14676 "parser_cocci_menhir.ml"
+# 14677 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14702,7 +14703,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_iso_ctype__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14706 "parser_cocci_menhir.ml"
+# 14707 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14719,7 +14720,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_iso_decl_var__ = 
 # 114 "standard.mly"
     ( [] )
-# 14723 "parser_cocci_menhir.ml"
+# 14724 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14749,7 +14750,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_iso_decl_var__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14753 "parser_cocci_menhir.ml"
+# 14754 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14766,7 +14767,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_iso_dexpr__ = 
 # 114 "standard.mly"
     ( [] )
-# 14770 "parser_cocci_menhir.ml"
+# 14771 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14796,7 +14797,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_iso_dexpr__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14800 "parser_cocci_menhir.ml"
+# 14801 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14813,7 +14814,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_iso_nest_start__ = 
 # 114 "standard.mly"
     ( [] )
-# 14817 "parser_cocci_menhir.ml"
+# 14818 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14843,7 +14844,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_iso_nest_start__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14847 "parser_cocci_menhir.ml"
+# 14848 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14860,7 +14861,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_iso_single_statement__ = 
 # 114 "standard.mly"
     ( [] )
-# 14864 "parser_cocci_menhir.ml"
+# 14865 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14890,7 +14891,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_iso_single_statement__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14894 "parser_cocci_menhir.ml"
+# 14895 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14907,7 +14908,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_mzl_ctype__ = 
 # 114 "standard.mly"
     ( [] )
-# 14911 "parser_cocci_menhir.ml"
+# 14912 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14937,7 +14938,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_mzl_ctype__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14941 "parser_cocci_menhir.ml"
+# 14942 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14954,7 +14955,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_mzl_eexpr__ = 
 # 114 "standard.mly"
     ( [] )
-# 14958 "parser_cocci_menhir.ml"
+# 14959 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -14984,7 +14985,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_mzl_eexpr__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 14988 "parser_cocci_menhir.ml"
+# 14989 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15001,7 +15002,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_mzl_fun_after_dots_or__ = 
 # 114 "standard.mly"
     ( [] )
-# 15005 "parser_cocci_menhir.ml"
+# 15006 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15031,7 +15032,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_mzl_fun_after_dots_or__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 15035 "parser_cocci_menhir.ml"
+# 15036 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15048,7 +15049,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_mzl_fun_start__ = 
 # 114 "standard.mly"
     ( [] )
-# 15052 "parser_cocci_menhir.ml"
+# 15053 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15078,7 +15079,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_mzl_fun_start__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 15082 "parser_cocci_menhir.ml"
+# 15083 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15095,7 +15096,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_mzl_rule_elem_statement__ = 
 # 114 "standard.mly"
     ( [] )
-# 15099 "parser_cocci_menhir.ml"
+# 15100 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15125,7 +15126,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_mzl_rule_elem_statement__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 15129 "parser_cocci_menhir.ml"
+# 15130 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15142,7 +15143,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_mzl_statement__ = 
 # 114 "standard.mly"
     ( [] )
-# 15146 "parser_cocci_menhir.ml"
+# 15147 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15172,7 +15173,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_mzl_statement__ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 15176 "parser_cocci_menhir.ml"
+# 15177 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15189,7 +15190,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_pair_edots_when_TEllipsis_eexpr__dexpr__ = 
 # 114 "standard.mly"
     ( [] )
-# 15193 "parser_cocci_menhir.ml"
+# 15194 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15228,13 +15229,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 70 "standard.mly"
     ( (x, y) )
-# 15232 "parser_cocci_menhir.ml"
+# 15233 "parser_cocci_menhir.ml"
           
         in
         
 # 116 "standard.mly"
     ( x :: xs )
-# 15238 "parser_cocci_menhir.ml"
+# 15239 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15251,7 +15252,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_whenppdecs_ = 
 # 114 "standard.mly"
     ( [] )
-# 15255 "parser_cocci_menhir.ml"
+# 15256 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15281,7 +15282,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_list_whenppdecs_ = 
 # 116 "standard.mly"
     ( x :: xs )
-# 15285 "parser_cocci_menhir.ml"
+# 15286 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15298,7 +15299,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_choose_iso_ = 
 # 57 "standard.mly"
     ( [] )
-# 15302 "parser_cocci_menhir.ml"
+# 15303 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15322,7 +15323,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_choose_iso_ = 
 # 59 "standard.mly"
     ( x )
-# 15326 "parser_cocci_menhir.ml"
+# 15327 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15339,7 +15340,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_disable_ = 
 # 57 "standard.mly"
     ( [] )
-# 15343 "parser_cocci_menhir.ml"
+# 15344 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15363,7 +15364,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_disable_ = 
 # 59 "standard.mly"
     ( x )
-# 15367 "parser_cocci_menhir.ml"
+# 15368 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15380,7 +15381,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_error_words_ = 
 # 57 "standard.mly"
     ( [] )
-# 15384 "parser_cocci_menhir.ml"
+# 15385 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15404,7 +15405,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_error_words_ = 
 # 59 "standard.mly"
     ( x )
-# 15408 "parser_cocci_menhir.ml"
+# 15409 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15421,7 +15422,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_filespec_ = 
 # 57 "standard.mly"
     ( [] )
-# 15425 "parser_cocci_menhir.ml"
+# 15426 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15445,7 +15446,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_filespec_ = 
 # 59 "standard.mly"
     ( x )
-# 15449 "parser_cocci_menhir.ml"
+# 15450 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15462,7 +15463,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_minus_start_ = 
 # 57 "standard.mly"
     ( [] )
-# 15466 "parser_cocci_menhir.ml"
+# 15467 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15486,7 +15487,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_minus_start_ = 
 # 59 "standard.mly"
     ( x )
-# 15490 "parser_cocci_menhir.ml"
+# 15491 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15503,7 +15504,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_not_ceq_ = 
 # 57 "standard.mly"
     ( [] )
-# 15507 "parser_cocci_menhir.ml"
+# 15508 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15527,7 +15528,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_not_ceq_ = 
 # 59 "standard.mly"
     ( x )
-# 15531 "parser_cocci_menhir.ml"
+# 15532 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15544,7 +15545,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_not_eq_ = 
 # 57 "standard.mly"
     ( [] )
-# 15548 "parser_cocci_menhir.ml"
+# 15549 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15568,7 +15569,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_not_eq_ = 
 # 59 "standard.mly"
     ( x )
-# 15572 "parser_cocci_menhir.ml"
+# 15573 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15585,7 +15586,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_not_eqe_ = 
 # 57 "standard.mly"
     ( [] )
-# 15589 "parser_cocci_menhir.ml"
+# 15590 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15609,7 +15610,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_not_eqe_ = 
 # 59 "standard.mly"
     ( x )
-# 15613 "parser_cocci_menhir.ml"
+# 15614 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15626,7 +15627,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_not_pos_ = 
 # 57 "standard.mly"
     ( [] )
-# 15630 "parser_cocci_menhir.ml"
+# 15631 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15650,7 +15651,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_not_pos_ = 
 # 59 "standard.mly"
     ( x )
-# 15654 "parser_cocci_menhir.ml"
+# 15655 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15667,7 +15668,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_plus_start_ = 
 # 57 "standard.mly"
     ( [] )
-# 15671 "parser_cocci_menhir.ml"
+# 15672 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15691,7 +15692,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_loption_plus_start_ = 
 # 59 "standard.mly"
     ( x )
-# 15695 "parser_cocci_menhir.ml"
+# 15696 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15715,7 +15716,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_meta_exp_type = 
 # 453 "parser_cocci_menhir.mly"
     ( [Ast0_cocci.ast0_type_to_type t] )
-# 15719 "parser_cocci_menhir.ml"
+# 15720 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15755,7 +15756,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( List.map
        (function x -> P.ty_pointerify (Ast0_cocci.ast0_type_to_type x) m)
        t )
-# 15759 "parser_cocci_menhir.ml"
+# 15760 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15786,14 +15787,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 47 "parser_cocci_menhir.mly"
       (string)
-# 15790 "parser_cocci_menhir.ml"
+# 15791 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_meta_ident = 
-# 1398 "parser_cocci_menhir.mly"
+# 1399 "parser_cocci_menhir.mly"
                                  ( (Some _1,P.id2name _3) )
-# 15797 "parser_cocci_menhir.ml"
+# 15798 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15817,11 +15818,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 157 "parser_cocci_menhir.mly"
       ((Ast_cocci.metavar,Ast_cocci.metavar) Common.either list)
-# 15821 "parser_cocci_menhir.ml"
+# 15822 "parser_cocci_menhir.ml"
         ) = 
 # 181 "parser_cocci_menhir.mly"
                        ( m (!Ast0.rule_name) )
-# 15825 "parser_cocci_menhir.ml"
+# 15826 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15868,13 +15869,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta ->
       let tok = check_meta(Ast.MetaParamDecl(arity,name)) in
       !Data.add_param_meta name pure; tok) )
-# 15872 "parser_cocci_menhir.ml"
+# 15873 "parser_cocci_menhir.ml"
           
         in
         
 # 263 "parser_cocci_menhir.mly"
     ( P.create_metadec ar ispure kindfn ids )
-# 15878 "parser_cocci_menhir.ml"
+# 15879 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15925,13 +15926,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta ->
       let tok = check_meta(Ast.MetaParamListDecl(arity,name,None)) in
       !Data.add_paramlist_meta name None pure; tok) )
-# 15929 "parser_cocci_menhir.ml"
+# 15930 "parser_cocci_menhir.ml"
           
         in
         
 # 263 "parser_cocci_menhir.mly"
     ( P.create_metadec ar ispure kindfn ids )
-# 15935 "parser_cocci_menhir.ml"
+# 15936 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -15982,13 +15983,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta ->
       let tok = check_meta(Ast.MetaExpListDecl(arity,name,None)) in
       !Data.add_explist_meta name None pure; tok) )
-# 15986 "parser_cocci_menhir.ml"
+# 15987 "parser_cocci_menhir.ml"
           
         in
         
 # 263 "parser_cocci_menhir.mly"
     ( P.create_metadec ar ispure kindfn ids )
-# 15992 "parser_cocci_menhir.ml"
+# 15993 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16035,13 +16036,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta ->
       let tok = check_meta(Ast.MetaTypeDecl(arity,name)) in
       !Data.add_type_meta name pure; tok) )
-# 16039 "parser_cocci_menhir.ml"
+# 16040 "parser_cocci_menhir.ml"
           
         in
         
 # 263 "parser_cocci_menhir.mly"
     ( P.create_metadec ar ispure kindfn ids )
-# 16045 "parser_cocci_menhir.ml"
+# 16046 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16088,13 +16089,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta ->
       let tok = check_meta(Ast.MetaInitDecl(arity,name)) in
       !Data.add_init_meta name pure; tok) )
-# 16092 "parser_cocci_menhir.ml"
+# 16093 "parser_cocci_menhir.ml"
           
         in
         
 # 263 "parser_cocci_menhir.mly"
     ( P.create_metadec ar ispure kindfn ids )
-# 16098 "parser_cocci_menhir.ml"
+# 16099 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16141,13 +16142,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta ->
       let tok = check_meta(Ast.MetaStmDecl(arity,name)) in
       !Data.add_stm_meta name pure; tok) )
-# 16145 "parser_cocci_menhir.ml"
+# 16146 "parser_cocci_menhir.ml"
           
         in
         
 # 263 "parser_cocci_menhir.mly"
     ( P.create_metadec ar ispure kindfn ids )
-# 16151 "parser_cocci_menhir.ml"
+# 16152 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16198,13 +16199,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta ->
       let tok = check_meta(Ast.MetaStmListDecl(arity,name)) in
       !Data.add_stmlist_meta name pure; tok) )
-# 16202 "parser_cocci_menhir.ml"
+# 16203 "parser_cocci_menhir.ml"
           
         in
         
 # 263 "parser_cocci_menhir.mly"
     ( P.create_metadec ar ispure kindfn ids )
-# 16208 "parser_cocci_menhir.ml"
+# 16209 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16252,13 +16253,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
       if arity = Ast.NONE && pure = Ast0.Impure
       then (!Data.add_type_name name; [])
       else raise (Semantic_cocci.Semantic "bad typedef")) )
-# 16256 "parser_cocci_menhir.ml"
+# 16257 "parser_cocci_menhir.ml"
           
         in
         
 # 263 "parser_cocci_menhir.mly"
     ( P.create_metadec ar ispure kindfn ids )
-# 16262 "parser_cocci_menhir.ml"
+# 16263 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16310,13 +16311,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
       if arity = Ast.NONE && pure = Ast0.Impure
       then (!Data.add_declarer_name name; [])
       else raise (Semantic_cocci.Semantic "bad declarer")) )
-# 16314 "parser_cocci_menhir.ml"
+# 16315 "parser_cocci_menhir.ml"
           
         in
         
 # 263 "parser_cocci_menhir.mly"
     ( P.create_metadec ar ispure kindfn ids )
-# 16320 "parser_cocci_menhir.ml"
+# 16321 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16368,13 +16369,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
       if arity = Ast.NONE && pure = Ast0.Impure
       then (!Data.add_iterator_name name; [])
       else raise (Semantic_cocci.Semantic "bad iterator")) )
-# 16372 "parser_cocci_menhir.ml"
+# 16373 "parser_cocci_menhir.ml"
           
         in
         
 # 263 "parser_cocci_menhir.mly"
     ( P.create_metadec ar ispure kindfn ids )
-# 16378 "parser_cocci_menhir.ml"
+# 16379 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16413,13 +16414,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun name check_meta seed ->
       let tok = check_meta(Ast.MetaFreshIdDecl(name,seed)) in
       !Data.add_fresh_id_meta name; tok) )
-# 16417 "parser_cocci_menhir.ml"
+# 16418 "parser_cocci_menhir.ml"
           
         in
         
 # 266 "parser_cocci_menhir.mly"
     ( P.create_fresh_metadec kindfn ids )
-# 16423 "parser_cocci_menhir.ml"
+# 16424 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16466,13 +16467,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta constraints ->
       let tok = check_meta(Ast.MetaIdDecl(arity,name)) in
       !Data.add_id_meta name constraints pure; tok) )
-# 16470 "parser_cocci_menhir.ml"
+# 16471 "parser_cocci_menhir.ml"
           
         in
         
 # 270 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 16476 "parser_cocci_menhir.ml"
+# 16477 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16519,13 +16520,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta constraints ->
       let tok = check_meta(Ast.MetaFuncDecl(arity,name)) in
       !Data.add_func_meta name constraints pure; tok) )
-# 16523 "parser_cocci_menhir.ml"
+# 16524 "parser_cocci_menhir.ml"
           
         in
         
 # 270 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 16529 "parser_cocci_menhir.ml"
+# 16530 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16577,13 +16578,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
       let tok = check_meta(Ast.MetaLocalFuncDecl(arity,name)) in
       !Data.add_local_func_meta name constraints pure;
       tok) )
-# 16581 "parser_cocci_menhir.ml"
+# 16582 "parser_cocci_menhir.ml"
           
         in
         
 # 270 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 16587 "parser_cocci_menhir.ml"
+# 16588 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16630,13 +16631,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta constraints ->
       let tok = check_meta(Ast.MetaDeclarerDecl(arity,name)) in
       !Data.add_declarer_meta name constraints pure; tok) )
-# 16634 "parser_cocci_menhir.ml"
+# 16635 "parser_cocci_menhir.ml"
           
         in
         
 # 270 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 16640 "parser_cocci_menhir.ml"
+# 16641 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16683,13 +16684,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta constraints ->
       let tok = check_meta(Ast.MetaIteratorDecl(arity,name)) in
       !Data.add_iterator_meta name constraints pure; tok) )
-# 16687 "parser_cocci_menhir.ml"
+# 16688 "parser_cocci_menhir.ml"
           
         in
         
 # 270 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 16693 "parser_cocci_menhir.ml"
+# 16694 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16736,13 +16737,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta constraints ->
       let tok = check_meta(Ast.MetaErrDecl(arity,name)) in
       !Data.add_err_meta name constraints pure; tok) )
-# 16740 "parser_cocci_menhir.ml"
+# 16741 "parser_cocci_menhir.ml"
           
         in
         
 # 274 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 16746 "parser_cocci_menhir.ml"
+# 16747 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16795,7 +16796,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 39 "standard.mly"
     ( None )
-# 16799 "parser_cocci_menhir.ml"
+# 16800 "parser_cocci_menhir.ml"
             
           in
           
@@ -16808,13 +16809,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
       | Some _ ->
          !Data.add_local_idexp_meta ty name constraints pure;
          check_meta(Ast.MetaLocalIdExpDecl(arity,name,ty))) )
-# 16812 "parser_cocci_menhir.ml"
+# 16813 "parser_cocci_menhir.ml"
           
         in
         
 # 274 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 16818 "parser_cocci_menhir.ml"
+# 16819 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16875,7 +16876,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 41 "standard.mly"
     ( Some x )
-# 16879 "parser_cocci_menhir.ml"
+# 16880 "parser_cocci_menhir.ml"
             
           in
           
@@ -16888,13 +16889,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
       | Some _ ->
          !Data.add_local_idexp_meta ty name constraints pure;
          check_meta(Ast.MetaLocalIdExpDecl(arity,name,ty))) )
-# 16892 "parser_cocci_menhir.ml"
+# 16893 "parser_cocci_menhir.ml"
           
         in
         
 # 274 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 16898 "parser_cocci_menhir.ml"
+# 16899 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -16961,13 +16962,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
       | Some _ ->
          !Data.add_local_idexp_meta ty name constraints pure;
          check_meta(Ast.MetaLocalIdExpDecl(arity,name,ty))) )
-# 16965 "parser_cocci_menhir.ml"
+# 16966 "parser_cocci_menhir.ml"
           
         in
         
 # 274 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 16971 "parser_cocci_menhir.ml"
+# 16972 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17022,13 +17023,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
       let ty = Some [P.ty_pointerify Type_cocci.Unknown m] in
       let tok = check_meta(Ast.MetaExpDecl(arity,name,ty)) in
       !Data.add_exp_meta ty name constraints pure; tok) )
-# 17026 "parser_cocci_menhir.ml"
+# 17027 "parser_cocci_menhir.ml"
           
         in
         
 # 274 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 17032 "parser_cocci_menhir.ml"
+# 17033 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17087,13 +17088,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
       let ty = Some (List.map (function x -> Type_cocci.Array x) vl) in
       let tok = check_meta(Ast.MetaExpDecl(arity,name,ty)) in
       !Data.add_exp_meta ty name constraints pure; tok) )
-# 17091 "parser_cocci_menhir.ml"
+# 17092 "parser_cocci_menhir.ml"
           
         in
         
 # 274 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 17097 "parser_cocci_menhir.ml"
+# 17098 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17139,7 +17140,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 39 "standard.mly"
     ( None )
-# 17143 "parser_cocci_menhir.ml"
+# 17144 "parser_cocci_menhir.ml"
             
           in
           
@@ -17147,13 +17148,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta constraints ->
       let tok = check_meta(Ast.MetaConstDecl(arity,name,ty)) in
       !Data.add_const_meta ty name constraints pure; tok) )
-# 17151 "parser_cocci_menhir.ml"
+# 17152 "parser_cocci_menhir.ml"
           
         in
         
 # 274 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 17157 "parser_cocci_menhir.ml"
+# 17158 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17207,7 +17208,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             
 # 41 "standard.mly"
     ( Some x )
-# 17211 "parser_cocci_menhir.ml"
+# 17212 "parser_cocci_menhir.ml"
             
           in
           
@@ -17215,13 +17216,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta constraints ->
       let tok = check_meta(Ast.MetaConstDecl(arity,name,ty)) in
       !Data.add_const_meta ty name constraints pure; tok) )
-# 17219 "parser_cocci_menhir.ml"
+# 17220 "parser_cocci_menhir.ml"
           
         in
         
 # 274 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 17225 "parser_cocci_menhir.ml"
+# 17226 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17268,13 +17269,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( (fun arity name pure check_meta constraints ->
       let tok = check_meta(Ast.MetaExpDecl(arity,name,None)) in
       !Data.add_exp_meta None name constraints pure; tok) )
-# 17272 "parser_cocci_menhir.ml"
+# 17273 "parser_cocci_menhir.ml"
           
         in
         
 # 278 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 17278 "parser_cocci_menhir.ml"
+# 17279 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17340,13 +17341,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
        constraints;
       let tok = check_meta(Ast.MetaExpDecl(arity,name,ty)) in
       !Data.add_exp_meta ty name constraints pure; tok) )
-# 17344 "parser_cocci_menhir.ml"
+# 17345 "parser_cocci_menhir.ml"
           
         in
         
 # 278 "parser_cocci_menhir.mly"
     ( P.create_metadec_ne ar ispure kindfn ids )
-# 17350 "parser_cocci_menhir.ml"
+# 17351 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17396,7 +17397,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
       let any = match a with None -> Ast.PER | Some _ -> Ast.ALL in
       !Data.add_pos_meta name constraints any; tok in
     P.create_metadec_ne ar false kindfn ids )
-# 17400 "parser_cocci_menhir.ml"
+# 17401 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17463,7 +17464,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
            check_meta(Ast.MetaParamListDecl(arity,name,Some lenname)) in
          !Data.add_paramlist_meta name (Some lenname) pure; tok)
        id ids )
-# 17467 "parser_cocci_menhir.ml"
+# 17468 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17530,7 +17531,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
            check_meta(Ast.MetaExpListDecl(arity,name,Some lenname)) in
          !Data.add_explist_meta name (Some lenname) pure; tok)
        id ids )
-# 17534 "parser_cocci_menhir.ml"
+# 17535 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17558,9 +17559,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_a_ in
         let _endpos = _endpos_b_ in
         let _v : 'tv_midzero_list_ctype_ctype_ = 
-# 1802 "parser_cocci_menhir.mly"
+# 1803 "parser_cocci_menhir.mly"
      ( let (mids,code) = List.split b in (mids,(a::code)) )
-# 17564 "parser_cocci_menhir.ml"
+# 17565 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17588,9 +17589,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_a_ in
         let _endpos = _endpos_b_ in
         let _v : 'tv_midzero_list_eexpr_eexpr_ = 
-# 1802 "parser_cocci_menhir.mly"
+# 1803 "parser_cocci_menhir.mly"
      ( let (mids,code) = List.split b in (mids,(a::code)) )
-# 17594 "parser_cocci_menhir.ml"
+# 17595 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17618,9 +17619,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_a_ in
         let _endpos = _endpos_b_ in
         let _v : 'tv_midzero_list_expr_eexpr_ = 
-# 1802 "parser_cocci_menhir.mly"
+# 1803 "parser_cocci_menhir.mly"
      ( let (mids,code) = List.split b in (mids,(a::code)) )
-# 17624 "parser_cocci_menhir.ml"
+# 17625 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17648,9 +17649,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_a_ in
         let _endpos = _endpos_b_ in
         let _v : 'tv_midzero_list_fun_after_stm_fun_after_dots_or_ = 
-# 1802 "parser_cocci_menhir.mly"
+# 1803 "parser_cocci_menhir.mly"
      ( let (mids,code) = List.split b in (mids,(a::code)) )
-# 17654 "parser_cocci_menhir.ml"
+# 17655 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17678,9 +17679,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_a_ in
         let _endpos = _endpos_b_ in
         let _v : 'tv_midzero_list_fun_start_fun_start_ = 
-# 1802 "parser_cocci_menhir.mly"
+# 1803 "parser_cocci_menhir.mly"
      ( let (mids,code) = List.split b in (mids,(a::code)) )
-# 17684 "parser_cocci_menhir.ml"
+# 17685 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17708,9 +17709,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_a_ in
         let _endpos = _endpos_b_ in
         let _v : 'tv_midzero_list_rule_elem_statement_rule_elem_statement_ = 
-# 1802 "parser_cocci_menhir.mly"
+# 1803 "parser_cocci_menhir.mly"
      ( let (mids,code) = List.split b in (mids,(a::code)) )
-# 17714 "parser_cocci_menhir.ml"
+# 17715 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17738,9 +17739,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_a_ in
         let _endpos = _endpos_b_ in
         let _v : 'tv_midzero_list_statement_statement_ = 
-# 1802 "parser_cocci_menhir.mly"
+# 1803 "parser_cocci_menhir.mly"
      ( let (mids,code) = List.split b in (mids,(a::code)) )
-# 17744 "parser_cocci_menhir.ml"
+# 17745 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17778,7 +17779,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( match f@b@ew with
       [] -> raise (Semantic_cocci.Semantic "minus slice can't be empty")
     | code -> Top_level.top_level code )
-# 17782 "parser_cocci_menhir.ml"
+# 17783 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17816,7 +17817,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
     ( match f@[b]@ew with
       [] -> raise (Semantic_cocci.Semantic "minus slice can't be empty")
     | code -> Top_level.top_level code )
-# 17820 "parser_cocci_menhir.ml"
+# 17821 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17844,11 +17845,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 137 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 17848 "parser_cocci_menhir.ml"
+# 17849 "parser_cocci_menhir.ml"
         ) = 
 # 177 "parser_cocci_menhir.mly"
                                    ( _1 )
-# 17852 "parser_cocci_menhir.ml"
+# 17853 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17876,11 +17877,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 137 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 17880 "parser_cocci_menhir.ml"
+# 17881 "parser_cocci_menhir.ml"
         ) = 
 # 177 "parser_cocci_menhir.mly"
                                                                        ( m )
-# 17884 "parser_cocci_menhir.ml"
+# 17885 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17908,11 +17909,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 137 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 17912 "parser_cocci_menhir.ml"
+# 17913 "parser_cocci_menhir.ml"
         ) = 
 # 178 "parser_cocci_menhir.mly"
                          ( m )
-# 17916 "parser_cocci_menhir.ml"
+# 17917 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17940,11 +17941,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 134 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 17944 "parser_cocci_menhir.ml"
+# 17945 "parser_cocci_menhir.ml"
         ) = 
 # 173 "parser_cocci_menhir.mly"
                            ( _1 )
-# 17948 "parser_cocci_menhir.ml"
+# 17949 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -17972,11 +17973,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 134 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 17976 "parser_cocci_menhir.ml"
+# 17977 "parser_cocci_menhir.ml"
         ) = 
 # 173 "parser_cocci_menhir.mly"
                                                            ( m )
-# 17980 "parser_cocci_menhir.ml"
+# 17981 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18004,11 +18005,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 134 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 18008 "parser_cocci_menhir.ml"
+# 18009 "parser_cocci_menhir.ml"
         ) = 
 # 174 "parser_cocci_menhir.mly"
                      ( m )
-# 18012 "parser_cocci_menhir.ml"
+# 18013 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18030,9 +18031,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_minus_start = 
-# 1611 "parser_cocci_menhir.mly"
+# 1612 "parser_cocci_menhir.mly"
                          ( [Ast0.wrap(Ast0.DECL(_1))] )
-# 18036 "parser_cocci_menhir.ml"
+# 18037 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18054,9 +18055,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_minus_start = 
-# 1612 "parser_cocci_menhir.mly"
+# 1613 "parser_cocci_menhir.mly"
                          ( [Ast0.wrap(Ast0.OTHER(Ast0.wrap(Ast0.Ty(_1))))] )
-# 18060 "parser_cocci_menhir.ml"
+# 18061 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18078,9 +18079,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_minus_start = 
-# 1613 "parser_cocci_menhir.mly"
+# 1614 "parser_cocci_menhir.mly"
                     ( [Ast0.wrap(Ast0.OTHER(Ast0.wrap(Ast0.TopInit(_1))))] )
-# 18084 "parser_cocci_menhir.ml"
+# 18085 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18102,9 +18103,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_minus_start = 
-# 1615 "parser_cocci_menhir.mly"
+# 1616 "parser_cocci_menhir.mly"
     ( List.map (function x -> Ast0.wrap(Ast0.OTHER(x))) _1 )
-# 18108 "parser_cocci_menhir.ml"
+# 18109 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18131,14 +18132,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let a : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18135 "parser_cocci_menhir.ml"
+# 18136 "parser_cocci_menhir.ml"
         ) = Obj.magic a in
         let _startpos = _startpos_a_ in
         let _endpos = _endpos_b_ in
         let _v : 'tv_mzl_ctype_ = 
-# 1805 "parser_cocci_menhir.mly"
+# 1806 "parser_cocci_menhir.mly"
                  ( (P.clt2mcode "|" a, b) )
-# 18142 "parser_cocci_menhir.ml"
+# 18143 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18165,14 +18166,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let a : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18169 "parser_cocci_menhir.ml"
+# 18170 "parser_cocci_menhir.ml"
         ) = Obj.magic a in
         let _startpos = _startpos_a_ in
         let _endpos = _endpos_b_ in
         let _v : 'tv_mzl_eexpr_ = 
-# 1805 "parser_cocci_menhir.mly"
+# 1806 "parser_cocci_menhir.mly"
                  ( (P.clt2mcode "|" a, b) )
-# 18176 "parser_cocci_menhir.ml"
+# 18177 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18199,14 +18200,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let a : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18203 "parser_cocci_menhir.ml"
+# 18204 "parser_cocci_menhir.ml"
         ) = Obj.magic a in
         let _startpos = _startpos_a_ in
         let _endpos = _endpos_b_ in
         let _v : 'tv_mzl_fun_after_dots_or_ = 
-# 1805 "parser_cocci_menhir.mly"
+# 1806 "parser_cocci_menhir.mly"
                  ( (P.clt2mcode "|" a, b) )
-# 18210 "parser_cocci_menhir.ml"
+# 18211 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18233,14 +18234,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let a : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18237 "parser_cocci_menhir.ml"
+# 18238 "parser_cocci_menhir.ml"
         ) = Obj.magic a in
         let _startpos = _startpos_a_ in
         let _endpos = _endpos_b_ in
         let _v : 'tv_mzl_fun_start_ = 
-# 1805 "parser_cocci_menhir.mly"
+# 1806 "parser_cocci_menhir.mly"
                  ( (P.clt2mcode "|" a, b) )
-# 18244 "parser_cocci_menhir.ml"
+# 18245 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18267,14 +18268,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let a : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18271 "parser_cocci_menhir.ml"
+# 18272 "parser_cocci_menhir.ml"
         ) = Obj.magic a in
         let _startpos = _startpos_a_ in
         let _endpos = _endpos_b_ in
         let _v : 'tv_mzl_rule_elem_statement_ = 
-# 1805 "parser_cocci_menhir.mly"
+# 1806 "parser_cocci_menhir.mly"
                  ( (P.clt2mcode "|" a, b) )
-# 18278 "parser_cocci_menhir.ml"
+# 18279 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18301,14 +18302,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let a : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18305 "parser_cocci_menhir.ml"
+# 18306 "parser_cocci_menhir.ml"
         ) = Obj.magic a in
         let _startpos = _startpos_a_ in
         let _endpos = _endpos_b_ in
         let _v : 'tv_mzl_statement_ = 
-# 1805 "parser_cocci_menhir.mly"
+# 1806 "parser_cocci_menhir.mly"
                  ( (P.clt2mcode "|" a, b) )
-# 18312 "parser_cocci_menhir.ml"
+# 18313 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18330,9 +18331,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_name_opt_decl = 
-# 839 "parser_cocci_menhir.mly"
+# 840 "parser_cocci_menhir.mly"
             ( _1 )
-# 18336 "parser_cocci_menhir.ml"
+# 18337 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18354,9 +18355,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_t_ in
         let _endpos = _endpos_t_ in
         let _v : 'tv_name_opt_decl = 
-# 840 "parser_cocci_menhir.mly"
+# 841 "parser_cocci_menhir.mly"
               ( Ast0.wrap(Ast0.Param(t, None)) )
-# 18360 "parser_cocci_menhir.ml"
+# 18361 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18407,41 +18408,41 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let rp1 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18411 "parser_cocci_menhir.ml"
+# 18412 "parser_cocci_menhir.ml"
         ) = Obj.magic rp1 in
         let d : 'tv_decl_list_name_opt_decl_ = Obj.magic d in
         let lp1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18417 "parser_cocci_menhir.ml"
+# 18418 "parser_cocci_menhir.ml"
         ) = Obj.magic lp1 in
         let rp : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18422 "parser_cocci_menhir.ml"
+# 18423 "parser_cocci_menhir.ml"
         ) = Obj.magic rp in
         let s : (
 # 99 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18427 "parser_cocci_menhir.ml"
+# 18428 "parser_cocci_menhir.ml"
         ) = Obj.magic s in
         let lp : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18432 "parser_cocci_menhir.ml"
+# 18433 "parser_cocci_menhir.ml"
         ) = Obj.magic lp in
         let t : 'tv_fn_ctype = Obj.magic t in
         let _startpos = _startpos_t_ in
         let _endpos = _endpos_rp1_ in
         let _v : 'tv_name_opt_decl = 
-# 843 "parser_cocci_menhir.mly"
+# 844 "parser_cocci_menhir.mly"
         ( let fnptr =
          Ast0.wrap
            (Ast0.FunctionPointer
               (t,P.clt2mcode "(" lp,P.clt2mcode "*" s,P.clt2mcode ")" rp,
                P.clt2mcode "(" lp1,d,P.clt2mcode ")" rp1)) in
        Ast0.wrap(Ast0.Param(fnptr, None)) )
-# 18445 "parser_cocci_menhir.ml"
+# 18446 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18469,9 +18470,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_nest_after_dots = 
-# 1726 "parser_cocci_menhir.mly"
+# 1727 "parser_cocci_menhir.mly"
                                      (_1@_2)
-# 18475 "parser_cocci_menhir.ml"
+# 18476 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18497,9 +18498,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_nest_after_dots = 
-# 1727 "parser_cocci_menhir.mly"
+# 1728 "parser_cocci_menhir.mly"
                                 (_2)
-# 18503 "parser_cocci_menhir.ml"
+# 18504 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18527,9 +18528,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_nest_after_dots = 
-# 1728 "parser_cocci_menhir.mly"
+# 1729 "parser_cocci_menhir.mly"
                                 ((Ast0.wrap(Ast0.Exp(_1)))::_2)
-# 18533 "parser_cocci_menhir.ml"
+# 18534 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18544,9 +18545,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_nest_after_exp = 
-# 1736 "parser_cocci_menhir.mly"
+# 1737 "parser_cocci_menhir.mly"
                                 ([])
-# 18550 "parser_cocci_menhir.ml"
+# 18551 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18574,9 +18575,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_nest_after_exp = 
-# 1737 "parser_cocci_menhir.mly"
+# 1738 "parser_cocci_menhir.mly"
                                 (_1::_2)
-# 18580 "parser_cocci_menhir.ml"
+# 18581 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18591,9 +18592,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_nest_after_stm = 
-# 1731 "parser_cocci_menhir.mly"
+# 1732 "parser_cocci_menhir.mly"
                                 ([])
-# 18597 "parser_cocci_menhir.ml"
+# 18598 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18621,9 +18622,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_nest_after_stm = 
-# 1732 "parser_cocci_menhir.mly"
+# 1733 "parser_cocci_menhir.mly"
                                 (_1::_2)
-# 18627 "parser_cocci_menhir.ml"
+# 18628 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18651,9 +18652,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_nest_after_stm = 
-# 1733 "parser_cocci_menhir.mly"
+# 1734 "parser_cocci_menhir.mly"
                                 (_1@_2)
-# 18657 "parser_cocci_menhir.ml"
+# 18658 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18684,22 +18685,22 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let c : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18688 "parser_cocci_menhir.ml"
+# 18689 "parser_cocci_menhir.ml"
         ) = Obj.magic c in
         let e : 'tv_expr_dots_TEllipsis_ = Obj.magic e in
         let _1 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18694 "parser_cocci_menhir.ml"
+# 18695 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_c_ in
         let _v : 'tv_nest_expressions = 
-# 1221 "parser_cocci_menhir.mly"
+# 1222 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.NestExpr(P.clt2mcode "<..." _1,
                              Ast0.wrap(Ast0.DOTS(e (P.mkedots "..."))),
                              P.clt2mcode "...>" c, None, false)) )
-# 18703 "parser_cocci_menhir.ml"
+# 18704 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18730,22 +18731,22 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let c : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18734 "parser_cocci_menhir.ml"
+# 18735 "parser_cocci_menhir.ml"
         ) = Obj.magic c in
         let e : 'tv_expr_dots_TEllipsis_ = Obj.magic e in
         let _1 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18740 "parser_cocci_menhir.ml"
+# 18741 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_c_ in
         let _v : 'tv_nest_expressions = 
-# 1225 "parser_cocci_menhir.mly"
+# 1226 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.NestExpr(P.clt2mcode "<+..." _1,
                              Ast0.wrap(Ast0.DOTS(e (P.mkedots "..."))),
                              P.clt2mcode "...+>" c, None, true)) )
-# 18749 "parser_cocci_menhir.ml"
+# 18750 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18767,9 +18768,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_nest_start = 
-# 1723 "parser_cocci_menhir.mly"
+# 1724 "parser_cocci_menhir.mly"
                    ( Ast0.wrap(Ast0.DOTS(_1)) )
-# 18773 "parser_cocci_menhir.ml"
+# 18774 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18791,11 +18792,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 168 "parser_cocci_menhir.mly"
       (unit)
-# 18795 "parser_cocci_menhir.ml"
+# 18796 "parser_cocci_menhir.ml"
         ) = 
-# 1868 "parser_cocci_menhir.mly"
+# 1874 "parser_cocci_menhir.mly"
                     ( () )
-# 18799 "parser_cocci_menhir.ml"
+# 18800 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18821,11 +18822,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 168 "parser_cocci_menhir.mly"
       (unit)
-# 18825 "parser_cocci_menhir.ml"
+# 18826 "parser_cocci_menhir.ml"
         ) = 
-# 1869 "parser_cocci_menhir.mly"
+# 1875 "parser_cocci_menhir.mly"
                     ( () )
-# 18829 "parser_cocci_menhir.ml"
+# 18830 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18847,11 +18848,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 168 "parser_cocci_menhir.mly"
       (unit)
-# 18851 "parser_cocci_menhir.ml"
+# 18852 "parser_cocci_menhir.ml"
         ) = 
-# 1870 "parser_cocci_menhir.mly"
+# 1876 "parser_cocci_menhir.mly"
                     ( () )
-# 18855 "parser_cocci_menhir.ml"
+# 18856 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18879,10 +18880,10 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_g_ in
         let _endpos = _endpos_dg_ in
         let _v : 'tv_no_dot_start_end_dexpr_edots_when_TEllipsis_eexpr__ = 
-# 1389 "parser_cocci_menhir.mly"
+# 1390 "parser_cocci_menhir.mly"
   ( function dot_builder ->
       g :: (List.concat(List.map (function (d,g) -> [dot_builder d;g]) dg)) )
-# 18886 "parser_cocci_menhir.ml"
+# 18887 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18903,14 +18904,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let x : (
 # 99 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18907 "parser_cocci_menhir.ml"
+# 18908 "parser_cocci_menhir.ml"
         ) = Obj.magic x in
         let _startpos = _startpos_x_ in
         let _endpos = _endpos_x_ in
         let _v : 'tv_nonempty_list_TMul_ = 
 # 124 "standard.mly"
     ( [ x ] )
-# 18914 "parser_cocci_menhir.ml"
+# 18915 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18937,14 +18938,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let x : (
 # 99 "parser_cocci_menhir.mly"
        (Data.clt)
-# 18941 "parser_cocci_menhir.ml"
+# 18942 "parser_cocci_menhir.ml"
         ) = Obj.magic x in
         let _startpos = _startpos_x_ in
         let _endpos = _endpos_xs_ in
         let _v : 'tv_nonempty_list_TMul_ = 
 # 126 "standard.mly"
     ( x :: xs )
-# 18948 "parser_cocci_menhir.ml"
+# 18949 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -18970,13 +18971,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_i_ in
         let _v : 'tv_not_ceq = 
-# 1450 "parser_cocci_menhir.mly"
+# 1451 "parser_cocci_menhir.mly"
          ( (if !Data.in_iso
           then failwith "constraints not allowed in iso file");
           (if !Data.in_generating
           then failwith "constraints not allowed in a generated rule file");
           [i] )
-# 18980 "parser_cocci_menhir.ml"
+# 18981 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19010,13 +19011,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
         let _v : 'tv_not_ceq = 
-# 1456 "parser_cocci_menhir.mly"
+# 1457 "parser_cocci_menhir.mly"
   ( (if !Data.in_iso
           then failwith "constraints not allowed in iso file");
           (if !Data.in_generating
           then failwith "constraints not allowed in a generated rule file");
           l )
-# 19020 "parser_cocci_menhir.ml"
+# 19021 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19042,7 +19043,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_i_ in
         let _v : 'tv_not_eq = 
-# 1417 "parser_cocci_menhir.mly"
+# 1418 "parser_cocci_menhir.mly"
          ( (if !Data.in_iso
           then failwith "constraints not allowed in iso file");
           (if !Data.in_generating
@@ -19050,7 +19051,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
              them in the pattern *)
           then failwith "constraints not allowed in a generated rule file");
           [Ast0.wrap(Ast0.Id(P.id2mcode i))] )
-# 19054 "parser_cocci_menhir.ml"
+# 19055 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19084,13 +19085,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
         let _v : 'tv_not_eq = 
-# 1425 "parser_cocci_menhir.mly"
+# 1426 "parser_cocci_menhir.mly"
   ( (if !Data.in_iso
           then failwith "constraints not allowed in iso file");
           (if !Data.in_generating
           then failwith "constraints not allowed in a generated rule file");
           List.map (function i -> Ast0.wrap(Ast0.Id(P.id2mcode i))) l )
-# 19094 "parser_cocci_menhir.ml"
+# 19095 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19116,13 +19117,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_i_ in
         let _v : 'tv_not_eqe = 
-# 1433 "parser_cocci_menhir.mly"
+# 1434 "parser_cocci_menhir.mly"
          ( (if !Data.in_iso
           then failwith "constraints not allowed in iso file");
           (if !Data.in_generating
           then failwith "constraints not allowed in a generated rule file");
           [Ast0.wrap(Ast0.Ident(Ast0.wrap(Ast0.Id(P.id2mcode i))))] )
-# 19126 "parser_cocci_menhir.ml"
+# 19127 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19156,7 +19157,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
         let _v : 'tv_not_eqe = 
-# 1439 "parser_cocci_menhir.mly"
+# 1440 "parser_cocci_menhir.mly"
   ( (if !Data.in_iso
           then failwith "constraints not allowed in iso file");
           (if !Data.in_generating
@@ -19165,7 +19166,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
             (function i ->
               Ast0.wrap(Ast0.Ident(Ast0.wrap(Ast0.Id(P.id2mcode i)))))
             l )
-# 19169 "parser_cocci_menhir.ml"
+# 19170 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19191,7 +19192,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_i_ in
         let _v : 'tv_not_pos = 
-# 1470 "parser_cocci_menhir.mly"
+# 1471 "parser_cocci_menhir.mly"
          ( (if !Data.in_iso
           then failwith "constraints not allowed in iso file");
           (if !Data.in_generating
@@ -19202,7 +19203,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
               let i = (rule,name) in
               P.check_meta(Ast.MetaPosDecl(Ast.NONE,i));
               [i] )
-# 19206 "parser_cocci_menhir.ml"
+# 19207 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19236,7 +19237,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
         let _v : 'tv_not_pos = 
-# 1481 "parser_cocci_menhir.mly"
+# 1482 "parser_cocci_menhir.mly"
   ( (if !Data.in_iso
           then failwith "constraints not allowed in iso file");
           (if !Data.in_generating
@@ -19250,7 +19251,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
                   P.check_meta(Ast.MetaPosDecl(Ast.NONE,i));
                   i)
             l )
-# 19254 "parser_cocci_menhir.ml"
+# 19255 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19272,9 +19273,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_one_dec_decl_ = 
-# 1555 "parser_cocci_menhir.mly"
+# 1556 "parser_cocci_menhir.mly"
         ( _1 )
-# 19278 "parser_cocci_menhir.ml"
+# 19279 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19295,12 +19296,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 66 "parser_cocci_menhir.mly"
        (Parse_aux.list_info)
-# 19299 "parser_cocci_menhir.ml"
+# 19300 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_one_dec_decl_ = 
-# 1557 "parser_cocci_menhir.mly"
+# 1558 "parser_cocci_menhir.mly"
     ( let (nm,lenname,pure,clt) = _1 in
     let nm = P.clt2mcode nm clt in
     let lenname =
@@ -19308,7 +19309,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
        Some nm -> Some(P.clt2mcode nm clt)
       | None -> None in
     Ast0.wrap(Ast0.MetaParamList(nm,lenname,pure)) )
-# 19312 "parser_cocci_menhir.ml"
+# 19313 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19330,9 +19331,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_one_dec_name_opt_decl_ = 
-# 1555 "parser_cocci_menhir.mly"
+# 1556 "parser_cocci_menhir.mly"
         ( _1 )
-# 19336 "parser_cocci_menhir.ml"
+# 19337 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19353,12 +19354,12 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 66 "parser_cocci_menhir.mly"
        (Parse_aux.list_info)
-# 19357 "parser_cocci_menhir.ml"
+# 19358 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_one_dec_name_opt_decl_ = 
-# 1557 "parser_cocci_menhir.mly"
+# 1558 "parser_cocci_menhir.mly"
     ( let (nm,lenname,pure,clt) = _1 in
     let nm = P.clt2mcode nm clt in
     let lenname =
@@ -19366,7 +19367,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
        Some nm -> Some(P.clt2mcode nm clt)
       | None -> None in
     Ast0.wrap(Ast0.MetaParamList(nm,lenname,pure)) )
-# 19370 "parser_cocci_menhir.ml"
+# 19371 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19392,15 +19393,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 19396 "parser_cocci_menhir.ml"
+# 19397 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let t : 'tv_ctype = Obj.magic t in
         let _startpos = _startpos_t_ in
         let _endpos = _endpos_pv_ in
         let _v : 'tv_one_decl_var = 
-# 1010 "parser_cocci_menhir.mly"
+# 1011 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.TyDecl(t,P.clt2mcode ";" pv)) )
-# 19404 "parser_cocci_menhir.ml"
+# 19405 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19431,7 +19432,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 19435 "parser_cocci_menhir.ml"
+# 19436 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let d : 'tv_d_ident = Obj.magic d in
         let t : 'tv_ctype = Obj.magic t in
@@ -19441,14 +19442,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 39 "standard.mly"
     ( None )
-# 19445 "parser_cocci_menhir.ml"
+# 19446 "parser_cocci_menhir.ml"
           
         in
         
-# 1012 "parser_cocci_menhir.mly"
+# 1013 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         Ast0.wrap(Ast0.UnInit(s,fn t,id,P.clt2mcode ";" pv)) )
-# 19452 "parser_cocci_menhir.ml"
+# 19453 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19484,7 +19485,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 19488 "parser_cocci_menhir.ml"
+# 19489 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let d : 'tv_d_ident = Obj.magic d in
         let t : 'tv_ctype = Obj.magic t in
@@ -19496,14 +19497,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 19500 "parser_cocci_menhir.ml"
+# 19501 "parser_cocci_menhir.ml"
           
         in
         
-# 1012 "parser_cocci_menhir.mly"
+# 1013 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         Ast0.wrap(Ast0.UnInit(s,fn t,id,P.clt2mcode ";" pv)) )
-# 19507 "parser_cocci_menhir.ml"
+# 19508 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19525,9 +19526,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_f_ in
         let _endpos = _endpos_f_ in
         let _v : 'tv_one_decl_var = 
-# 1014 "parser_cocci_menhir.mly"
+# 1015 "parser_cocci_menhir.mly"
                ( f )
-# 19531 "parser_cocci_menhir.ml"
+# 19532 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19568,13 +19569,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 19572 "parser_cocci_menhir.ml"
+# 19573 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let e : 'tv_initialize = Obj.magic e in
         let q : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 19578 "parser_cocci_menhir.ml"
+# 19579 "parser_cocci_menhir.ml"
         ) = Obj.magic q in
         let d : 'tv_d_ident = Obj.magic d in
         let t : 'tv_ctype = Obj.magic t in
@@ -19584,14 +19585,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 39 "standard.mly"
     ( None )
-# 19588 "parser_cocci_menhir.ml"
+# 19589 "parser_cocci_menhir.ml"
           
         in
         
-# 1016 "parser_cocci_menhir.mly"
+# 1017 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
       Ast0.wrap(Ast0.Init(s,fn t,id,P.clt2mcode "=" q,e,P.clt2mcode ";" pv)) )
-# 19595 "parser_cocci_menhir.ml"
+# 19596 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19637,13 +19638,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 19641 "parser_cocci_menhir.ml"
+# 19642 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let e : 'tv_initialize = Obj.magic e in
         let q : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 19647 "parser_cocci_menhir.ml"
+# 19648 "parser_cocci_menhir.ml"
         ) = Obj.magic q in
         let d : 'tv_d_ident = Obj.magic d in
         let t : 'tv_ctype = Obj.magic t in
@@ -19655,14 +19656,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 19659 "parser_cocci_menhir.ml"
+# 19660 "parser_cocci_menhir.ml"
           
         in
         
-# 1016 "parser_cocci_menhir.mly"
+# 1017 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
       Ast0.wrap(Ast0.Init(s,fn t,id,P.clt2mcode "=" q,e,P.clt2mcode ";" pv)) )
-# 19666 "parser_cocci_menhir.ml"
+# 19667 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19693,7 +19694,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 19697 "parser_cocci_menhir.ml"
+# 19698 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let d : 'tv_d_ident = Obj.magic d in
         let i : 'tv_pure_ident = Obj.magic i in
@@ -19703,22 +19704,22 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 39 "standard.mly"
     ( None )
-# 19707 "parser_cocci_menhir.ml"
+# 19708 "parser_cocci_menhir.ml"
           
         in
         let s =
           
 # 39 "standard.mly"
     ( None )
-# 19714 "parser_cocci_menhir.ml"
+# 19715 "parser_cocci_menhir.ml"
           
         in
         
-# 1021 "parser_cocci_menhir.mly"
+# 1022 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
        Ast0.wrap(Ast0.UnInit(s,fn idtype,id,P.clt2mcode ";" pv)) )
-# 19722 "parser_cocci_menhir.ml"
+# 19723 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19754,7 +19755,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 19758 "parser_cocci_menhir.ml"
+# 19759 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let d : 'tv_d_ident = Obj.magic d in
         let i : 'tv_pure_ident = Obj.magic i in
@@ -19766,22 +19767,22 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 19770 "parser_cocci_menhir.ml"
+# 19771 "parser_cocci_menhir.ml"
           
         in
         let s =
           
 # 39 "standard.mly"
     ( None )
-# 19777 "parser_cocci_menhir.ml"
+# 19778 "parser_cocci_menhir.ml"
           
         in
         
-# 1021 "parser_cocci_menhir.mly"
+# 1022 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
        Ast0.wrap(Ast0.UnInit(s,fn idtype,id,P.clt2mcode ";" pv)) )
-# 19785 "parser_cocci_menhir.ml"
+# 19786 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19817,7 +19818,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 19821 "parser_cocci_menhir.ml"
+# 19822 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let d : 'tv_d_ident = Obj.magic d in
         let i : 'tv_pure_ident = Obj.magic i in
@@ -19828,7 +19829,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 39 "standard.mly"
     ( None )
-# 19832 "parser_cocci_menhir.ml"
+# 19833 "parser_cocci_menhir.ml"
           
         in
         let s =
@@ -19836,15 +19837,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 19840 "parser_cocci_menhir.ml"
+# 19841 "parser_cocci_menhir.ml"
           
         in
         
-# 1021 "parser_cocci_menhir.mly"
+# 1022 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
        Ast0.wrap(Ast0.UnInit(s,fn idtype,id,P.clt2mcode ";" pv)) )
-# 19848 "parser_cocci_menhir.ml"
+# 19849 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19885,7 +19886,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 19889 "parser_cocci_menhir.ml"
+# 19890 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let d : 'tv_d_ident = Obj.magic d in
         let i : 'tv_pure_ident = Obj.magic i in
@@ -19898,7 +19899,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 19902 "parser_cocci_menhir.ml"
+# 19903 "parser_cocci_menhir.ml"
           
         in
         let s =
@@ -19906,15 +19907,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 19910 "parser_cocci_menhir.ml"
+# 19911 "parser_cocci_menhir.ml"
           
         in
         
-# 1021 "parser_cocci_menhir.mly"
+# 1022 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
        Ast0.wrap(Ast0.UnInit(s,fn idtype,id,P.clt2mcode ";" pv)) )
-# 19918 "parser_cocci_menhir.ml"
+# 19919 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -19955,13 +19956,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 19959 "parser_cocci_menhir.ml"
+# 19960 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let e : 'tv_initialize = Obj.magic e in
         let q : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 19965 "parser_cocci_menhir.ml"
+# 19966 "parser_cocci_menhir.ml"
         ) = Obj.magic q in
         let d : 'tv_d_ident = Obj.magic d in
         let i : 'tv_pure_ident = Obj.magic i in
@@ -19971,24 +19972,24 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 39 "standard.mly"
     ( None )
-# 19975 "parser_cocci_menhir.ml"
+# 19976 "parser_cocci_menhir.ml"
           
         in
         let s =
           
 # 39 "standard.mly"
     ( None )
-# 19982 "parser_cocci_menhir.ml"
+# 19983 "parser_cocci_menhir.ml"
           
         in
         
-# 1026 "parser_cocci_menhir.mly"
+# 1027 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
       !Data.add_type_name (P.id2name i);
       let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
       Ast0.wrap(Ast0.Init(s,fn idtype,id,P.clt2mcode "=" q,e,
                           P.clt2mcode ";" pv)) )
-# 19992 "parser_cocci_menhir.ml"
+# 19993 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20034,13 +20035,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20038 "parser_cocci_menhir.ml"
+# 20039 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let e : 'tv_initialize = Obj.magic e in
         let q : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20044 "parser_cocci_menhir.ml"
+# 20045 "parser_cocci_menhir.ml"
         ) = Obj.magic q in
         let d : 'tv_d_ident = Obj.magic d in
         let i : 'tv_pure_ident = Obj.magic i in
@@ -20052,24 +20053,24 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 20056 "parser_cocci_menhir.ml"
+# 20057 "parser_cocci_menhir.ml"
           
         in
         let s =
           
 # 39 "standard.mly"
     ( None )
-# 20063 "parser_cocci_menhir.ml"
+# 20064 "parser_cocci_menhir.ml"
           
         in
         
-# 1026 "parser_cocci_menhir.mly"
+# 1027 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
       !Data.add_type_name (P.id2name i);
       let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
       Ast0.wrap(Ast0.Init(s,fn idtype,id,P.clt2mcode "=" q,e,
                           P.clt2mcode ";" pv)) )
-# 20073 "parser_cocci_menhir.ml"
+# 20074 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20115,13 +20116,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20119 "parser_cocci_menhir.ml"
+# 20120 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let e : 'tv_initialize = Obj.magic e in
         let q : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20125 "parser_cocci_menhir.ml"
+# 20126 "parser_cocci_menhir.ml"
         ) = Obj.magic q in
         let d : 'tv_d_ident = Obj.magic d in
         let i : 'tv_pure_ident = Obj.magic i in
@@ -20132,7 +20133,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 39 "standard.mly"
     ( None )
-# 20136 "parser_cocci_menhir.ml"
+# 20137 "parser_cocci_menhir.ml"
           
         in
         let s =
@@ -20140,17 +20141,17 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 20144 "parser_cocci_menhir.ml"
+# 20145 "parser_cocci_menhir.ml"
           
         in
         
-# 1026 "parser_cocci_menhir.mly"
+# 1027 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
       !Data.add_type_name (P.id2name i);
       let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
       Ast0.wrap(Ast0.Init(s,fn idtype,id,P.clt2mcode "=" q,e,
                           P.clt2mcode ";" pv)) )
-# 20154 "parser_cocci_menhir.ml"
+# 20155 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20201,13 +20202,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20205 "parser_cocci_menhir.ml"
+# 20206 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let e : 'tv_initialize = Obj.magic e in
         let q : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20211 "parser_cocci_menhir.ml"
+# 20212 "parser_cocci_menhir.ml"
         ) = Obj.magic q in
         let d : 'tv_d_ident = Obj.magic d in
         let i : 'tv_pure_ident = Obj.magic i in
@@ -20220,7 +20221,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 20224 "parser_cocci_menhir.ml"
+# 20225 "parser_cocci_menhir.ml"
           
         in
         let s =
@@ -20228,17 +20229,17 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 20232 "parser_cocci_menhir.ml"
+# 20233 "parser_cocci_menhir.ml"
           
         in
         
-# 1026 "parser_cocci_menhir.mly"
+# 1027 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
       !Data.add_type_name (P.id2name i);
       let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
       Ast0.wrap(Ast0.Init(s,fn idtype,id,P.clt2mcode "=" q,e,
                           P.clt2mcode ";" pv)) )
-# 20242 "parser_cocci_menhir.ml"
+# 20243 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20299,34 +20300,34 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20303 "parser_cocci_menhir.ml"
+# 20304 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let rp2 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20308 "parser_cocci_menhir.ml"
+# 20309 "parser_cocci_menhir.ml"
         ) = Obj.magic rp2 in
         let p : 'tv_decl_list_name_opt_decl_ = Obj.magic p in
         let lp2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20314 "parser_cocci_menhir.ml"
+# 20315 "parser_cocci_menhir.ml"
         ) = Obj.magic lp2 in
         let rp1 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20319 "parser_cocci_menhir.ml"
+# 20320 "parser_cocci_menhir.ml"
         ) = Obj.magic rp1 in
         let d : 'tv_d_ident = Obj.magic d in
         let st : (
 # 99 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20325 "parser_cocci_menhir.ml"
+# 20326 "parser_cocci_menhir.ml"
         ) = Obj.magic st in
         let lp1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20330 "parser_cocci_menhir.ml"
+# 20331 "parser_cocci_menhir.ml"
         ) = Obj.magic lp1 in
         let t : 'tv_fn_ctype = Obj.magic t in
         let _startpos = _startpos_t_ in
@@ -20335,11 +20336,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 39 "standard.mly"
     ( None )
-# 20339 "parser_cocci_menhir.ml"
+# 20340 "parser_cocci_menhir.ml"
           
         in
         
-# 1036 "parser_cocci_menhir.mly"
+# 1037 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         let t =
          Ast0.wrap
@@ -20347,7 +20348,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
               (t,P.clt2mcode "(" lp1,P.clt2mcode "*" st,P.clt2mcode ")" rp1,
                P.clt2mcode "(" lp2,p,P.clt2mcode ")" rp2)) in
         Ast0.wrap(Ast0.UnInit(s,fn t,id,P.clt2mcode ";" pv)) )
-# 20351 "parser_cocci_menhir.ml"
+# 20352 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20413,34 +20414,34 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20417 "parser_cocci_menhir.ml"
+# 20418 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let rp2 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20422 "parser_cocci_menhir.ml"
+# 20423 "parser_cocci_menhir.ml"
         ) = Obj.magic rp2 in
         let p : 'tv_decl_list_name_opt_decl_ = Obj.magic p in
         let lp2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20428 "parser_cocci_menhir.ml"
+# 20429 "parser_cocci_menhir.ml"
         ) = Obj.magic lp2 in
         let rp1 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20433 "parser_cocci_menhir.ml"
+# 20434 "parser_cocci_menhir.ml"
         ) = Obj.magic rp1 in
         let d : 'tv_d_ident = Obj.magic d in
         let st : (
 # 99 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20439 "parser_cocci_menhir.ml"
+# 20440 "parser_cocci_menhir.ml"
         ) = Obj.magic st in
         let lp1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20444 "parser_cocci_menhir.ml"
+# 20445 "parser_cocci_menhir.ml"
         ) = Obj.magic lp1 in
         let t : 'tv_fn_ctype = Obj.magic t in
         let x0 : 'tv_storage = Obj.magic x0 in
@@ -20451,11 +20452,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 20455 "parser_cocci_menhir.ml"
+# 20456 "parser_cocci_menhir.ml"
           
         in
         
-# 1036 "parser_cocci_menhir.mly"
+# 1037 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         let t =
          Ast0.wrap
@@ -20463,7 +20464,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
               (t,P.clt2mcode "(" lp1,P.clt2mcode "*" st,P.clt2mcode ")" rp1,
                P.clt2mcode "(" lp2,p,P.clt2mcode ")" rp2)) in
         Ast0.wrap(Ast0.UnInit(s,fn t,id,P.clt2mcode ";" pv)) )
-# 20467 "parser_cocci_menhir.ml"
+# 20468 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20504,27 +20505,27 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _5 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20508 "parser_cocci_menhir.ml"
+# 20509 "parser_cocci_menhir.ml"
         ) = Obj.magic _5 in
         let _4 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20513 "parser_cocci_menhir.ml"
+# 20514 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr_list_option = Obj.magic _3 in
         let _2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20519 "parser_cocci_menhir.ml"
+# 20520 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_decl_ident = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__5_ in
         let _v : 'tv_one_decl_var = 
-# 1044 "parser_cocci_menhir.mly"
+# 1045 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.MacroDecl(_1,P.clt2mcode "(" _2,_3,
                                  P.clt2mcode ")" _4,P.clt2mcode ";" _5)) )
-# 20528 "parser_cocci_menhir.ml"
+# 20529 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20595,40 +20596,40 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20599 "parser_cocci_menhir.ml"
+# 20600 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let e : 'tv_initialize = Obj.magic e in
         let q : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20605 "parser_cocci_menhir.ml"
+# 20606 "parser_cocci_menhir.ml"
         ) = Obj.magic q in
         let rp2 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20610 "parser_cocci_menhir.ml"
+# 20611 "parser_cocci_menhir.ml"
         ) = Obj.magic rp2 in
         let p : 'tv_decl_list_name_opt_decl_ = Obj.magic p in
         let lp2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20616 "parser_cocci_menhir.ml"
+# 20617 "parser_cocci_menhir.ml"
         ) = Obj.magic lp2 in
         let rp1 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20621 "parser_cocci_menhir.ml"
+# 20622 "parser_cocci_menhir.ml"
         ) = Obj.magic rp1 in
         let d : 'tv_d_ident = Obj.magic d in
         let st : (
 # 99 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20627 "parser_cocci_menhir.ml"
+# 20628 "parser_cocci_menhir.ml"
         ) = Obj.magic st in
         let lp1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20632 "parser_cocci_menhir.ml"
+# 20633 "parser_cocci_menhir.ml"
         ) = Obj.magic lp1 in
         let t : 'tv_fn_ctype = Obj.magic t in
         let _startpos = _startpos_t_ in
@@ -20637,11 +20638,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 39 "standard.mly"
     ( None )
-# 20641 "parser_cocci_menhir.ml"
+# 20642 "parser_cocci_menhir.ml"
           
         in
         
-# 1050 "parser_cocci_menhir.mly"
+# 1051 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         let t =
          Ast0.wrap
@@ -20649,7 +20650,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
               (t,P.clt2mcode "(" lp1,P.clt2mcode "*" st,P.clt2mcode ")" rp1,
                P.clt2mcode "(" lp2,p,P.clt2mcode ")" rp2)) in
       Ast0.wrap(Ast0.Init(s,fn t,id,P.clt2mcode "=" q,e,P.clt2mcode ";" pv)))
-# 20653 "parser_cocci_menhir.ml"
+# 20654 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20725,40 +20726,40 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20729 "parser_cocci_menhir.ml"
+# 20730 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let e : 'tv_initialize = Obj.magic e in
         let q : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20735 "parser_cocci_menhir.ml"
+# 20736 "parser_cocci_menhir.ml"
         ) = Obj.magic q in
         let rp2 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20740 "parser_cocci_menhir.ml"
+# 20741 "parser_cocci_menhir.ml"
         ) = Obj.magic rp2 in
         let p : 'tv_decl_list_name_opt_decl_ = Obj.magic p in
         let lp2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20746 "parser_cocci_menhir.ml"
+# 20747 "parser_cocci_menhir.ml"
         ) = Obj.magic lp2 in
         let rp1 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20751 "parser_cocci_menhir.ml"
+# 20752 "parser_cocci_menhir.ml"
         ) = Obj.magic rp1 in
         let d : 'tv_d_ident = Obj.magic d in
         let st : (
 # 99 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20757 "parser_cocci_menhir.ml"
+# 20758 "parser_cocci_menhir.ml"
         ) = Obj.magic st in
         let lp1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 20762 "parser_cocci_menhir.ml"
+# 20763 "parser_cocci_menhir.ml"
         ) = Obj.magic lp1 in
         let t : 'tv_fn_ctype = Obj.magic t in
         let x0 : 'tv_storage = Obj.magic x0 in
@@ -20769,11 +20770,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 20773 "parser_cocci_menhir.ml"
+# 20774 "parser_cocci_menhir.ml"
           
         in
         
-# 1050 "parser_cocci_menhir.mly"
+# 1051 "parser_cocci_menhir.mly"
       ( let (id,fn) = d in
         let t =
          Ast0.wrap
@@ -20781,7 +20782,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
               (t,P.clt2mcode "(" lp1,P.clt2mcode "*" st,P.clt2mcode ")" rp1,
                P.clt2mcode "(" lp2,p,P.clt2mcode ")" rp2)) in
       Ast0.wrap(Ast0.Init(s,fn t,id,P.clt2mcode "=" q,e,P.clt2mcode ";" pv)))
-# 20785 "parser_cocci_menhir.ml"
+# 20786 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20798,7 +20799,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_option_TLocal_ = 
 # 29 "standard.mly"
     ( None )
-# 20802 "parser_cocci_menhir.ml"
+# 20803 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20822,7 +20823,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_option_TLocal_ = 
 # 31 "standard.mly"
     ( Some x )
-# 20826 "parser_cocci_menhir.ml"
+# 20827 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20839,7 +20840,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_option_TPosAny_ = 
 # 29 "standard.mly"
     ( None )
-# 20843 "parser_cocci_menhir.ml"
+# 20844 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20863,7 +20864,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_option_TPosAny_ = 
 # 31 "standard.mly"
     ( Some x )
-# 20867 "parser_cocci_menhir.ml"
+# 20868 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20880,7 +20881,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_option_eexpr_ = 
 # 29 "standard.mly"
     ( None )
-# 20884 "parser_cocci_menhir.ml"
+# 20885 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20904,7 +20905,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_option_eexpr_ = 
 # 31 "standard.mly"
     ( Some x )
-# 20908 "parser_cocci_menhir.ml"
+# 20909 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20919,9 +20920,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_plus_after_dots = 
-# 1673 "parser_cocci_menhir.mly"
+# 1674 "parser_cocci_menhir.mly"
                                                                          ([])
-# 20925 "parser_cocci_menhir.ml"
+# 20926 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20947,9 +20948,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_plus_after_dots = 
-# 1674 "parser_cocci_menhir.mly"
+# 1675 "parser_cocci_menhir.mly"
                                                                          (_2)
-# 20953 "parser_cocci_menhir.ml"
+# 20954 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -20977,9 +20978,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_plus_after_dots = 
-# 1676 "parser_cocci_menhir.mly"
+# 1677 "parser_cocci_menhir.mly"
                      ( (Ast0.wrap(Ast0.OTHER(Ast0.wrap(Ast0.Exp(_1)))))::_2 )
-# 20983 "parser_cocci_menhir.ml"
+# 20984 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21007,9 +21008,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_plus_after_dots = 
-# 1677 "parser_cocci_menhir.mly"
+# 1678 "parser_cocci_menhir.mly"
                                              ( Ast0.wrap(Ast0.DECL(_1))::_2 )
-# 21013 "parser_cocci_menhir.ml"
+# 21014 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21037,9 +21038,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_plus_after_dots = 
-# 1679 "parser_cocci_menhir.mly"
+# 1680 "parser_cocci_menhir.mly"
                 ( (List.map (function x -> Ast0.wrap(Ast0.OTHER(x))) _1)@_2 )
-# 21043 "parser_cocci_menhir.ml"
+# 21044 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21054,9 +21055,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_plus_after_exp = 
-# 1669 "parser_cocci_menhir.mly"
+# 1670 "parser_cocci_menhir.mly"
                                                                          ([])
-# 21060 "parser_cocci_menhir.ml"
+# 21061 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21084,9 +21085,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_plus_after_exp = 
-# 1670 "parser_cocci_menhir.mly"
+# 1671 "parser_cocci_menhir.mly"
                                           ( (Ast0.wrap(Ast0.OTHER(_1)))::_2 )
-# 21090 "parser_cocci_menhir.ml"
+# 21091 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21101,9 +21102,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_plus_after_stm = 
-# 1682 "parser_cocci_menhir.mly"
+# 1683 "parser_cocci_menhir.mly"
                                                                          ([])
-# 21107 "parser_cocci_menhir.ml"
+# 21108 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21131,9 +21132,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_plus_after_stm = 
-# 1683 "parser_cocci_menhir.mly"
+# 1684 "parser_cocci_menhir.mly"
                                           ( (Ast0.wrap(Ast0.OTHER(_1)))::_2 )
-# 21137 "parser_cocci_menhir.ml"
+# 21138 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21161,9 +21162,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_plus_after_stm = 
-# 1684 "parser_cocci_menhir.mly"
+# 1685 "parser_cocci_menhir.mly"
                                              ( Ast0.wrap(Ast0.DECL(_1))::_2 )
-# 21167 "parser_cocci_menhir.ml"
+# 21168 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21191,9 +21192,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_plus_after_stm = 
-# 1686 "parser_cocci_menhir.mly"
+# 1687 "parser_cocci_menhir.mly"
                 ( (List.map (function x -> Ast0.wrap(Ast0.OTHER(x))) _1)@_2 )
-# 21197 "parser_cocci_menhir.ml"
+# 21198 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21229,7 +21230,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_plus_body = 
 # 614 "parser_cocci_menhir.mly"
     ( Top_level.top_level (f@b@ew) )
-# 21233 "parser_cocci_menhir.ml"
+# 21234 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21265,7 +21266,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_plus_exp_body = 
 # 628 "parser_cocci_menhir.mly"
     ( Top_level.top_level (f@[b]@ew) )
-# 21269 "parser_cocci_menhir.ml"
+# 21270 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21293,11 +21294,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 143 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 21297 "parser_cocci_menhir.ml"
+# 21298 "parser_cocci_menhir.ml"
         ) = 
 # 179 "parser_cocci_menhir.mly"
                                  ( _1 )
-# 21301 "parser_cocci_menhir.ml"
+# 21302 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21325,11 +21326,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 143 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 21329 "parser_cocci_menhir.ml"
+# 21330 "parser_cocci_menhir.ml"
         ) = 
 # 179 "parser_cocci_menhir.mly"
                                                                     ( p )
-# 21333 "parser_cocci_menhir.ml"
+# 21334 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21357,11 +21358,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 143 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 21361 "parser_cocci_menhir.ml"
+# 21362 "parser_cocci_menhir.ml"
         ) = 
 # 180 "parser_cocci_menhir.mly"
                         ( p )
-# 21365 "parser_cocci_menhir.ml"
+# 21366 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21389,11 +21390,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 140 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 21393 "parser_cocci_menhir.ml"
+# 21394 "parser_cocci_menhir.ml"
         ) = 
 # 175 "parser_cocci_menhir.mly"
                          ( _1 )
-# 21397 "parser_cocci_menhir.ml"
+# 21398 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21421,11 +21422,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 140 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 21425 "parser_cocci_menhir.ml"
+# 21426 "parser_cocci_menhir.ml"
         ) = 
 # 175 "parser_cocci_menhir.mly"
                                                         ( p )
-# 21429 "parser_cocci_menhir.ml"
+# 21430 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21453,11 +21454,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 140 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 21457 "parser_cocci_menhir.ml"
+# 21458 "parser_cocci_menhir.ml"
         ) = 
 # 176 "parser_cocci_menhir.mly"
                     ( p )
-# 21461 "parser_cocci_menhir.ml"
+# 21462 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21479,9 +21480,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_plus_start = 
-# 1658 "parser_cocci_menhir.mly"
+# 1659 "parser_cocci_menhir.mly"
                           ( [Ast0.wrap(Ast0.OTHER(Ast0.wrap(Ast0.Ty(_1))))] )
-# 21485 "parser_cocci_menhir.ml"
+# 21486 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21503,9 +21504,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_plus_start = 
-# 1659 "parser_cocci_menhir.mly"
+# 1660 "parser_cocci_menhir.mly"
                      ( [Ast0.wrap(Ast0.OTHER(Ast0.wrap(Ast0.TopInit(_1))))] )
-# 21509 "parser_cocci_menhir.ml"
+# 21510 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21533,9 +21534,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_plus_start = 
-# 1661 "parser_cocci_menhir.mly"
+# 1662 "parser_cocci_menhir.mly"
                                           ( (Ast0.wrap(Ast0.OTHER(_1)))::_2 )
-# 21539 "parser_cocci_menhir.ml"
+# 21540 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21563,9 +21564,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_plus_start = 
-# 1663 "parser_cocci_menhir.mly"
+# 1664 "parser_cocci_menhir.mly"
                      ( (Ast0.wrap(Ast0.OTHER(Ast0.wrap(Ast0.Exp(_1)))))::_2 )
-# 21569 "parser_cocci_menhir.ml"
+# 21570 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21593,9 +21594,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_plus_start = 
-# 1664 "parser_cocci_menhir.mly"
+# 1665 "parser_cocci_menhir.mly"
                                              ( Ast0.wrap(Ast0.DECL(_1))::_2 )
-# 21599 "parser_cocci_menhir.ml"
+# 21600 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21623,9 +21624,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_plus_start = 
-# 1666 "parser_cocci_menhir.mly"
+# 1667 "parser_cocci_menhir.mly"
                 ( (List.map (function x -> Ast0.wrap(Ast0.OTHER(x))) _1)@_2 )
-# 21629 "parser_cocci_menhir.ml"
+# 21630 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21646,14 +21647,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 47 "parser_cocci_menhir.mly"
       (string)
-# 21650 "parser_cocci_menhir.ml"
+# 21651 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_pnrule = 
 # 230 "parser_cocci_menhir.mly"
                    ( Ast.Dep      _1 )
-# 21657 "parser_cocci_menhir.ml"
+# 21658 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21678,14 +21679,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 47 "parser_cocci_menhir.mly"
       (string)
-# 21682 "parser_cocci_menhir.ml"
+# 21683 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_pnrule = 
 # 231 "parser_cocci_menhir.mly"
                    ( Ast.AntiDep  _2 )
-# 21689 "parser_cocci_menhir.ml"
+# 21690 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21710,14 +21711,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 47 "parser_cocci_menhir.mly"
       (string)
-# 21714 "parser_cocci_menhir.ml"
+# 21715 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_pnrule = 
 # 232 "parser_cocci_menhir.mly"
                    ( Ast.EverDep  _2 )
-# 21721 "parser_cocci_menhir.ml"
+# 21722 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21742,14 +21743,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 47 "parser_cocci_menhir.mly"
       (string)
-# 21746 "parser_cocci_menhir.ml"
+# 21747 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_pnrule = 
 # 233 "parser_cocci_menhir.mly"
                    ( Ast.NeverDep _2 )
-# 21753 "parser_cocci_menhir.ml"
+# 21754 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21781,7 +21782,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_pnrule = 
 # 234 "parser_cocci_menhir.mly"
                    ( _2 )
-# 21785 "parser_cocci_menhir.ml"
+# 21786 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21803,9 +21804,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_postfix_expr_eexpr_dot_expressions_ = 
-# 1322 "parser_cocci_menhir.mly"
+# 1323 "parser_cocci_menhir.mly"
                                                  ( _1 )
-# 21809 "parser_cocci_menhir.ml"
+# 21810 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21841,22 +21842,22 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _4 : (
 # 102 "parser_cocci_menhir.mly"
        (Data.clt)
-# 21845 "parser_cocci_menhir.ml"
+# 21846 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr = Obj.magic _3 in
         let _2 : (
 # 102 "parser_cocci_menhir.mly"
        (Data.clt)
-# 21851 "parser_cocci_menhir.ml"
+# 21852 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_dot_expressions_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
         let _v : 'tv_postfix_expr_eexpr_dot_expressions_ = 
-# 1324 "parser_cocci_menhir.mly"
+# 1325 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.ArrayAccess (_1,P.clt2mcode "[" _2,_3,
                                       P.clt2mcode "]" _4)) )
-# 21860 "parser_cocci_menhir.ml"
+# 21861 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21888,15 +21889,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 21892 "parser_cocci_menhir.ml"
+# 21893 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_dot_expressions_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_postfix_expr_eexpr_dot_expressions_ = 
-# 1327 "parser_cocci_menhir.mly"
+# 1328 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.RecordAccess(_1, P.clt2mcode "." _2, _3)) )
-# 21900 "parser_cocci_menhir.ml"
+# 21901 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21928,16 +21929,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 104 "parser_cocci_menhir.mly"
        (Data.clt)
-# 21932 "parser_cocci_menhir.ml"
+# 21933 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_dot_expressions_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_postfix_expr_eexpr_dot_expressions_ = 
-# 1329 "parser_cocci_menhir.mly"
+# 1330 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.RecordPtAccess(_1, P.clt2mcode "->" _2,
                                     _3)) )
-# 21941 "parser_cocci_menhir.ml"
+# 21942 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21963,15 +21964,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 21967 "parser_cocci_menhir.ml"
+# 21968 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_dot_expressions_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_postfix_expr_eexpr_dot_expressions_ = 
-# 1332 "parser_cocci_menhir.mly"
+# 1333 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.Postfix (_1, P.clt2mcode Ast.Inc _2)) )
-# 21975 "parser_cocci_menhir.ml"
+# 21976 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -21997,15 +21998,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22001 "parser_cocci_menhir.ml"
+# 22002 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_dot_expressions_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_postfix_expr_eexpr_dot_expressions_ = 
-# 1334 "parser_cocci_menhir.mly"
+# 1335 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.Postfix (_1, P.clt2mcode Ast.Dec _2)) )
-# 22009 "parser_cocci_menhir.ml"
+# 22010 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22041,23 +22042,23 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _4 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22045 "parser_cocci_menhir.ml"
+# 22046 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr_list_option = Obj.magic _3 in
         let _2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22051 "parser_cocci_menhir.ml"
+# 22052 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_dot_expressions_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
         let _v : 'tv_postfix_expr_eexpr_dot_expressions_ = 
-# 1336 "parser_cocci_menhir.mly"
+# 1337 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.FunCall(_1,P.clt2mcode "(" _2,
                              _3,
                              P.clt2mcode ")" _4)) )
-# 22061 "parser_cocci_menhir.ml"
+# 22062 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22079,9 +22080,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_postfix_expr_eexpr_invalid_ = 
-# 1322 "parser_cocci_menhir.mly"
+# 1323 "parser_cocci_menhir.mly"
                                                  ( _1 )
-# 22085 "parser_cocci_menhir.ml"
+# 22086 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22117,22 +22118,22 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _4 : (
 # 102 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22121 "parser_cocci_menhir.ml"
+# 22122 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr = Obj.magic _3 in
         let _2 : (
 # 102 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22127 "parser_cocci_menhir.ml"
+# 22128 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_invalid_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
         let _v : 'tv_postfix_expr_eexpr_invalid_ = 
-# 1324 "parser_cocci_menhir.mly"
+# 1325 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.ArrayAccess (_1,P.clt2mcode "[" _2,_3,
                                       P.clt2mcode "]" _4)) )
-# 22136 "parser_cocci_menhir.ml"
+# 22137 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22164,15 +22165,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22168 "parser_cocci_menhir.ml"
+# 22169 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_invalid_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_postfix_expr_eexpr_invalid_ = 
-# 1327 "parser_cocci_menhir.mly"
+# 1328 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.RecordAccess(_1, P.clt2mcode "." _2, _3)) )
-# 22176 "parser_cocci_menhir.ml"
+# 22177 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22204,16 +22205,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 104 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22208 "parser_cocci_menhir.ml"
+# 22209 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_invalid_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_postfix_expr_eexpr_invalid_ = 
-# 1329 "parser_cocci_menhir.mly"
+# 1330 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.RecordPtAccess(_1, P.clt2mcode "->" _2,
                                     _3)) )
-# 22217 "parser_cocci_menhir.ml"
+# 22218 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22239,15 +22240,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22243 "parser_cocci_menhir.ml"
+# 22244 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_invalid_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_postfix_expr_eexpr_invalid_ = 
-# 1332 "parser_cocci_menhir.mly"
+# 1333 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.Postfix (_1, P.clt2mcode Ast.Inc _2)) )
-# 22251 "parser_cocci_menhir.ml"
+# 22252 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22273,15 +22274,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22277 "parser_cocci_menhir.ml"
+# 22278 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_invalid_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_postfix_expr_eexpr_invalid_ = 
-# 1334 "parser_cocci_menhir.mly"
+# 1335 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.Postfix (_1, P.clt2mcode Ast.Dec _2)) )
-# 22285 "parser_cocci_menhir.ml"
+# 22286 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22317,23 +22318,23 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _4 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22321 "parser_cocci_menhir.ml"
+# 22322 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr_list_option = Obj.magic _3 in
         let _2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22327 "parser_cocci_menhir.ml"
+# 22328 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_invalid_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
         let _v : 'tv_postfix_expr_eexpr_invalid_ = 
-# 1336 "parser_cocci_menhir.mly"
+# 1337 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.FunCall(_1,P.clt2mcode "(" _2,
                              _3,
                              P.clt2mcode ")" _4)) )
-# 22337 "parser_cocci_menhir.ml"
+# 22338 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22355,9 +22356,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_postfix_expr_eexpr_nest_expressions_ = 
-# 1322 "parser_cocci_menhir.mly"
+# 1323 "parser_cocci_menhir.mly"
                                                  ( _1 )
-# 22361 "parser_cocci_menhir.ml"
+# 22362 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22393,22 +22394,22 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _4 : (
 # 102 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22397 "parser_cocci_menhir.ml"
+# 22398 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr = Obj.magic _3 in
         let _2 : (
 # 102 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22403 "parser_cocci_menhir.ml"
+# 22404 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_nest_expressions_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
         let _v : 'tv_postfix_expr_eexpr_nest_expressions_ = 
-# 1324 "parser_cocci_menhir.mly"
+# 1325 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.ArrayAccess (_1,P.clt2mcode "[" _2,_3,
                                       P.clt2mcode "]" _4)) )
-# 22412 "parser_cocci_menhir.ml"
+# 22413 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22440,15 +22441,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22444 "parser_cocci_menhir.ml"
+# 22445 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_nest_expressions_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_postfix_expr_eexpr_nest_expressions_ = 
-# 1327 "parser_cocci_menhir.mly"
+# 1328 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.RecordAccess(_1, P.clt2mcode "." _2, _3)) )
-# 22452 "parser_cocci_menhir.ml"
+# 22453 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22480,16 +22481,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 104 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22484 "parser_cocci_menhir.ml"
+# 22485 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_nest_expressions_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_postfix_expr_eexpr_nest_expressions_ = 
-# 1329 "parser_cocci_menhir.mly"
+# 1330 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.RecordPtAccess(_1, P.clt2mcode "->" _2,
                                     _3)) )
-# 22493 "parser_cocci_menhir.ml"
+# 22494 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22515,15 +22516,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22519 "parser_cocci_menhir.ml"
+# 22520 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_nest_expressions_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_postfix_expr_eexpr_nest_expressions_ = 
-# 1332 "parser_cocci_menhir.mly"
+# 1333 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.Postfix (_1, P.clt2mcode Ast.Inc _2)) )
-# 22527 "parser_cocci_menhir.ml"
+# 22528 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22549,15 +22550,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22553 "parser_cocci_menhir.ml"
+# 22554 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_nest_expressions_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_postfix_expr_eexpr_nest_expressions_ = 
-# 1334 "parser_cocci_menhir.mly"
+# 1335 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.Postfix (_1, P.clt2mcode Ast.Dec _2)) )
-# 22561 "parser_cocci_menhir.ml"
+# 22562 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22593,23 +22594,23 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _4 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22597 "parser_cocci_menhir.ml"
+# 22598 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr_list_option = Obj.magic _3 in
         let _2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22603 "parser_cocci_menhir.ml"
+# 22604 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_eexpr_nest_expressions_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
         let _v : 'tv_postfix_expr_eexpr_nest_expressions_ = 
-# 1336 "parser_cocci_menhir.mly"
+# 1337 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.FunCall(_1,P.clt2mcode "(" _2,
                              _3,
                              P.clt2mcode ")" _4)) )
-# 22613 "parser_cocci_menhir.ml"
+# 22614 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22631,9 +22632,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_postfix_expr_expr_invalid_ = 
-# 1322 "parser_cocci_menhir.mly"
+# 1323 "parser_cocci_menhir.mly"
                                                  ( _1 )
-# 22637 "parser_cocci_menhir.ml"
+# 22638 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22669,22 +22670,22 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _4 : (
 # 102 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22673 "parser_cocci_menhir.ml"
+# 22674 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr = Obj.magic _3 in
         let _2 : (
 # 102 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22679 "parser_cocci_menhir.ml"
+# 22680 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_expr_invalid_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
         let _v : 'tv_postfix_expr_expr_invalid_ = 
-# 1324 "parser_cocci_menhir.mly"
+# 1325 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.ArrayAccess (_1,P.clt2mcode "[" _2,_3,
                                       P.clt2mcode "]" _4)) )
-# 22688 "parser_cocci_menhir.ml"
+# 22689 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22716,15 +22717,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22720 "parser_cocci_menhir.ml"
+# 22721 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_expr_invalid_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_postfix_expr_expr_invalid_ = 
-# 1327 "parser_cocci_menhir.mly"
+# 1328 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.RecordAccess(_1, P.clt2mcode "." _2, _3)) )
-# 22728 "parser_cocci_menhir.ml"
+# 22729 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22756,16 +22757,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 104 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22760 "parser_cocci_menhir.ml"
+# 22761 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_expr_invalid_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_postfix_expr_expr_invalid_ = 
-# 1329 "parser_cocci_menhir.mly"
+# 1330 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.RecordPtAccess(_1, P.clt2mcode "->" _2,
                                     _3)) )
-# 22769 "parser_cocci_menhir.ml"
+# 22770 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22791,15 +22792,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22795 "parser_cocci_menhir.ml"
+# 22796 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_expr_invalid_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_postfix_expr_expr_invalid_ = 
-# 1332 "parser_cocci_menhir.mly"
+# 1333 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.Postfix (_1, P.clt2mcode Ast.Inc _2)) )
-# 22803 "parser_cocci_menhir.ml"
+# 22804 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22825,15 +22826,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22829 "parser_cocci_menhir.ml"
+# 22830 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_expr_invalid_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_postfix_expr_expr_invalid_ = 
-# 1334 "parser_cocci_menhir.mly"
+# 1335 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.Postfix (_1, P.clt2mcode Ast.Dec _2)) )
-# 22837 "parser_cocci_menhir.ml"
+# 22838 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22869,23 +22870,23 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _4 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22873 "parser_cocci_menhir.ml"
+# 22874 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr_list_option = Obj.magic _3 in
         let _2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 22879 "parser_cocci_menhir.ml"
+# 22880 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_postfix_expr_expr_invalid_ = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
         let _v : 'tv_postfix_expr_expr_invalid_ = 
-# 1336 "parser_cocci_menhir.mly"
+# 1337 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.FunCall(_1,P.clt2mcode "(" _2,
                              _3,
                              P.clt2mcode ")" _4)) )
-# 22889 "parser_cocci_menhir.ml"
+# 22890 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22907,9 +22908,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_dot_expressions_ = 
-# 1341 "parser_cocci_menhir.mly"
+# 1342 "parser_cocci_menhir.mly"
                 ( Ast0.wrap(Ast0.Ident(_1)) )
-# 22913 "parser_cocci_menhir.ml"
+# 22914 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22930,15 +22931,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 22934 "parser_cocci_menhir.ml"
+# 22935 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_dot_expressions_ = 
-# 1343 "parser_cocci_menhir.mly"
+# 1344 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.Int x) clt)) )
-# 22942 "parser_cocci_menhir.ml"
+# 22943 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22959,15 +22960,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 22963 "parser_cocci_menhir.ml"
+# 22964 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_dot_expressions_ = 
-# 1346 "parser_cocci_menhir.mly"
+# 1347 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.Float x) clt)) )
-# 22971 "parser_cocci_menhir.ml"
+# 22972 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -22988,15 +22989,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 22992 "parser_cocci_menhir.ml"
+# 22993 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_dot_expressions_ = 
-# 1349 "parser_cocci_menhir.mly"
+# 1350 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.String x) clt)) )
-# 23000 "parser_cocci_menhir.ml"
+# 23001 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23017,15 +23018,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 23021 "parser_cocci_menhir.ml"
+# 23022 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_dot_expressions_ = 
-# 1352 "parser_cocci_menhir.mly"
+# 1353 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.Char x) clt)) )
-# 23029 "parser_cocci_menhir.ml"
+# 23030 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23046,16 +23047,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 23050 "parser_cocci_menhir.ml"
+# 23051 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_dot_expressions_ = 
-# 1355 "parser_cocci_menhir.mly"
+# 1356 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.CONST,pure)) )
-# 23059 "parser_cocci_menhir.ml"
+# 23060 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23076,15 +23077,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 63 "parser_cocci_menhir.mly"
        (Parse_aux.expinfo)
-# 23080 "parser_cocci_menhir.ml"
+# 23081 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_dot_expressions_ = 
-# 1359 "parser_cocci_menhir.mly"
+# 1360 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,clt) = _1 in
      Ast0.wrap(Ast0.MetaErr(P.clt2mcode nm clt,constraints,pure)) )
-# 23088 "parser_cocci_menhir.ml"
+# 23089 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23105,16 +23106,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 23109 "parser_cocci_menhir.ml"
+# 23110 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_dot_expressions_ = 
-# 1362 "parser_cocci_menhir.mly"
+# 1363 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.ANY,pure)) )
-# 23118 "parser_cocci_menhir.ml"
+# 23119 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23135,16 +23136,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 23139 "parser_cocci_menhir.ml"
+# 23140 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_dot_expressions_ = 
-# 1366 "parser_cocci_menhir.mly"
+# 1367 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.ID,pure)) )
-# 23148 "parser_cocci_menhir.ml"
+# 23149 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23165,16 +23166,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 23169 "parser_cocci_menhir.ml"
+# 23170 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_dot_expressions_ = 
-# 1370 "parser_cocci_menhir.mly"
+# 1371 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.LocalID,pure)) )
-# 23178 "parser_cocci_menhir.ml"
+# 23179 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23205,21 +23206,21 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 23209 "parser_cocci_menhir.ml"
+# 23210 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_eexpr = Obj.magic _2 in
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 23215 "parser_cocci_menhir.ml"
+# 23216 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_primary_expr_eexpr_dot_expressions_ = 
-# 1374 "parser_cocci_menhir.mly"
+# 1375 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.Paren(P.clt2mcode "(" _1,_2,
                            P.clt2mcode ")" _3)) )
-# 23223 "parser_cocci_menhir.ml"
+# 23224 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23250,23 +23251,23 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 23254 "parser_cocci_menhir.ml"
+# 23255 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_midzero_list_eexpr_eexpr_ = Obj.magic _2 in
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 23260 "parser_cocci_menhir.ml"
+# 23261 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_primary_expr_eexpr_dot_expressions_ = 
-# 1377 "parser_cocci_menhir.mly"
+# 1378 "parser_cocci_menhir.mly"
      ( let (mids,code) = _2 in
        Ast0.wrap(Ast0.DisjExpr(P.clt2mcode "(" _1,
                               code, mids,
                               P.clt2mcode ")" _3)) )
-# 23270 "parser_cocci_menhir.ml"
+# 23271 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23288,9 +23289,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_dot_expressions_ = 
-# 1381 "parser_cocci_menhir.mly"
+# 1382 "parser_cocci_menhir.mly"
                  ( _1 )
-# 23294 "parser_cocci_menhir.ml"
+# 23295 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23312,9 +23313,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_invalid_ = 
-# 1341 "parser_cocci_menhir.mly"
+# 1342 "parser_cocci_menhir.mly"
                 ( Ast0.wrap(Ast0.Ident(_1)) )
-# 23318 "parser_cocci_menhir.ml"
+# 23319 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23335,15 +23336,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 23339 "parser_cocci_menhir.ml"
+# 23340 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_invalid_ = 
-# 1343 "parser_cocci_menhir.mly"
+# 1344 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.Int x) clt)) )
-# 23347 "parser_cocci_menhir.ml"
+# 23348 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23364,15 +23365,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 23368 "parser_cocci_menhir.ml"
+# 23369 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_invalid_ = 
-# 1346 "parser_cocci_menhir.mly"
+# 1347 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.Float x) clt)) )
-# 23376 "parser_cocci_menhir.ml"
+# 23377 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23393,15 +23394,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 23397 "parser_cocci_menhir.ml"
+# 23398 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_invalid_ = 
-# 1349 "parser_cocci_menhir.mly"
+# 1350 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.String x) clt)) )
-# 23405 "parser_cocci_menhir.ml"
+# 23406 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23422,15 +23423,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 23426 "parser_cocci_menhir.ml"
+# 23427 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_invalid_ = 
-# 1352 "parser_cocci_menhir.mly"
+# 1353 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.Char x) clt)) )
-# 23434 "parser_cocci_menhir.ml"
+# 23435 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23451,16 +23452,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 23455 "parser_cocci_menhir.ml"
+# 23456 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_invalid_ = 
-# 1355 "parser_cocci_menhir.mly"
+# 1356 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.CONST,pure)) )
-# 23464 "parser_cocci_menhir.ml"
+# 23465 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23481,15 +23482,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 63 "parser_cocci_menhir.mly"
        (Parse_aux.expinfo)
-# 23485 "parser_cocci_menhir.ml"
+# 23486 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_invalid_ = 
-# 1359 "parser_cocci_menhir.mly"
+# 1360 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,clt) = _1 in
      Ast0.wrap(Ast0.MetaErr(P.clt2mcode nm clt,constraints,pure)) )
-# 23493 "parser_cocci_menhir.ml"
+# 23494 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23510,16 +23511,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 23514 "parser_cocci_menhir.ml"
+# 23515 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_invalid_ = 
-# 1362 "parser_cocci_menhir.mly"
+# 1363 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.ANY,pure)) )
-# 23523 "parser_cocci_menhir.ml"
+# 23524 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23540,16 +23541,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 23544 "parser_cocci_menhir.ml"
+# 23545 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_invalid_ = 
-# 1366 "parser_cocci_menhir.mly"
+# 1367 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.ID,pure)) )
-# 23553 "parser_cocci_menhir.ml"
+# 23554 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23570,16 +23571,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 23574 "parser_cocci_menhir.ml"
+# 23575 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_invalid_ = 
-# 1370 "parser_cocci_menhir.mly"
+# 1371 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.LocalID,pure)) )
-# 23583 "parser_cocci_menhir.ml"
+# 23584 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23610,21 +23611,21 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 23614 "parser_cocci_menhir.ml"
+# 23615 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_eexpr = Obj.magic _2 in
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 23620 "parser_cocci_menhir.ml"
+# 23621 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_primary_expr_eexpr_invalid_ = 
-# 1374 "parser_cocci_menhir.mly"
+# 1375 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.Paren(P.clt2mcode "(" _1,_2,
                            P.clt2mcode ")" _3)) )
-# 23628 "parser_cocci_menhir.ml"
+# 23629 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23655,23 +23656,23 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 23659 "parser_cocci_menhir.ml"
+# 23660 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_midzero_list_eexpr_eexpr_ = Obj.magic _2 in
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 23665 "parser_cocci_menhir.ml"
+# 23666 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_primary_expr_eexpr_invalid_ = 
-# 1377 "parser_cocci_menhir.mly"
+# 1378 "parser_cocci_menhir.mly"
      ( let (mids,code) = _2 in
        Ast0.wrap(Ast0.DisjExpr(P.clt2mcode "(" _1,
                               code, mids,
                               P.clt2mcode ")" _3)) )
-# 23675 "parser_cocci_menhir.ml"
+# 23676 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23693,9 +23694,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_invalid_ = 
-# 1381 "parser_cocci_menhir.mly"
+# 1382 "parser_cocci_menhir.mly"
                  ( _1 )
-# 23699 "parser_cocci_menhir.ml"
+# 23700 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23717,9 +23718,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_nest_expressions_ = 
-# 1341 "parser_cocci_menhir.mly"
+# 1342 "parser_cocci_menhir.mly"
                 ( Ast0.wrap(Ast0.Ident(_1)) )
-# 23723 "parser_cocci_menhir.ml"
+# 23724 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23740,15 +23741,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 23744 "parser_cocci_menhir.ml"
+# 23745 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_nest_expressions_ = 
-# 1343 "parser_cocci_menhir.mly"
+# 1344 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.Int x) clt)) )
-# 23752 "parser_cocci_menhir.ml"
+# 23753 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23769,15 +23770,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 23773 "parser_cocci_menhir.ml"
+# 23774 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_nest_expressions_ = 
-# 1346 "parser_cocci_menhir.mly"
+# 1347 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.Float x) clt)) )
-# 23781 "parser_cocci_menhir.ml"
+# 23782 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23798,15 +23799,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 23802 "parser_cocci_menhir.ml"
+# 23803 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_nest_expressions_ = 
-# 1349 "parser_cocci_menhir.mly"
+# 1350 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.String x) clt)) )
-# 23810 "parser_cocci_menhir.ml"
+# 23811 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23827,15 +23828,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 23831 "parser_cocci_menhir.ml"
+# 23832 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_nest_expressions_ = 
-# 1352 "parser_cocci_menhir.mly"
+# 1353 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.Char x) clt)) )
-# 23839 "parser_cocci_menhir.ml"
+# 23840 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23856,16 +23857,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 23860 "parser_cocci_menhir.ml"
+# 23861 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_nest_expressions_ = 
-# 1355 "parser_cocci_menhir.mly"
+# 1356 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.CONST,pure)) )
-# 23869 "parser_cocci_menhir.ml"
+# 23870 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23886,15 +23887,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 63 "parser_cocci_menhir.mly"
        (Parse_aux.expinfo)
-# 23890 "parser_cocci_menhir.ml"
+# 23891 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_nest_expressions_ = 
-# 1359 "parser_cocci_menhir.mly"
+# 1360 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,clt) = _1 in
      Ast0.wrap(Ast0.MetaErr(P.clt2mcode nm clt,constraints,pure)) )
-# 23898 "parser_cocci_menhir.ml"
+# 23899 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23915,16 +23916,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 23919 "parser_cocci_menhir.ml"
+# 23920 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_nest_expressions_ = 
-# 1362 "parser_cocci_menhir.mly"
+# 1363 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.ANY,pure)) )
-# 23928 "parser_cocci_menhir.ml"
+# 23929 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23945,16 +23946,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 23949 "parser_cocci_menhir.ml"
+# 23950 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_nest_expressions_ = 
-# 1366 "parser_cocci_menhir.mly"
+# 1367 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.ID,pure)) )
-# 23958 "parser_cocci_menhir.ml"
+# 23959 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -23975,16 +23976,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 23979 "parser_cocci_menhir.ml"
+# 23980 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_nest_expressions_ = 
-# 1370 "parser_cocci_menhir.mly"
+# 1371 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.LocalID,pure)) )
-# 23988 "parser_cocci_menhir.ml"
+# 23989 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24015,21 +24016,21 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 24019 "parser_cocci_menhir.ml"
+# 24020 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_eexpr = Obj.magic _2 in
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 24025 "parser_cocci_menhir.ml"
+# 24026 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_primary_expr_eexpr_nest_expressions_ = 
-# 1374 "parser_cocci_menhir.mly"
+# 1375 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.Paren(P.clt2mcode "(" _1,_2,
                            P.clt2mcode ")" _3)) )
-# 24033 "parser_cocci_menhir.ml"
+# 24034 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24060,23 +24061,23 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 24064 "parser_cocci_menhir.ml"
+# 24065 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_midzero_list_eexpr_eexpr_ = Obj.magic _2 in
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 24070 "parser_cocci_menhir.ml"
+# 24071 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_primary_expr_eexpr_nest_expressions_ = 
-# 1377 "parser_cocci_menhir.mly"
+# 1378 "parser_cocci_menhir.mly"
      ( let (mids,code) = _2 in
        Ast0.wrap(Ast0.DisjExpr(P.clt2mcode "(" _1,
                               code, mids,
                               P.clt2mcode ")" _3)) )
-# 24080 "parser_cocci_menhir.ml"
+# 24081 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24098,9 +24099,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_eexpr_nest_expressions_ = 
-# 1381 "parser_cocci_menhir.mly"
+# 1382 "parser_cocci_menhir.mly"
                  ( _1 )
-# 24104 "parser_cocci_menhir.ml"
+# 24105 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24122,9 +24123,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_expr_invalid_ = 
-# 1341 "parser_cocci_menhir.mly"
+# 1342 "parser_cocci_menhir.mly"
                 ( Ast0.wrap(Ast0.Ident(_1)) )
-# 24128 "parser_cocci_menhir.ml"
+# 24129 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24145,15 +24146,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 24149 "parser_cocci_menhir.ml"
+# 24150 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_expr_invalid_ = 
-# 1343 "parser_cocci_menhir.mly"
+# 1344 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.Int x) clt)) )
-# 24157 "parser_cocci_menhir.ml"
+# 24158 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24174,15 +24175,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 24178 "parser_cocci_menhir.ml"
+# 24179 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_expr_invalid_ = 
-# 1346 "parser_cocci_menhir.mly"
+# 1347 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.Float x) clt)) )
-# 24186 "parser_cocci_menhir.ml"
+# 24187 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24203,15 +24204,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 24207 "parser_cocci_menhir.ml"
+# 24208 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_expr_invalid_ = 
-# 1349 "parser_cocci_menhir.mly"
+# 1350 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.String x) clt)) )
-# 24215 "parser_cocci_menhir.ml"
+# 24216 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24232,15 +24233,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 24236 "parser_cocci_menhir.ml"
+# 24237 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_expr_invalid_ = 
-# 1352 "parser_cocci_menhir.mly"
+# 1353 "parser_cocci_menhir.mly"
      ( let (x,clt) = _1 in
      Ast0.wrap(Ast0.Constant (P.clt2mcode (Ast.Char x) clt)) )
-# 24244 "parser_cocci_menhir.ml"
+# 24245 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24261,16 +24262,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 24265 "parser_cocci_menhir.ml"
+# 24266 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_expr_invalid_ = 
-# 1355 "parser_cocci_menhir.mly"
+# 1356 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.CONST,pure)) )
-# 24274 "parser_cocci_menhir.ml"
+# 24275 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24291,15 +24292,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 63 "parser_cocci_menhir.mly"
        (Parse_aux.expinfo)
-# 24295 "parser_cocci_menhir.ml"
+# 24296 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_expr_invalid_ = 
-# 1359 "parser_cocci_menhir.mly"
+# 1360 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,clt) = _1 in
      Ast0.wrap(Ast0.MetaErr(P.clt2mcode nm clt,constraints,pure)) )
-# 24303 "parser_cocci_menhir.ml"
+# 24304 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24320,16 +24321,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 24324 "parser_cocci_menhir.ml"
+# 24325 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_expr_invalid_ = 
-# 1362 "parser_cocci_menhir.mly"
+# 1363 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.ANY,pure)) )
-# 24333 "parser_cocci_menhir.ml"
+# 24334 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24350,16 +24351,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 24354 "parser_cocci_menhir.ml"
+# 24355 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_expr_invalid_ = 
-# 1366 "parser_cocci_menhir.mly"
+# 1367 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.ID,pure)) )
-# 24363 "parser_cocci_menhir.ml"
+# 24364 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24380,16 +24381,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 67 "parser_cocci_menhir.mly"
        (Parse_aux.typed_info)
-# 24384 "parser_cocci_menhir.ml"
+# 24385 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_expr_invalid_ = 
-# 1370 "parser_cocci_menhir.mly"
+# 1371 "parser_cocci_menhir.mly"
      ( let (nm,constraints,pure,ty,clt) = _1 in
      Ast0.wrap
        (Ast0.MetaExpr(P.clt2mcode nm clt,constraints,ty,Ast.LocalID,pure)) )
-# 24393 "parser_cocci_menhir.ml"
+# 24394 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24420,21 +24421,21 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 24424 "parser_cocci_menhir.ml"
+# 24425 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_eexpr = Obj.magic _2 in
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 24430 "parser_cocci_menhir.ml"
+# 24431 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_primary_expr_expr_invalid_ = 
-# 1374 "parser_cocci_menhir.mly"
+# 1375 "parser_cocci_menhir.mly"
      ( Ast0.wrap(Ast0.Paren(P.clt2mcode "(" _1,_2,
                            P.clt2mcode ")" _3)) )
-# 24438 "parser_cocci_menhir.ml"
+# 24439 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24465,23 +24466,23 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 24469 "parser_cocci_menhir.ml"
+# 24470 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_midzero_list_expr_eexpr_ = Obj.magic _2 in
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 24475 "parser_cocci_menhir.ml"
+# 24476 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_primary_expr_expr_invalid_ = 
-# 1377 "parser_cocci_menhir.mly"
+# 1378 "parser_cocci_menhir.mly"
      ( let (mids,code) = _2 in
        Ast0.wrap(Ast0.DisjExpr(P.clt2mcode "(" _1,
                               code, mids,
                               P.clt2mcode ")" _3)) )
-# 24485 "parser_cocci_menhir.ml"
+# 24486 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24503,9 +24504,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_primary_expr_expr_invalid_ = 
-# 1381 "parser_cocci_menhir.mly"
+# 1382 "parser_cocci_menhir.mly"
                  ( _1 )
-# 24509 "parser_cocci_menhir.ml"
+# 24510 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24527,7 +24528,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_pure = 
 # 190 "parser_cocci_menhir.mly"
                  ( Ast0.Pure )
-# 24531 "parser_cocci_menhir.ml"
+# 24532 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24549,7 +24550,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_pure = 
 # 191 "parser_cocci_menhir.mly"
                  ( Ast0.Context )
-# 24553 "parser_cocci_menhir.ml"
+# 24554 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24575,7 +24576,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_pure = 
 # 192 "parser_cocci_menhir.mly"
                  ( Ast0.PureContext )
-# 24579 "parser_cocci_menhir.ml"
+# 24580 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24601,7 +24602,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_pure = 
 # 193 "parser_cocci_menhir.mly"
                  ( Ast0.PureContext )
-# 24605 "parser_cocci_menhir.ml"
+# 24606 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24618,7 +24619,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_pure = 
 # 194 "parser_cocci_menhir.mly"
                  ( Ast0.Impure )
-# 24622 "parser_cocci_menhir.ml"
+# 24623 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24639,14 +24640,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 59 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 24643 "parser_cocci_menhir.ml"
+# 24644 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_pure_ident = 
-# 1395 "parser_cocci_menhir.mly"
+# 1396 "parser_cocci_menhir.mly"
             ( _1 )
-# 24650 "parser_cocci_menhir.ml"
+# 24651 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24668,9 +24669,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_pure_ident_or_meta_ident = 
-# 1401 "parser_cocci_menhir.mly"
+# 1402 "parser_cocci_menhir.mly"
                                  ( (None,P.id2name _1) )
-# 24674 "parser_cocci_menhir.ml"
+# 24675 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24692,9 +24693,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_pure_ident_or_meta_ident = 
-# 1402 "parser_cocci_menhir.mly"
+# 1403 "parser_cocci_menhir.mly"
                                  ( _1 )
-# 24698 "parser_cocci_menhir.ml"
+# 24699 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24714,9 +24715,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_pure_ident_or_meta_ident = 
-# 1403 "parser_cocci_menhir.mly"
+# 1404 "parser_cocci_menhir.mly"
                                  ( (None,"list") )
-# 24720 "parser_cocci_menhir.ml"
+# 24721 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24736,9 +24737,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_pure_ident_or_meta_ident = 
-# 1404 "parser_cocci_menhir.mly"
+# 1405 "parser_cocci_menhir.mly"
                                  ( (None,"error") )
-# 24742 "parser_cocci_menhir.ml"
+# 24743 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24758,9 +24759,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_pure_ident_or_meta_ident = 
-# 1405 "parser_cocci_menhir.mly"
+# 1406 "parser_cocci_menhir.mly"
                                  ( (None,"type") )
-# 24764 "parser_cocci_menhir.ml"
+# 24765 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24780,9 +24781,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_pure_ident_or_meta_ident = 
-# 1406 "parser_cocci_menhir.mly"
+# 1407 "parser_cocci_menhir.mly"
                                  ( (None,"name") )
-# 24786 "parser_cocci_menhir.ml"
+# 24787 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24810,9 +24811,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_i_ in
         let _endpos = _endpos_l_ in
         let _v : 'tv_pure_ident_or_meta_ident_with_not_eq_not_ceq_ = 
-# 1413 "parser_cocci_menhir.mly"
+# 1414 "parser_cocci_menhir.mly"
                                                     ( (i,l) )
-# 24816 "parser_cocci_menhir.ml"
+# 24817 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24840,9 +24841,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_i_ in
         let _endpos = _endpos_l_ in
         let _v : 'tv_pure_ident_or_meta_ident_with_not_eq_not_eq_ = 
-# 1413 "parser_cocci_menhir.mly"
+# 1414 "parser_cocci_menhir.mly"
                                                     ( (i,l) )
-# 24846 "parser_cocci_menhir.ml"
+# 24847 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24870,9 +24871,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_i_ in
         let _endpos = _endpos_l_ in
         let _v : 'tv_pure_ident_or_meta_ident_with_not_eq_not_eqe_ = 
-# 1413 "parser_cocci_menhir.mly"
+# 1414 "parser_cocci_menhir.mly"
                                                     ( (i,l) )
-# 24876 "parser_cocci_menhir.ml"
+# 24877 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24900,9 +24901,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos_i_ in
         let _endpos = _endpos_l_ in
         let _v : 'tv_pure_ident_or_meta_ident_with_not_eq_not_pos_ = 
-# 1413 "parser_cocci_menhir.mly"
+# 1414 "parser_cocci_menhir.mly"
                                                     ( (i,l) )
-# 24906 "parser_cocci_menhir.ml"
+# 24907 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24924,9 +24925,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_pure_ident_or_meta_ident_with_seed = 
-# 1409 "parser_cocci_menhir.mly"
+# 1410 "parser_cocci_menhir.mly"
                                 ( (_1,None) )
-# 24930 "parser_cocci_menhir.ml"
+# 24931 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24956,15 +24957,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let s : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 24960 "parser_cocci_menhir.ml"
+# 24961 "parser_cocci_menhir.ml"
         ) = Obj.magic s in
         let _1 : 'tv_pure_ident_or_meta_ident = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_s_ in
         let _v : 'tv_pure_ident_or_meta_ident_with_seed = 
-# 1410 "parser_cocci_menhir.mly"
+# 1411 "parser_cocci_menhir.mly"
                                               ( (_1,Some (P.id2name s)) )
-# 24968 "parser_cocci_menhir.ml"
+# 24969 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -24981,11 +24982,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 131 "parser_cocci_menhir.mly"
       (unit)
-# 24985 "parser_cocci_menhir.ml"
+# 24986 "parser_cocci_menhir.ml"
         ) = 
 # 172 "parser_cocci_menhir.mly"
         ( )
-# 24989 "parser_cocci_menhir.ml"
+# 24990 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25007,9 +25008,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_rule_elem_statement = 
-# 915 "parser_cocci_menhir.mly"
+# 916 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.Decl((Ast0.default_info(),Ast0.context_befaft()),_1)) )
-# 25013 "parser_cocci_menhir.ml"
+# 25014 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25035,15 +25036,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 25039 "parser_cocci_menhir.ml"
+# 25040 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_expr = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_rule_elem_statement = 
-# 916 "parser_cocci_menhir.mly"
+# 917 "parser_cocci_menhir.mly"
                ( P.exp_stm _1 _2 )
-# 25047 "parser_cocci_menhir.ml"
+# 25048 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25074,20 +25075,20 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 25078 "parser_cocci_menhir.ml"
+# 25079 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_eexpr = Obj.magic _2 in
         let _1 : (
 # 57 "parser_cocci_menhir.mly"
        (Data.clt)
-# 25084 "parser_cocci_menhir.ml"
+# 25085 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_rule_elem_statement = 
-# 917 "parser_cocci_menhir.mly"
+# 918 "parser_cocci_menhir.mly"
                         ( P.ret_exp _1 _2 _3 )
-# 25091 "parser_cocci_menhir.ml"
+# 25092 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25113,19 +25114,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 25117 "parser_cocci_menhir.ml"
+# 25118 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 57 "parser_cocci_menhir.mly"
        (Data.clt)
-# 25122 "parser_cocci_menhir.ml"
+# 25123 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_rule_elem_statement = 
-# 918 "parser_cocci_menhir.mly"
+# 919 "parser_cocci_menhir.mly"
                   ( P.ret _1 _2 )
-# 25129 "parser_cocci_menhir.ml"
+# 25130 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25151,19 +25152,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 25155 "parser_cocci_menhir.ml"
+# 25156 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 58 "parser_cocci_menhir.mly"
        (Data.clt)
-# 25160 "parser_cocci_menhir.ml"
+# 25161 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_rule_elem_statement = 
-# 919 "parser_cocci_menhir.mly"
+# 920 "parser_cocci_menhir.mly"
                  ( P.break _1 _2 )
-# 25167 "parser_cocci_menhir.ml"
+# 25168 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25189,19 +25190,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 25193 "parser_cocci_menhir.ml"
+# 25194 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 58 "parser_cocci_menhir.mly"
        (Data.clt)
-# 25198 "parser_cocci_menhir.ml"
+# 25199 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_rule_elem_statement = 
-# 920 "parser_cocci_menhir.mly"
+# 921 "parser_cocci_menhir.mly"
                     ( P.cont _1 _2 )
-# 25205 "parser_cocci_menhir.ml"
+# 25206 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25232,24 +25233,24 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 25236 "parser_cocci_menhir.ml"
+# 25237 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_midzero_list_rule_elem_statement_rule_elem_statement_ = Obj.magic _2 in
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 25242 "parser_cocci_menhir.ml"
+# 25243 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_rule_elem_statement = 
-# 922 "parser_cocci_menhir.mly"
+# 923 "parser_cocci_menhir.mly"
     ( let (mids,code) = _2 in
     Ast0.wrap
       (Ast0.Disj(P.clt2mcode "(" _1,
                 List.map (function x -> Ast0.wrap(Ast0.DOTS([x]))) code,
                 mids, P.clt2mcode ")" _3)) )
-# 25253 "parser_cocci_menhir.ml"
+# 25254 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25305,18 +25306,18 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 153 "parser_cocci_menhir.mly"
       (Ast_cocci.rulename)
-# 25309 "parser_cocci_menhir.ml"
+# 25310 "parser_cocci_menhir.ml"
         ) = let nm =
           
 # 39 "standard.mly"
     ( None )
-# 25314 "parser_cocci_menhir.ml"
+# 25315 "parser_cocci_menhir.ml"
           
         in
         
 # 202 "parser_cocci_menhir.mly"
       ( P.make_cocci_rule_name_result nm d i a e ee )
-# 25320 "parser_cocci_menhir.ml"
+# 25321 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25378,19 +25379,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 153 "parser_cocci_menhir.mly"
       (Ast_cocci.rulename)
-# 25382 "parser_cocci_menhir.ml"
+# 25383 "parser_cocci_menhir.ml"
         ) = let nm =
           let x = x0 in
           
 # 41 "standard.mly"
     ( Some x )
-# 25388 "parser_cocci_menhir.ml"
+# 25389 "parser_cocci_menhir.ml"
           
         in
         
 # 202 "parser_cocci_menhir.mly"
       ( P.make_cocci_rule_name_result nm d i a e ee )
-# 25394 "parser_cocci_menhir.ml"
+# 25395 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25450,11 +25451,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 153 "parser_cocci_menhir.mly"
       (Ast_cocci.rulename)
-# 25454 "parser_cocci_menhir.ml"
+# 25455 "parser_cocci_menhir.ml"
         ) = 
 # 207 "parser_cocci_menhir.mly"
       ( P.make_generated_rule_name_result None d i a e ee )
-# 25458 "parser_cocci_menhir.ml"
+# 25459 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25496,11 +25497,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 153 "parser_cocci_menhir.mly"
       (Ast_cocci.rulename)
-# 25500 "parser_cocci_menhir.ml"
+# 25501 "parser_cocci_menhir.ml"
         ) = 
 # 209 "parser_cocci_menhir.mly"
       ( P.make_script_rule_name_result lang d )
-# 25504 "parser_cocci_menhir.ml"
+# 25505 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25536,11 +25537,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 153 "parser_cocci_menhir.mly"
       (Ast_cocci.rulename)
-# 25540 "parser_cocci_menhir.ml"
+# 25541 "parser_cocci_menhir.ml"
         ) = 
 # 211 "parser_cocci_menhir.mly"
       ( P.make_initial_script_rule_name_result lang )
-# 25544 "parser_cocci_menhir.ml"
+# 25545 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25576,11 +25577,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 153 "parser_cocci_menhir.mly"
       (Ast_cocci.rulename)
-# 25580 "parser_cocci_menhir.ml"
+# 25581 "parser_cocci_menhir.ml"
         ) = 
 # 213 "parser_cocci_menhir.mly"
       ( P.make_final_script_rule_name_result lang )
-# 25584 "parser_cocci_menhir.ml"
+# 25585 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25624,7 +25625,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 47 "parser_cocci_menhir.mly"
       (string)
-# 25628 "parser_cocci_menhir.ml"
+# 25629 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let py : 'tv_pure_ident = Obj.magic py in
         let _startpos = _startpos_py_ in
@@ -25632,11 +25633,11 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : (
 # 159 "parser_cocci_menhir.mly"
        (string * (string * string))
-# 25636 "parser_cocci_menhir.ml"
+# 25637 "parser_cocci_menhir.ml"
         ) = 
-# 1873 "parser_cocci_menhir.mly"
+# 1879 "parser_cocci_menhir.mly"
   ( (P.id2name py, (_3, P.id2name cocci)) )
-# 25640 "parser_cocci_menhir.ml"
+# 25641 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25657,14 +25658,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let x : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 25661 "parser_cocci_menhir.ml"
+# 25662 "parser_cocci_menhir.ml"
         ) = Obj.magic x in
         let _startpos = _startpos_x_ in
         let _endpos = _endpos_x_ in
         let _v : 'tv_separated_nonempty_list_TComma_TString_ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 25668 "parser_cocci_menhir.ml"
+# 25669 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25695,14 +25696,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let x : (
 # 87 "parser_cocci_menhir.mly"
        (string * Data.clt)
-# 25699 "parser_cocci_menhir.ml"
+# 25700 "parser_cocci_menhir.ml"
         ) = Obj.magic x in
         let _startpos = _startpos_x_ in
         let _endpos = _endpos_xs_ in
         let _v : 'tv_separated_nonempty_list_TComma_TString_ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 25706 "parser_cocci_menhir.ml"
+# 25707 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25726,7 +25727,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_any_strict_ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 25730 "parser_cocci_menhir.ml"
+# 25731 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25760,7 +25761,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_any_strict_ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 25764 "parser_cocci_menhir.ml"
+# 25765 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25784,7 +25785,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_ctype_ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 25788 "parser_cocci_menhir.ml"
+# 25789 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25818,7 +25819,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_ctype_ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 25822 "parser_cocci_menhir.ml"
+# 25823 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25842,7 +25843,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_d_ident_ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 25846 "parser_cocci_menhir.ml"
+# 25847 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25876,7 +25877,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_d_ident_ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 25880 "parser_cocci_menhir.ml"
+# 25881 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25900,7 +25901,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_dexpr_ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 25904 "parser_cocci_menhir.ml"
+# 25905 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25934,7 +25935,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_dexpr_ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 25938 "parser_cocci_menhir.ml"
+# 25939 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25958,7 +25959,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_ident_or_const_ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 25962 "parser_cocci_menhir.ml"
+# 25963 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -25992,7 +25993,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_ident_or_const_ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 25996 "parser_cocci_menhir.ml"
+# 25997 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26016,7 +26017,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_meta_ident_ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 26020 "parser_cocci_menhir.ml"
+# 26021 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26050,7 +26051,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_meta_ident_ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 26054 "parser_cocci_menhir.ml"
+# 26055 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26074,7 +26075,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 26078 "parser_cocci_menhir.ml"
+# 26079 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26108,7 +26109,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 26112 "parser_cocci_menhir.ml"
+# 26113 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26132,7 +26133,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_or_meta_ident_ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 26136 "parser_cocci_menhir.ml"
+# 26137 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26166,7 +26167,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_or_meta_ident_ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 26170 "parser_cocci_menhir.ml"
+# 26171 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26190,7 +26191,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_or_meta_ident_with_not_eq_not_ceq__ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 26194 "parser_cocci_menhir.ml"
+# 26195 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26224,7 +26225,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_or_meta_ident_with_not_eq_not_ceq__ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 26228 "parser_cocci_menhir.ml"
+# 26229 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26248,7 +26249,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_or_meta_ident_with_not_eq_not_eq__ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 26252 "parser_cocci_menhir.ml"
+# 26253 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26282,7 +26283,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_or_meta_ident_with_not_eq_not_eq__ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 26286 "parser_cocci_menhir.ml"
+# 26287 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26306,7 +26307,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_or_meta_ident_with_not_eq_not_eqe__ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 26310 "parser_cocci_menhir.ml"
+# 26311 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26340,7 +26341,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_or_meta_ident_with_not_eq_not_eqe__ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 26344 "parser_cocci_menhir.ml"
+# 26345 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26364,7 +26365,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_or_meta_ident_with_not_eq_not_pos__ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 26368 "parser_cocci_menhir.ml"
+# 26369 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26398,7 +26399,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_or_meta_ident_with_not_eq_not_pos__ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 26402 "parser_cocci_menhir.ml"
+# 26403 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26422,7 +26423,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_or_meta_ident_with_seed_ = 
 # 144 "standard.mly"
     ( [ x ] )
-# 26426 "parser_cocci_menhir.ml"
+# 26427 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26456,7 +26457,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_separated_nonempty_list_TComma_pure_ident_or_meta_ident_with_seed_ = 
 # 146 "standard.mly"
     ( x :: xs )
-# 26460 "parser_cocci_menhir.ml"
+# 26461 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26478,9 +26479,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_single_statement = 
-# 930 "parser_cocci_menhir.mly"
+# 931 "parser_cocci_menhir.mly"
                                       ( _1 )
-# 26484 "parser_cocci_menhir.ml"
+# 26485 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26511,24 +26512,24 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26515 "parser_cocci_menhir.ml"
+# 26516 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_midzero_list_statement_statement_ = Obj.magic _2 in
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26521 "parser_cocci_menhir.ml"
+# 26522 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_single_statement = 
-# 934 "parser_cocci_menhir.mly"
+# 935 "parser_cocci_menhir.mly"
       ( let (mids,code) = _2 in
         Ast0.wrap
          (Ast0.Disj(P.clt2mcode "(" _1,
                     List.map (function x -> Ast0.wrap(Ast0.DOTS([x]))) code,
                     mids, P.clt2mcode ")" _3)) )
-# 26532 "parser_cocci_menhir.ml"
+# 26533 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26550,9 +26551,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_statement = 
-# 857 "parser_cocci_menhir.mly"
+# 858 "parser_cocci_menhir.mly"
            ( _1 )
-# 26556 "parser_cocci_menhir.ml"
+# 26557 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26573,14 +26574,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 64 "parser_cocci_menhir.mly"
        (Parse_aux.info)
-# 26577 "parser_cocci_menhir.ml"
+# 26578 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_statement = 
-# 859 "parser_cocci_menhir.mly"
+# 860 "parser_cocci_menhir.mly"
     ( P.meta_stm _1 )
-# 26584 "parser_cocci_menhir.ml"
+# 26585 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26606,15 +26607,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26610 "parser_cocci_menhir.ml"
+# 26611 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_expr = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_statement = 
-# 861 "parser_cocci_menhir.mly"
+# 862 "parser_cocci_menhir.mly"
     ( P.exp_stm _1 _2 )
-# 26618 "parser_cocci_menhir.ml"
+# 26619 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26656,25 +26657,25 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _4 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26660 "parser_cocci_menhir.ml"
+# 26661 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr = Obj.magic _3 in
         let _2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26666 "parser_cocci_menhir.ml"
+# 26667 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 57 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26671 "parser_cocci_menhir.ml"
+# 26672 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__5_ in
         let _v : 'tv_statement = 
-# 863 "parser_cocci_menhir.mly"
+# 864 "parser_cocci_menhir.mly"
     ( P.ifthen _1 _2 _3 _4 _5 )
-# 26678 "parser_cocci_menhir.ml"
+# 26679 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26726,31 +26727,31 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _6 : (
 # 57 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26730 "parser_cocci_menhir.ml"
+# 26731 "parser_cocci_menhir.ml"
         ) = Obj.magic _6 in
         let _5 : 'tv_single_statement = Obj.magic _5 in
         let _4 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26736 "parser_cocci_menhir.ml"
+# 26737 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr = Obj.magic _3 in
         let _2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26742 "parser_cocci_menhir.ml"
+# 26743 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 57 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26747 "parser_cocci_menhir.ml"
+# 26748 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__7_ in
         let _v : 'tv_statement = 
-# 865 "parser_cocci_menhir.mly"
+# 866 "parser_cocci_menhir.mly"
     ( P.ifthenelse _1 _2 _3 _4 _5 _6 _7 )
-# 26754 "parser_cocci_menhir.ml"
+# 26755 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26812,37 +26813,37 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _8 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26816 "parser_cocci_menhir.ml"
+# 26817 "parser_cocci_menhir.ml"
         ) = Obj.magic _8 in
         let _7 : 'tv_option_eexpr_ = Obj.magic _7 in
         let _6 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26822 "parser_cocci_menhir.ml"
+# 26823 "parser_cocci_menhir.ml"
         ) = Obj.magic _6 in
         let _5 : 'tv_option_eexpr_ = Obj.magic _5 in
         let _4 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26828 "parser_cocci_menhir.ml"
+# 26829 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_option_eexpr_ = Obj.magic _3 in
         let _2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26834 "parser_cocci_menhir.ml"
+# 26835 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 57 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26839 "parser_cocci_menhir.ml"
+# 26840 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__9_ in
         let _v : 'tv_statement = 
-# 868 "parser_cocci_menhir.mly"
+# 869 "parser_cocci_menhir.mly"
     ( P.forloop _1 _2 _3 _4 _5 _6 _7 _8 _9 )
-# 26846 "parser_cocci_menhir.ml"
+# 26847 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26884,25 +26885,25 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _4 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26888 "parser_cocci_menhir.ml"
+# 26889 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr = Obj.magic _3 in
         let _2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26894 "parser_cocci_menhir.ml"
+# 26895 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 57 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26899 "parser_cocci_menhir.ml"
+# 26900 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__5_ in
         let _v : 'tv_statement = 
-# 870 "parser_cocci_menhir.mly"
+# 871 "parser_cocci_menhir.mly"
     ( P.whileloop _1 _2 _3 _4 _5 )
-# 26906 "parser_cocci_menhir.ml"
+# 26907 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -26953,36 +26954,36 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _7 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26957 "parser_cocci_menhir.ml"
+# 26958 "parser_cocci_menhir.ml"
         ) = Obj.magic _7 in
         let _6 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26962 "parser_cocci_menhir.ml"
+# 26963 "parser_cocci_menhir.ml"
         ) = Obj.magic _6 in
         let _5 : 'tv_eexpr = Obj.magic _5 in
         let _4 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26968 "parser_cocci_menhir.ml"
+# 26969 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : (
 # 57 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26973 "parser_cocci_menhir.ml"
+# 26974 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_single_statement = Obj.magic _2 in
         let _1 : (
 # 57 "parser_cocci_menhir.mly"
        (Data.clt)
-# 26979 "parser_cocci_menhir.ml"
+# 26980 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__7_ in
         let _v : 'tv_statement = 
-# 872 "parser_cocci_menhir.mly"
+# 873 "parser_cocci_menhir.mly"
     ( P.doloop _1 _2 _3 _4 _5 _6 _7 )
-# 26986 "parser_cocci_menhir.ml"
+# 26987 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27024,21 +27025,21 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _4 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27028 "parser_cocci_menhir.ml"
+# 27029 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr_list_option = Obj.magic _3 in
         let _2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27034 "parser_cocci_menhir.ml"
+# 27035 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_iter_ident = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__5_ in
         let _v : 'tv_statement = 
-# 874 "parser_cocci_menhir.mly"
+# 875 "parser_cocci_menhir.mly"
     ( P.iterator _1 _2 _3 _4 _5 )
-# 27042 "parser_cocci_menhir.ml"
+# 27043 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27089,36 +27090,36 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _7 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27093 "parser_cocci_menhir.ml"
+# 27094 "parser_cocci_menhir.ml"
         ) = Obj.magic _7 in
         let _6 : 'tv_list_case_line_ = Obj.magic _6 in
         let _5 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27099 "parser_cocci_menhir.ml"
+# 27100 "parser_cocci_menhir.ml"
         ) = Obj.magic _5 in
         let _4 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27104 "parser_cocci_menhir.ml"
+# 27105 "parser_cocci_menhir.ml"
         ) = Obj.magic _4 in
         let _3 : 'tv_eexpr = Obj.magic _3 in
         let _2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27110 "parser_cocci_menhir.ml"
+# 27111 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 57 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27115 "parser_cocci_menhir.ml"
+# 27116 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__7_ in
         let _v : 'tv_statement = 
-# 876 "parser_cocci_menhir.mly"
+# 877 "parser_cocci_menhir.mly"
     ( P.switch _1 _2 _3 _4 _5 _6 _7 )
-# 27122 "parser_cocci_menhir.ml"
+# 27123 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27149,20 +27150,20 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27153 "parser_cocci_menhir.ml"
+# 27154 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_eexpr = Obj.magic _2 in
         let _1 : (
 # 57 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27159 "parser_cocci_menhir.ml"
+# 27160 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_statement = 
-# 877 "parser_cocci_menhir.mly"
+# 878 "parser_cocci_menhir.mly"
                         ( P.ret_exp _1 _2 _3 )
-# 27166 "parser_cocci_menhir.ml"
+# 27167 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27188,19 +27189,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27192 "parser_cocci_menhir.ml"
+# 27193 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 57 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27197 "parser_cocci_menhir.ml"
+# 27198 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_statement = 
-# 878 "parser_cocci_menhir.mly"
+# 879 "parser_cocci_menhir.mly"
                   ( P.ret _1 _2 )
-# 27204 "parser_cocci_menhir.ml"
+# 27205 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27226,19 +27227,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27230 "parser_cocci_menhir.ml"
+# 27231 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 58 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27235 "parser_cocci_menhir.ml"
+# 27236 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_statement = 
-# 879 "parser_cocci_menhir.mly"
+# 880 "parser_cocci_menhir.mly"
                  ( P.break _1 _2 )
-# 27242 "parser_cocci_menhir.ml"
+# 27243 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27264,19 +27265,19 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27268 "parser_cocci_menhir.ml"
+# 27269 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : (
 # 58 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27273 "parser_cocci_menhir.ml"
+# 27274 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_statement = 
-# 880 "parser_cocci_menhir.mly"
+# 881 "parser_cocci_menhir.mly"
                     ( P.cont _1 _2 )
-# 27280 "parser_cocci_menhir.ml"
+# 27281 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27302,15 +27303,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27306 "parser_cocci_menhir.ml"
+# 27307 "parser_cocci_menhir.ml"
         ) = Obj.magic _2 in
         let _1 : 'tv_ident = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_statement = 
-# 881 "parser_cocci_menhir.mly"
+# 882 "parser_cocci_menhir.mly"
                 ( P.label _1 _2 )
-# 27314 "parser_cocci_menhir.ml"
+# 27315 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27341,20 +27342,20 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27345 "parser_cocci_menhir.ml"
+# 27346 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_ident = Obj.magic _2 in
         let _1 : (
 # 58 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27351 "parser_cocci_menhir.ml"
+# 27352 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_statement = 
-# 882 "parser_cocci_menhir.mly"
+# 883 "parser_cocci_menhir.mly"
                       ( P.goto _1 _2 _3 )
-# 27358 "parser_cocci_menhir.ml"
+# 27359 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27385,20 +27386,20 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27389 "parser_cocci_menhir.ml"
+# 27390 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_fun_start = Obj.magic _2 in
         let _1 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27395 "parser_cocci_menhir.ml"
+# 27396 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_statement = 
-# 884 "parser_cocci_menhir.mly"
+# 885 "parser_cocci_menhir.mly"
     ( P.seq _1 _2 _3 )
-# 27402 "parser_cocci_menhir.ml"
+# 27403 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27425,14 +27426,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27429 "parser_cocci_menhir.ml"
+# 27430 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_w_ in
         let _v : 'tv_stm_dots = 
-# 888 "parser_cocci_menhir.mly"
+# 889 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.Dots(P.clt2mcode "..." _1, List.concat w)) )
-# 27436 "parser_cocci_menhir.ml"
+# 27437 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27468,22 +27469,22 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let c : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27472 "parser_cocci_menhir.ml"
+# 27473 "parser_cocci_menhir.ml"
         ) = Obj.magic c in
         let b : 'tv_nest_start = Obj.magic b in
         let w : 'tv_list_whenppdecs_ = Obj.magic w in
         let _1 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27479 "parser_cocci_menhir.ml"
+# 27480 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_c_ in
         let _v : 'tv_stm_dots = 
-# 890 "parser_cocci_menhir.mly"
+# 891 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.Nest(P.clt2mcode "<..." _1, b,
                          P.clt2mcode "...>" c, List.concat w, false)) )
-# 27487 "parser_cocci_menhir.ml"
+# 27488 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27519,22 +27520,22 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let c : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27523 "parser_cocci_menhir.ml"
+# 27524 "parser_cocci_menhir.ml"
         ) = Obj.magic c in
         let b : 'tv_nest_start = Obj.magic b in
         let w : 'tv_list_whenppdecs_ = Obj.magic w in
         let _1 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27530 "parser_cocci_menhir.ml"
+# 27531 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos_c_ in
         let _v : 'tv_stm_dots = 
-# 893 "parser_cocci_menhir.mly"
+# 894 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.Nest(P.clt2mcode "<+..." _1, b,
                          P.clt2mcode "...+>" c, List.concat w, true)) )
-# 27538 "parser_cocci_menhir.ml"
+# 27539 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27555,14 +27556,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let s : (
 # 53 "parser_cocci_menhir.mly"
       (Data.clt)
-# 27559 "parser_cocci_menhir.ml"
+# 27560 "parser_cocci_menhir.ml"
         ) = Obj.magic s in
         let _startpos = _startpos_s_ in
         let _endpos = _endpos_s_ in
         let _v : 'tv_storage = 
-# 815 "parser_cocci_menhir.mly"
+# 816 "parser_cocci_menhir.mly"
                         ( P.clt2mcode Ast.Static s )
-# 27566 "parser_cocci_menhir.ml"
+# 27567 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27583,14 +27584,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let s : (
 # 53 "parser_cocci_menhir.mly"
       (Data.clt)
-# 27587 "parser_cocci_menhir.ml"
+# 27588 "parser_cocci_menhir.ml"
         ) = Obj.magic s in
         let _startpos = _startpos_s_ in
         let _endpos = _endpos_s_ in
         let _v : 'tv_storage = 
-# 816 "parser_cocci_menhir.mly"
+# 817 "parser_cocci_menhir.mly"
                         ( P.clt2mcode Ast.Auto s )
-# 27594 "parser_cocci_menhir.ml"
+# 27595 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27611,14 +27612,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let s : (
 # 53 "parser_cocci_menhir.mly"
       (Data.clt)
-# 27615 "parser_cocci_menhir.ml"
+# 27616 "parser_cocci_menhir.ml"
         ) = Obj.magic s in
         let _startpos = _startpos_s_ in
         let _endpos = _endpos_s_ in
         let _v : 'tv_storage = 
-# 817 "parser_cocci_menhir.mly"
+# 818 "parser_cocci_menhir.mly"
                         ( P.clt2mcode Ast.Register s )
-# 27622 "parser_cocci_menhir.ml"
+# 27623 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27639,14 +27640,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let s : (
 # 53 "parser_cocci_menhir.mly"
       (Data.clt)
-# 27643 "parser_cocci_menhir.ml"
+# 27644 "parser_cocci_menhir.ml"
         ) = Obj.magic s in
         let _startpos = _startpos_s_ in
         let _endpos = _endpos_s_ in
         let _v : 'tv_storage = 
-# 818 "parser_cocci_menhir.mly"
+# 819 "parser_cocci_menhir.mly"
                         ( P.clt2mcode Ast.Extern s )
-# 27650 "parser_cocci_menhir.ml"
+# 27651 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27668,7 +27669,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_struct_decl = 
 # 521 "parser_cocci_menhir.mly"
                ( [] )
-# 27672 "parser_cocci_menhir.ml"
+# 27673 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27699,7 +27700,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27703 "parser_cocci_menhir.ml"
+# 27704 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let d : 'tv_d_ident = Obj.magic d in
         let t : 'tv_ctype = Obj.magic t in
@@ -27709,7 +27710,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
 # 523 "parser_cocci_menhir.mly"
   ( let (id,fn) = d in
         [Ast0.wrap(Ast0.UnInit(None,fn t,id,P.clt2mcode ";" pv))] )
-# 27713 "parser_cocci_menhir.ml"
+# 27714 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27770,34 +27771,34 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27774 "parser_cocci_menhir.ml"
+# 27775 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let rp2 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27779 "parser_cocci_menhir.ml"
+# 27780 "parser_cocci_menhir.ml"
         ) = Obj.magic rp2 in
         let p : 'tv_decl_list_name_opt_decl_ = Obj.magic p in
         let lp2 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27785 "parser_cocci_menhir.ml"
+# 27786 "parser_cocci_menhir.ml"
         ) = Obj.magic lp2 in
         let rp1 : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27790 "parser_cocci_menhir.ml"
+# 27791 "parser_cocci_menhir.ml"
         ) = Obj.magic rp1 in
         let d : 'tv_d_ident = Obj.magic d in
         let st : (
 # 99 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27796 "parser_cocci_menhir.ml"
+# 27797 "parser_cocci_menhir.ml"
         ) = Obj.magic st in
         let lp1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27801 "parser_cocci_menhir.ml"
+# 27802 "parser_cocci_menhir.ml"
         ) = Obj.magic lp1 in
         let t : 'tv_fn_ctype = Obj.magic t in
         let _startpos = _startpos_t_ in
@@ -27811,7 +27812,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
               (t,P.clt2mcode "(" lp1,P.clt2mcode "*" st,P.clt2mcode ")" rp1,
                P.clt2mcode "(" lp2,p,P.clt2mcode ")" rp2)) in
         [Ast0.wrap(Ast0.UnInit(None,fn t,id,P.clt2mcode ";" pv))] )
-# 27815 "parser_cocci_menhir.ml"
+# 27816 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27842,7 +27843,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27846 "parser_cocci_menhir.ml"
+# 27847 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let d : 'tv_d_ident = Obj.magic d in
         let i : 'tv_pure_ident = Obj.magic i in
@@ -27852,7 +27853,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 39 "standard.mly"
     ( None )
-# 27856 "parser_cocci_menhir.ml"
+# 27857 "parser_cocci_menhir.ml"
           
         in
         
@@ -27860,7 +27861,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
   ( let (id,fn) = d in
         let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
         [Ast0.wrap(Ast0.UnInit(None,fn idtype,id,P.clt2mcode ";" pv))] )
-# 27864 "parser_cocci_menhir.ml"
+# 27865 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27896,7 +27897,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let pv : (
 # 107 "parser_cocci_menhir.mly"
        (Data.clt)
-# 27900 "parser_cocci_menhir.ml"
+# 27901 "parser_cocci_menhir.ml"
         ) = Obj.magic pv in
         let d : 'tv_d_ident = Obj.magic d in
         let i : 'tv_pure_ident = Obj.magic i in
@@ -27908,7 +27909,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           
 # 41 "standard.mly"
     ( Some x )
-# 27912 "parser_cocci_menhir.ml"
+# 27913 "parser_cocci_menhir.ml"
           
         in
         
@@ -27916,7 +27917,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
   ( let (id,fn) = d in
         let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
         [Ast0.wrap(Ast0.UnInit(None,fn idtype,id,P.clt2mcode ";" pv))] )
-# 27920 "parser_cocci_menhir.ml"
+# 27921 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27940,7 +27941,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_struct_decl_list = 
 # 540 "parser_cocci_menhir.mly"
                           ( Ast0.wrap(Ast0.DOTS(_1)) )
-# 27944 "parser_cocci_menhir.ml"
+# 27945 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27964,7 +27965,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_struct_decl_list_start = 
 # 543 "parser_cocci_menhir.mly"
                                      ( _1 )
-# 27968 "parser_cocci_menhir.ml"
+# 27969 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -27994,7 +27995,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_struct_decl_list_start = 
 # 544 "parser_cocci_menhir.mly"
                                      ( _1@_2 )
-# 27998 "parser_cocci_menhir.ml"
+# 27999 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28024,7 +28025,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _v : 'tv_struct_decl_list_start = 
 # 546 "parser_cocci_menhir.mly"
     ( (P.mkddots "..." d)::r )
-# 28028 "parser_cocci_menhir.ml"
+# 28029 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28045,14 +28046,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let s : (
 # 50 "parser_cocci_menhir.mly"
       (Data.clt)
-# 28049 "parser_cocci_menhir.ml"
+# 28050 "parser_cocci_menhir.ml"
         ) = Obj.magic s in
         let _startpos = _startpos_s_ in
         let _endpos = _endpos_s_ in
         let _v : 'tv_struct_or_union = 
 # 517 "parser_cocci_menhir.mly"
                  ( P.clt2mcode Ast.Struct s )
-# 28056 "parser_cocci_menhir.ml"
+# 28057 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28073,14 +28074,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let u : (
 # 50 "parser_cocci_menhir.mly"
       (Data.clt)
-# 28077 "parser_cocci_menhir.ml"
+# 28078 "parser_cocci_menhir.ml"
         ) = Obj.magic u in
         let _startpos = _startpos_u_ in
         let _endpos = _endpos_u_ in
         let _v : 'tv_struct_or_union = 
 # 518 "parser_cocci_menhir.mly"
                  ( P.clt2mcode Ast.Union u )
-# 28084 "parser_cocci_menhir.ml"
+# 28085 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28102,9 +28103,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_top_eexpr = 
-# 1209 "parser_cocci_menhir.mly"
+# 1210 "parser_cocci_menhir.mly"
         ( Ast0.wrap(Ast0.OTHER(Ast0.wrap(Ast0.Exp(_1)))) )
-# 28108 "parser_cocci_menhir.ml"
+# 28109 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28135,20 +28136,20 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _3 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 28139 "parser_cocci_menhir.ml"
+# 28140 "parser_cocci_menhir.ml"
         ) = Obj.magic _3 in
         let _2 : 'tv_initialize_list = Obj.magic _2 in
         let _1 : (
 # 101 "parser_cocci_menhir.mly"
        (Data.clt)
-# 28145 "parser_cocci_menhir.ml"
+# 28146 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
         let _v : 'tv_top_init = 
-# 1651 "parser_cocci_menhir.mly"
+# 1652 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.InitList(P.clt2mcode "{" _1,_2,P.clt2mcode "}" _3)) )
-# 28152 "parser_cocci_menhir.ml"
+# 28153 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28163,9 +28164,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_toplevel_after_dots = 
-# 1639 "parser_cocci_menhir.mly"
+# 1640 "parser_cocci_menhir.mly"
                                      ([])
-# 28169 "parser_cocci_menhir.ml"
+# 28170 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28191,9 +28192,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_after_dots = 
-# 1640 "parser_cocci_menhir.mly"
+# 1641 "parser_cocci_menhir.mly"
                                      (_2)
-# 28197 "parser_cocci_menhir.ml"
+# 28198 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28221,9 +28222,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_after_dots = 
-# 1641 "parser_cocci_menhir.mly"
+# 1642 "parser_cocci_menhir.mly"
                                      ((Ast0.wrap(Ast0.Exp(_1)))::_2)
-# 28227 "parser_cocci_menhir.ml"
+# 28228 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28251,9 +28252,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_after_dots = 
-# 1642 "parser_cocci_menhir.mly"
+# 1643 "parser_cocci_menhir.mly"
                                           (_1@_2)
-# 28257 "parser_cocci_menhir.ml"
+# 28258 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28279,9 +28280,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_after_dots_init = 
-# 1630 "parser_cocci_menhir.mly"
+# 1631 "parser_cocci_menhir.mly"
                                      (_2)
-# 28285 "parser_cocci_menhir.ml"
+# 28286 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28309,9 +28310,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_after_dots_init = 
-# 1631 "parser_cocci_menhir.mly"
+# 1632 "parser_cocci_menhir.mly"
                                      ((Ast0.wrap(Ast0.Exp(_1)))::_2)
-# 28315 "parser_cocci_menhir.ml"
+# 28316 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28339,9 +28340,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_after_dots_init = 
-# 1632 "parser_cocci_menhir.mly"
+# 1633 "parser_cocci_menhir.mly"
                                           (_1@_2)
-# 28345 "parser_cocci_menhir.ml"
+# 28346 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28356,9 +28357,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_toplevel_after_exp = 
-# 1635 "parser_cocci_menhir.mly"
+# 1636 "parser_cocci_menhir.mly"
                                      ([])
-# 28362 "parser_cocci_menhir.ml"
+# 28363 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28386,9 +28387,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_after_exp = 
-# 1636 "parser_cocci_menhir.mly"
+# 1637 "parser_cocci_menhir.mly"
                                      (_1::_2)
-# 28392 "parser_cocci_menhir.ml"
+# 28393 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28403,9 +28404,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _menhir_env.MenhirLib.EngineTypes.lexbuf.Lexing.lex_start_p in
         let _endpos = _startpos in
         let _v : 'tv_toplevel_after_stm = 
-# 1645 "parser_cocci_menhir.mly"
+# 1646 "parser_cocci_menhir.mly"
                                      ([])
-# 28409 "parser_cocci_menhir.ml"
+# 28410 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28433,9 +28434,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_after_stm = 
-# 1646 "parser_cocci_menhir.mly"
+# 1647 "parser_cocci_menhir.mly"
                                      (_1::_2)
-# 28439 "parser_cocci_menhir.ml"
+# 28440 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28463,9 +28464,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_after_stm = 
-# 1647 "parser_cocci_menhir.mly"
+# 1648 "parser_cocci_menhir.mly"
                                      (_1@_2)
-# 28469 "parser_cocci_menhir.ml"
+# 28470 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28493,9 +28494,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_seq_start_toplevel_after_dots_ = 
-# 1625 "parser_cocci_menhir.mly"
+# 1626 "parser_cocci_menhir.mly"
                                      ( _1::_2 )
-# 28499 "parser_cocci_menhir.ml"
+# 28500 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28523,9 +28524,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_seq_start_toplevel_after_dots_ = 
-# 1626 "parser_cocci_menhir.mly"
+# 1627 "parser_cocci_menhir.mly"
                                      ( (Ast0.wrap(Ast0.Exp(_1)))::_2 )
-# 28529 "parser_cocci_menhir.ml"
+# 28530 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28553,9 +28554,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_seq_start_toplevel_after_dots_ = 
-# 1627 "parser_cocci_menhir.mly"
+# 1628 "parser_cocci_menhir.mly"
                                           ( _1@_2 )
-# 28559 "parser_cocci_menhir.ml"
+# 28560 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28588,7 +28589,7 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let a0 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 28592 "parser_cocci_menhir.ml"
+# 28593 "parser_cocci_menhir.ml"
         ) = Obj.magic a0 in
         let _startpos = _startpos_a0_ in
         let _endpos = _endpos_b_ in
@@ -28596,15 +28597,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           let w = w0 in
           let a = a0 in
           
-# 898 "parser_cocci_menhir.mly"
+# 899 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.Dots(P.clt2mcode "..." a, List.concat w)) )
-# 28602 "parser_cocci_menhir.ml"
+# 28603 "parser_cocci_menhir.ml"
           
         in
         
-# 1618 "parser_cocci_menhir.mly"
+# 1619 "parser_cocci_menhir.mly"
                                              ( a::b )
-# 28608 "parser_cocci_menhir.ml"
+# 28609 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28646,14 +28647,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let c0 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 28650 "parser_cocci_menhir.ml"
+# 28651 "parser_cocci_menhir.ml"
         ) = Obj.magic c0 in
         let b0 : 'tv_nest_start = Obj.magic b0 in
         let w0 : 'tv_list_whenppdecs_ = Obj.magic w0 in
         let a0 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 28657 "parser_cocci_menhir.ml"
+# 28658 "parser_cocci_menhir.ml"
         ) = Obj.magic a0 in
         let _startpos = _startpos_a0_ in
         let _endpos = _endpos_b_ in
@@ -28663,16 +28664,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           let w = w0 in
           let a = a0 in
           
-# 902 "parser_cocci_menhir.mly"
+# 903 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.Nest(P.clt2mcode "<..." a, b,
                          P.clt2mcode "...>" c, List.concat w, false)) )
-# 28670 "parser_cocci_menhir.ml"
+# 28671 "parser_cocci_menhir.ml"
           
         in
         
-# 1619 "parser_cocci_menhir.mly"
+# 1620 "parser_cocci_menhir.mly"
                                               ( a::b )
-# 28676 "parser_cocci_menhir.ml"
+# 28677 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28714,14 +28715,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let c0 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 28718 "parser_cocci_menhir.ml"
+# 28719 "parser_cocci_menhir.ml"
         ) = Obj.magic c0 in
         let b0 : 'tv_nest_start = Obj.magic b0 in
         let w0 : 'tv_list_whenppdecs_ = Obj.magic w0 in
         let a0 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 28725 "parser_cocci_menhir.ml"
+# 28726 "parser_cocci_menhir.ml"
         ) = Obj.magic a0 in
         let _startpos = _startpos_a0_ in
         let _endpos = _endpos_b_ in
@@ -28731,16 +28732,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           let w = w0 in
           let a = a0 in
           
-# 905 "parser_cocci_menhir.mly"
+# 906 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.Nest(P.clt2mcode "<+..." a, b,
                          P.clt2mcode "...+>" c, List.concat w, true)) )
-# 28738 "parser_cocci_menhir.ml"
+# 28739 "parser_cocci_menhir.ml"
           
         in
         
-# 1619 "parser_cocci_menhir.mly"
+# 1620 "parser_cocci_menhir.mly"
                                               ( a::b )
-# 28744 "parser_cocci_menhir.ml"
+# 28745 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28776,14 +28777,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let c0 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 28780 "parser_cocci_menhir.ml"
+# 28781 "parser_cocci_menhir.ml"
         ) = Obj.magic c0 in
         let b0 : 'tv_nest_start = Obj.magic b0 in
         let w0 : 'tv_list_whenppdecs_ = Obj.magic w0 in
         let a0 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 28787 "parser_cocci_menhir.ml"
+# 28788 "parser_cocci_menhir.ml"
         ) = Obj.magic a0 in
         let _startpos = _startpos_a0_ in
         let _endpos = _endpos_c0_ in
@@ -28793,16 +28794,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           let w = w0 in
           let a = a0 in
           
-# 902 "parser_cocci_menhir.mly"
+# 903 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.Nest(P.clt2mcode "<..." a, b,
                          P.clt2mcode "...>" c, List.concat w, false)) )
-# 28800 "parser_cocci_menhir.ml"
+# 28801 "parser_cocci_menhir.ml"
           
         in
         
-# 1620 "parser_cocci_menhir.mly"
+# 1621 "parser_cocci_menhir.mly"
                                        ( [a] )
-# 28806 "parser_cocci_menhir.ml"
+# 28807 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28838,14 +28839,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let c0 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 28842 "parser_cocci_menhir.ml"
+# 28843 "parser_cocci_menhir.ml"
         ) = Obj.magic c0 in
         let b0 : 'tv_nest_start = Obj.magic b0 in
         let w0 : 'tv_list_whenppdecs_ = Obj.magic w0 in
         let a0 : (
 # 73 "parser_cocci_menhir.mly"
        (Data.clt)
-# 28849 "parser_cocci_menhir.ml"
+# 28850 "parser_cocci_menhir.ml"
         ) = Obj.magic a0 in
         let _startpos = _startpos_a0_ in
         let _endpos = _endpos_c0_ in
@@ -28855,16 +28856,16 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           let w = w0 in
           let a = a0 in
           
-# 905 "parser_cocci_menhir.mly"
+# 906 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.Nest(P.clt2mcode "<+..." a, b,
                          P.clt2mcode "...+>" c, List.concat w, true)) )
-# 28862 "parser_cocci_menhir.ml"
+# 28863 "parser_cocci_menhir.ml"
           
         in
         
-# 1620 "parser_cocci_menhir.mly"
+# 1621 "parser_cocci_menhir.mly"
                                        ( [a] )
-# 28868 "parser_cocci_menhir.ml"
+# 28869 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28892,9 +28893,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_seq_startne_toplevel_after_dots_init_ = 
-# 1621 "parser_cocci_menhir.mly"
+# 1622 "parser_cocci_menhir.mly"
                                      ( (Ast0.wrap(Ast0.Exp(_1)))::_2 )
-# 28898 "parser_cocci_menhir.ml"
+# 28899 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28922,9 +28923,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_toplevel_seq_startne_toplevel_after_dots_init_ = 
-# 1622 "parser_cocci_menhir.mly"
+# 1623 "parser_cocci_menhir.mly"
                                           ( _1@_2 )
-# 28928 "parser_cocci_menhir.ml"
+# 28929 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28946,9 +28947,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_typedef_ident = 
-# 1530 "parser_cocci_menhir.mly"
+# 1531 "parser_cocci_menhir.mly"
          ( Ast0.wrap(Ast0.TypeName(P.id2mcode _1)) )
-# 28952 "parser_cocci_menhir.ml"
+# 28953 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28969,15 +28970,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 64 "parser_cocci_menhir.mly"
        (Parse_aux.info)
-# 28973 "parser_cocci_menhir.ml"
+# 28974 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_typedef_ident = 
-# 1532 "parser_cocci_menhir.mly"
+# 1533 "parser_cocci_menhir.mly"
          ( let (nm,pure,clt) = _1 in
         Ast0.wrap(Ast0.MetaType(P.clt2mcode nm clt,pure)) )
-# 28981 "parser_cocci_menhir.ml"
+# 28982 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -28999,9 +29000,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_unary_expr_eexpr_dot_expressions_ = 
-# 1298 "parser_cocci_menhir.mly"
+# 1299 "parser_cocci_menhir.mly"
                                          ( _1 )
-# 29005 "parser_cocci_menhir.ml"
+# 29006 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29028,14 +29029,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29032 "parser_cocci_menhir.ml"
+# 29033 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_dot_expressions_ = 
-# 1300 "parser_cocci_menhir.mly"
+# 1301 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Infix (_2, P.clt2mcode Ast.Inc _1)) )
-# 29039 "parser_cocci_menhir.ml"
+# 29040 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29062,14 +29063,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29066 "parser_cocci_menhir.ml"
+# 29067 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_dot_expressions_ = 
-# 1302 "parser_cocci_menhir.mly"
+# 1303 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Infix (_2, P.clt2mcode Ast.Dec _1)) )
-# 29073 "parser_cocci_menhir.ml"
+# 29074 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29097,9 +29098,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_dot_expressions_ = 
-# 1304 "parser_cocci_menhir.mly"
+# 1305 "parser_cocci_menhir.mly"
       ( let mcode = _1 in Ast0.wrap(Ast0.Unary(_2, mcode)) )
-# 29103 "parser_cocci_menhir.ml"
+# 29104 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29126,15 +29127,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29130 "parser_cocci_menhir.ml"
+# 29131 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_dot_expressions_ = 
-# 1306 "parser_cocci_menhir.mly"
+# 1307 "parser_cocci_menhir.mly"
       ( let mcode = P.clt2mcode Ast.Not _1 in
       Ast0.wrap(Ast0.Unary(_2, mcode)) )
-# 29138 "parser_cocci_menhir.ml"
+# 29139 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29161,14 +29162,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 58 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29165 "parser_cocci_menhir.ml"
+# 29166 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_dot_expressions_ = 
-# 1309 "parser_cocci_menhir.mly"
+# 1310 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.SizeOfExpr (P.clt2mcode "sizeof" _1, _2)) )
-# 29172 "parser_cocci_menhir.ml"
+# 29173 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29204,27 +29205,27 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let rp : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29208 "parser_cocci_menhir.ml"
+# 29209 "parser_cocci_menhir.ml"
         ) = Obj.magic rp in
         let t : 'tv_ctype = Obj.magic t in
         let lp : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29214 "parser_cocci_menhir.ml"
+# 29215 "parser_cocci_menhir.ml"
         ) = Obj.magic lp in
         let s : (
 # 58 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29219 "parser_cocci_menhir.ml"
+# 29220 "parser_cocci_menhir.ml"
         ) = Obj.magic s in
         let _startpos = _startpos_s_ in
         let _endpos = _endpos_rp_ in
         let _v : 'tv_unary_expr_eexpr_dot_expressions_ = 
-# 1311 "parser_cocci_menhir.mly"
+# 1312 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.SizeOfType (P.clt2mcode "sizeof" s,
                                    P.clt2mcode "(" lp,t,
                                    P.clt2mcode ")" rp)) )
-# 29228 "parser_cocci_menhir.ml"
+# 29229 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29246,9 +29247,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_unary_expr_eexpr_invalid_ = 
-# 1298 "parser_cocci_menhir.mly"
+# 1299 "parser_cocci_menhir.mly"
                                          ( _1 )
-# 29252 "parser_cocci_menhir.ml"
+# 29253 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29275,14 +29276,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29279 "parser_cocci_menhir.ml"
+# 29280 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_invalid_ = 
-# 1300 "parser_cocci_menhir.mly"
+# 1301 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Infix (_2, P.clt2mcode Ast.Inc _1)) )
-# 29286 "parser_cocci_menhir.ml"
+# 29287 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29309,14 +29310,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29313 "parser_cocci_menhir.ml"
+# 29314 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_invalid_ = 
-# 1302 "parser_cocci_menhir.mly"
+# 1303 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Infix (_2, P.clt2mcode Ast.Dec _1)) )
-# 29320 "parser_cocci_menhir.ml"
+# 29321 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29344,9 +29345,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_invalid_ = 
-# 1304 "parser_cocci_menhir.mly"
+# 1305 "parser_cocci_menhir.mly"
       ( let mcode = _1 in Ast0.wrap(Ast0.Unary(_2, mcode)) )
-# 29350 "parser_cocci_menhir.ml"
+# 29351 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29373,15 +29374,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29377 "parser_cocci_menhir.ml"
+# 29378 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_invalid_ = 
-# 1306 "parser_cocci_menhir.mly"
+# 1307 "parser_cocci_menhir.mly"
       ( let mcode = P.clt2mcode Ast.Not _1 in
       Ast0.wrap(Ast0.Unary(_2, mcode)) )
-# 29385 "parser_cocci_menhir.ml"
+# 29386 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29408,14 +29409,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 58 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29412 "parser_cocci_menhir.ml"
+# 29413 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_invalid_ = 
-# 1309 "parser_cocci_menhir.mly"
+# 1310 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.SizeOfExpr (P.clt2mcode "sizeof" _1, _2)) )
-# 29419 "parser_cocci_menhir.ml"
+# 29420 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29451,27 +29452,27 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let rp : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29455 "parser_cocci_menhir.ml"
+# 29456 "parser_cocci_menhir.ml"
         ) = Obj.magic rp in
         let t : 'tv_ctype = Obj.magic t in
         let lp : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29461 "parser_cocci_menhir.ml"
+# 29462 "parser_cocci_menhir.ml"
         ) = Obj.magic lp in
         let s : (
 # 58 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29466 "parser_cocci_menhir.ml"
+# 29467 "parser_cocci_menhir.ml"
         ) = Obj.magic s in
         let _startpos = _startpos_s_ in
         let _endpos = _endpos_rp_ in
         let _v : 'tv_unary_expr_eexpr_invalid_ = 
-# 1311 "parser_cocci_menhir.mly"
+# 1312 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.SizeOfType (P.clt2mcode "sizeof" s,
                                    P.clt2mcode "(" lp,t,
                                    P.clt2mcode ")" rp)) )
-# 29475 "parser_cocci_menhir.ml"
+# 29476 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29493,9 +29494,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_unary_expr_eexpr_nest_expressions_ = 
-# 1298 "parser_cocci_menhir.mly"
+# 1299 "parser_cocci_menhir.mly"
                                          ( _1 )
-# 29499 "parser_cocci_menhir.ml"
+# 29500 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29522,14 +29523,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29526 "parser_cocci_menhir.ml"
+# 29527 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_nest_expressions_ = 
-# 1300 "parser_cocci_menhir.mly"
+# 1301 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Infix (_2, P.clt2mcode Ast.Inc _1)) )
-# 29533 "parser_cocci_menhir.ml"
+# 29534 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29556,14 +29557,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29560 "parser_cocci_menhir.ml"
+# 29561 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_nest_expressions_ = 
-# 1302 "parser_cocci_menhir.mly"
+# 1303 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Infix (_2, P.clt2mcode Ast.Dec _1)) )
-# 29567 "parser_cocci_menhir.ml"
+# 29568 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29591,9 +29592,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_nest_expressions_ = 
-# 1304 "parser_cocci_menhir.mly"
+# 1305 "parser_cocci_menhir.mly"
       ( let mcode = _1 in Ast0.wrap(Ast0.Unary(_2, mcode)) )
-# 29597 "parser_cocci_menhir.ml"
+# 29598 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29620,15 +29621,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29624 "parser_cocci_menhir.ml"
+# 29625 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_nest_expressions_ = 
-# 1306 "parser_cocci_menhir.mly"
+# 1307 "parser_cocci_menhir.mly"
       ( let mcode = P.clt2mcode Ast.Not _1 in
       Ast0.wrap(Ast0.Unary(_2, mcode)) )
-# 29632 "parser_cocci_menhir.ml"
+# 29633 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29655,14 +29656,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 58 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29659 "parser_cocci_menhir.ml"
+# 29660 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_eexpr_nest_expressions_ = 
-# 1309 "parser_cocci_menhir.mly"
+# 1310 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.SizeOfExpr (P.clt2mcode "sizeof" _1, _2)) )
-# 29666 "parser_cocci_menhir.ml"
+# 29667 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29698,27 +29699,27 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let rp : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29702 "parser_cocci_menhir.ml"
+# 29703 "parser_cocci_menhir.ml"
         ) = Obj.magic rp in
         let t : 'tv_ctype = Obj.magic t in
         let lp : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29708 "parser_cocci_menhir.ml"
+# 29709 "parser_cocci_menhir.ml"
         ) = Obj.magic lp in
         let s : (
 # 58 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29713 "parser_cocci_menhir.ml"
+# 29714 "parser_cocci_menhir.ml"
         ) = Obj.magic s in
         let _startpos = _startpos_s_ in
         let _endpos = _endpos_rp_ in
         let _v : 'tv_unary_expr_eexpr_nest_expressions_ = 
-# 1311 "parser_cocci_menhir.mly"
+# 1312 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.SizeOfType (P.clt2mcode "sizeof" s,
                                    P.clt2mcode "(" lp,t,
                                    P.clt2mcode ")" rp)) )
-# 29722 "parser_cocci_menhir.ml"
+# 29723 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29740,9 +29741,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_unary_expr_expr_invalid_ = 
-# 1298 "parser_cocci_menhir.mly"
+# 1299 "parser_cocci_menhir.mly"
                                          ( _1 )
-# 29746 "parser_cocci_menhir.ml"
+# 29747 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29769,14 +29770,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29773 "parser_cocci_menhir.ml"
+# 29774 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_expr_invalid_ = 
-# 1300 "parser_cocci_menhir.mly"
+# 1301 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Infix (_2, P.clt2mcode Ast.Inc _1)) )
-# 29780 "parser_cocci_menhir.ml"
+# 29781 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29803,14 +29804,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 85 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29807 "parser_cocci_menhir.ml"
+# 29808 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_expr_invalid_ = 
-# 1302 "parser_cocci_menhir.mly"
+# 1303 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.Infix (_2, P.clt2mcode Ast.Dec _1)) )
-# 29814 "parser_cocci_menhir.ml"
+# 29815 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29838,9 +29839,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_expr_invalid_ = 
-# 1304 "parser_cocci_menhir.mly"
+# 1305 "parser_cocci_menhir.mly"
       ( let mcode = _1 in Ast0.wrap(Ast0.Unary(_2, mcode)) )
-# 29844 "parser_cocci_menhir.ml"
+# 29845 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29867,15 +29868,15 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29871 "parser_cocci_menhir.ml"
+# 29872 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_expr_invalid_ = 
-# 1306 "parser_cocci_menhir.mly"
+# 1307 "parser_cocci_menhir.mly"
       ( let mcode = P.clt2mcode Ast.Not _1 in
       Ast0.wrap(Ast0.Unary(_2, mcode)) )
-# 29879 "parser_cocci_menhir.ml"
+# 29880 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29902,14 +29903,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 58 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29906 "parser_cocci_menhir.ml"
+# 29907 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_unary_expr_expr_invalid_ = 
-# 1309 "parser_cocci_menhir.mly"
+# 1310 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.SizeOfExpr (P.clt2mcode "sizeof" _1, _2)) )
-# 29913 "parser_cocci_menhir.ml"
+# 29914 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29945,27 +29946,27 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let rp : (
 # 77 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29949 "parser_cocci_menhir.ml"
+# 29950 "parser_cocci_menhir.ml"
         ) = Obj.magic rp in
         let t : 'tv_ctype = Obj.magic t in
         let lp : (
 # 76 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29955 "parser_cocci_menhir.ml"
+# 29956 "parser_cocci_menhir.ml"
         ) = Obj.magic lp in
         let s : (
 # 58 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29960 "parser_cocci_menhir.ml"
+# 29961 "parser_cocci_menhir.ml"
         ) = Obj.magic s in
         let _startpos = _startpos_s_ in
         let _endpos = _endpos_rp_ in
         let _v : 'tv_unary_expr_expr_invalid_ = 
-# 1311 "parser_cocci_menhir.mly"
+# 1312 "parser_cocci_menhir.mly"
       ( Ast0.wrap(Ast0.SizeOfType (P.clt2mcode "sizeof" s,
                                    P.clt2mcode "(" lp,t,
                                    P.clt2mcode ")" rp)) )
-# 29969 "parser_cocci_menhir.ml"
+# 29970 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -29986,14 +29987,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 93 "parser_cocci_menhir.mly"
        (Data.clt)
-# 29990 "parser_cocci_menhir.ml"
+# 29991 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_unary_op = 
-# 1315 "parser_cocci_menhir.mly"
+# 1316 "parser_cocci_menhir.mly"
                   ( P.clt2mcode Ast.GetRef _1 )
-# 29997 "parser_cocci_menhir.ml"
+# 29998 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -30014,14 +30015,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 99 "parser_cocci_menhir.mly"
        (Data.clt)
-# 30018 "parser_cocci_menhir.ml"
+# 30019 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_unary_op = 
-# 1316 "parser_cocci_menhir.mly"
+# 1317 "parser_cocci_menhir.mly"
            ( P.clt2mcode Ast.DeRef _1 )
-# 30025 "parser_cocci_menhir.ml"
+# 30026 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -30042,14 +30043,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 98 "parser_cocci_menhir.mly"
        (Data.clt)
-# 30046 "parser_cocci_menhir.ml"
+# 30047 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_unary_op = 
-# 1317 "parser_cocci_menhir.mly"
+# 1318 "parser_cocci_menhir.mly"
            ( P.clt2mcode Ast.UnPlus _1 )
-# 30053 "parser_cocci_menhir.ml"
+# 30054 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -30070,14 +30071,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 98 "parser_cocci_menhir.mly"
        (Data.clt)
-# 30074 "parser_cocci_menhir.ml"
+# 30075 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_unary_op = 
-# 1318 "parser_cocci_menhir.mly"
+# 1319 "parser_cocci_menhir.mly"
            ( P.clt2mcode Ast.UnMinus _1 )
-# 30081 "parser_cocci_menhir.ml"
+# 30082 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -30098,14 +30099,14 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _1 : (
 # 99 "parser_cocci_menhir.mly"
        (Data.clt)
-# 30102 "parser_cocci_menhir.ml"
+# 30103 "parser_cocci_menhir.ml"
         ) = Obj.magic _1 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__1_ in
         let _v : 'tv_unary_op = 
-# 1319 "parser_cocci_menhir.mly"
+# 1320 "parser_cocci_menhir.mly"
            ( P.clt2mcode Ast.Tilde _1 )
-# 30109 "parser_cocci_menhir.ml"
+# 30110 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -30133,9 +30134,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_when_start = 
-# 1744 "parser_cocci_menhir.mly"
+# 1745 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.DOTS((Ast0.wrap(Ast0.Exp(_1)))::_2)) )
-# 30139 "parser_cocci_menhir.ml"
+# 30140 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -30163,9 +30164,9 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__2_ in
         let _v : 'tv_when_start = 
-# 1746 "parser_cocci_menhir.mly"
+# 1747 "parser_cocci_menhir.mly"
     ( Ast0.wrap(Ast0.DOTS(_1@_2)) )
-# 30169 "parser_cocci_menhir.ml"
+# 30170 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -30183,13 +30184,13 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
           MenhirLib.EngineTypes.endp = _endpos_w_;
           MenhirLib.EngineTypes.next = _menhir_stack;
           } = _menhir_stack in
-        let w : 'tv_whens_when_start_rule_elem_statement_ = Obj.magic w in
+        let w : 'tv_whens_when_start_rule_elem_statement_any_strict_ = Obj.magic w in
         let _startpos = _startpos_w_ in
         let _endpos = _endpos_w_ in
         let _v : 'tv_whenppdecs = 
-# 909 "parser_cocci_menhir.mly"
+# 910 "parser_cocci_menhir.mly"
     ( w )
-# 30193 "parser_cocci_menhir.ml"
+# 30194 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -30222,10 +30223,10 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let w : 'tv_when_start = Obj.magic w in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
-        let _v : 'tv_whens_when_start_rule_elem_statement_ = 
-# 1812 "parser_cocci_menhir.mly"
+        let _v : 'tv_whens_when_start_rule_elem_statement_any_strict_ = 
+# 1813 "parser_cocci_menhir.mly"
                                          ( [Ast0.WhenNot w] )
-# 30229 "parser_cocci_menhir.ml"
+# 30230 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -30258,10 +30259,10 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let w : 'tv_rule_elem_statement = Obj.magic w in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
-        let _v : 'tv_whens_when_start_rule_elem_statement_ = 
-# 1813 "parser_cocci_menhir.mly"
+        let _v : 'tv_whens_when_start_rule_elem_statement_any_strict_ = 
+# 1814 "parser_cocci_menhir.mly"
                                              ( [Ast0.WhenAlways w] )
-# 30265 "parser_cocci_menhir.ml"
+# 30266 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -30290,10 +30291,10 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let _2 : 'tv_comma_list_any_strict_ = Obj.magic _2 in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__3_ in
-        let _v : 'tv_whens_when_start_rule_elem_statement_ = 
-# 1815 "parser_cocci_menhir.mly"
+        let _v : 'tv_whens_when_start_rule_elem_statement_any_strict_ = 
+# 1816 "parser_cocci_menhir.mly"
       ( List.map (function x -> Ast0.WhenModifier(x)) _2 )
-# 30297 "parser_cocci_menhir.ml"
+# 30298 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -30326,10 +30327,10 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let e : 'tv_eexpr = Obj.magic e in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
-        let _v : 'tv_whens_when_start_rule_elem_statement_ = 
-# 1816 "parser_cocci_menhir.mly"
+        let _v : 'tv_whens_when_start_rule_elem_statement_any_strict_ = 
+# 1817 "parser_cocci_menhir.mly"
                                         ( [Ast0.WhenNotTrue e] )
-# 30333 "parser_cocci_menhir.ml"
+# 30334 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -30362,10 +30363,10 @@ module MenhirInterpreter = MenhirLib.TableInterpreter.Make (struct
         let e : 'tv_eexpr = Obj.magic e in
         let _startpos = _startpos__1_ in
         let _endpos = _endpos__4_ in
-        let _v : 'tv_whens_when_start_rule_elem_statement_ = 
-# 1817 "parser_cocci_menhir.mly"
+        let _v : 'tv_whens_when_start_rule_elem_statement_any_strict_ = 
+# 1818 "parser_cocci_menhir.mly"
                                          ( [Ast0.WhenNotFalse e] )
-# 30369 "parser_cocci_menhir.ml"
+# 30370 "parser_cocci_menhir.ml"
          in
         _menhir_env.MenhirLib.EngineTypes.stack <- {
           MenhirLib.EngineTypes.state = _menhir_s;
@@ -30389,7 +30390,7 @@ let rec script_meta_main =
     (Obj.magic (MenhirInterpreter.entry 1549 lexer lexbuf) : (
 # 159 "parser_cocci_menhir.mly"
        (string * (string * string))
-# 30393 "parser_cocci_menhir.ml"
+# 30394 "parser_cocci_menhir.ml"
     ))
 
 and rule_name =
@@ -30397,7 +30398,7 @@ and rule_name =
     (Obj.magic (MenhirInterpreter.entry 1477 lexer lexbuf) : (
 # 153 "parser_cocci_menhir.mly"
       (Ast_cocci.rulename)
-# 30401 "parser_cocci_menhir.ml"
+# 30402 "parser_cocci_menhir.ml"
     ))
 
 and reinit =
@@ -30405,7 +30406,7 @@ and reinit =
     (Obj.magic (MenhirInterpreter.entry 1475 lexer lexbuf) : (
 # 131 "parser_cocci_menhir.mly"
       (unit)
-# 30409 "parser_cocci_menhir.ml"
+# 30410 "parser_cocci_menhir.ml"
     ))
 
 and plus_main =
@@ -30413,7 +30414,7 @@ and plus_main =
     (Obj.magic (MenhirInterpreter.entry 1439 lexer lexbuf) : (
 # 140 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 30417 "parser_cocci_menhir.ml"
+# 30418 "parser_cocci_menhir.ml"
     ))
 
 and plus_exp_main =
@@ -30421,7 +30422,7 @@ and plus_exp_main =
     (Obj.magic (MenhirInterpreter.entry 1430 lexer lexbuf) : (
 # 143 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 30425 "parser_cocci_menhir.ml"
+# 30426 "parser_cocci_menhir.ml"
     ))
 
 and never_used =
@@ -30429,7 +30430,7 @@ and never_used =
     (Obj.magic (MenhirInterpreter.entry 1424 lexer lexbuf) : (
 # 168 "parser_cocci_menhir.mly"
       (unit)
-# 30433 "parser_cocci_menhir.ml"
+# 30434 "parser_cocci_menhir.ml"
     ))
 
 and minus_main =
@@ -30437,7 +30438,7 @@ and minus_main =
     (Obj.magic (MenhirInterpreter.entry 1338 lexer lexbuf) : (
 # 134 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 30441 "parser_cocci_menhir.ml"
+# 30442 "parser_cocci_menhir.ml"
     ))
 
 and minus_exp_main =
@@ -30445,7 +30446,7 @@ and minus_exp_main =
     (Obj.magic (MenhirInterpreter.entry 1314 lexer lexbuf) : (
 # 137 "parser_cocci_menhir.mly"
       (Ast0_cocci.rule)
-# 30449 "parser_cocci_menhir.ml"
+# 30450 "parser_cocci_menhir.ml"
     ))
 
 and meta_main =
@@ -30453,7 +30454,7 @@ and meta_main =
     (Obj.magic (MenhirInterpreter.entry 1311 lexer lexbuf) : (
 # 157 "parser_cocci_menhir.mly"
       ((Ast_cocci.metavar,Ast_cocci.metavar) Common.either list)
-# 30457 "parser_cocci_menhir.ml"
+# 30458 "parser_cocci_menhir.ml"
     ))
 
 and iso_rule_name =
@@ -30461,7 +30462,7 @@ and iso_rule_name =
     (Obj.magic (MenhirInterpreter.entry 1307 lexer lexbuf) : (
 # 149 "parser_cocci_menhir.mly"
       (Ast_cocci.rulename)
-# 30465 "parser_cocci_menhir.ml"
+# 30466 "parser_cocci_menhir.ml"
     ))
 
 and iso_meta_main =
@@ -30469,7 +30470,7 @@ and iso_meta_main =
     (Obj.magic (MenhirInterpreter.entry 1104 lexer lexbuf) : (
 # 165 "parser_cocci_menhir.mly"
       ((Ast_cocci.metavar,Ast_cocci.metavar) Common.either list)
-# 30473 "parser_cocci_menhir.ml"
+# 30474 "parser_cocci_menhir.ml"
     ))
 
 and iso_main =
@@ -30477,7 +30478,7 @@ and iso_main =
     (Obj.magic (MenhirInterpreter.entry 10 lexer lexbuf) : (
 # 162 "parser_cocci_menhir.mly"
       (Ast0_cocci.anything list list)
-# 30481 "parser_cocci_menhir.ml"
+# 30482 "parser_cocci_menhir.ml"
     ))
 
 and include_main =
@@ -30485,7 +30486,7 @@ and include_main =
     (Obj.magic (MenhirInterpreter.entry 0 lexer lexbuf) : (
 # 146 "parser_cocci_menhir.mly"
       ((string,string) Common.either list)
-# 30489 "parser_cocci_menhir.ml"
+# 30490 "parser_cocci_menhir.ml"
     ))
 
 
index ea76966..2aef9fb 100644 (file)
@@ -146,7 +146,7 @@ type token =
   | TDmOp of (Ast_cocci.arithOp * Data.clt)
   | TDisable
   | TDepends
-  | TDefineParam of (Data.clt * token * int)
+  | TDefineParam of (Data.clt * token * int * int)
   | TDefine of (Data.clt * token)
   | TDefault of (Data.clt)
   | TDeclarerId of (string * Data.clt)
index 151401b..23c1c1e 100644 (file)
@@ -79,7 +79,7 @@ module P = Parse_aux
 %token <string>  TPathIsoFile
 %token <string * Data.clt> TIncludeL TIncludeNL
 %token <Data.clt * token> TDefine
-%token <Data.clt * token * int> TDefineParam
+%token <Data.clt * token * int * int> TDefineParam
 %token <string * Data.clt> TMinusFile TPlusFile
 
 %token <Data.clt> TInc TDec
@@ -687,11 +687,12 @@ defineop:
              Ast0.wrap Ast0.NoParams,
              body)) }
 | TDefineParam define_param_list_option TCPar
-    { let (clt,ident,parenoff) = $1 in
+    { let (clt,ident,parenoff,parencol) = $1 in
+      (* clt is the start of the #define itself *)
       let (arity,line,lline,offset,col,strbef,straft,pos) = clt in
       let lp =
        P.clt2mcode "("
-         (arity,line,lline,parenoff,0,[],[],Ast0.NoMetaPos) in
+         (arity,line,lline,parenoff,parencol,[],[],Ast0.NoMetaPos) in
       function body ->
        Ast0.wrap
          (Ast0.Define
@@ -905,7 +906,7 @@ stm_dots:
     { Ast0.wrap(Ast0.Nest(P.clt2mcode "<+..." a, b,
                          P.clt2mcode "...+>" c, List.concat w, true)) }
 
-whenppdecs: w=whens(when_start,rule_elem_statement)
+whenppdecs: w=whens(when_start,rule_elem_statement,any_strict)
     { w }
 
 /* a statement that fits into a single rule_elem.  should nests be included?
@@ -1808,7 +1809,7 @@ edots_when(dotter,when_grammar):
     d=dotter                                      { (d,None) }
   | d=dotter TWhen TNotEq w=when_grammar TLineEnd { (d,Some w) }
 
-whens(when_grammar,simple_when_grammar):
+whens(when_grammar,simple_when_grammar,any_strict):
     TWhen TNotEq w=when_grammar TLineEnd { [Ast0.WhenNot w] }
   | TWhen TEq w=simple_when_grammar TLineEnd { [Ast0.WhenAlways w] }
   | TWhen comma_list(any_strict) TLineEnd
@@ -1822,6 +1823,11 @@ any_strict:
   | TForall { Ast.WhenForall }
   | TExists { Ast.WhenExists }
 
+any_only:
+    TAny    { Ast.WhenAny }
+  | TForall { Ast.WhenForall }
+  | TExists { Ast.WhenExists }
+
 /*****************************************************************************
 *
 *
index cc133bd..918d933 100644 (file)
@@ -95,7 +95,7 @@ let print_pos = function
   | _ -> ()
 
 let mcode fn = function
-    (x, _, Ast.MINUS(_,plus_stream), pos) ->
+    (x, _, Ast.MINUS(_,_,adj,plus_stream), pos) ->
       if !print_minus_flag
       then print_string (if !Flag.sgrep_mode2 then "*" else "-");
       fn x; print_pos pos;
@@ -112,7 +112,7 @@ let mcode fn = function
       print_string_befaft fn x info
 
 let print_mcodekind = function
-    Ast.MINUS(_,plus_stream) ->
+    Ast.MINUS(_,_,_,plus_stream) ->
       print_string "MINUS";
       print_anything ">>> " plus_stream
   | Ast.CONTEXT(_,plus_streams) ->
@@ -623,9 +623,8 @@ and print_define_param param =
 
 and statement arity s =
   match Ast.unwrap s with
-    Ast.Seq(lbrace,decls,body,rbrace) ->
+    Ast.Seq(lbrace,body,rbrace) ->
       rule_elem arity lbrace;
-      dots force_newline (statement arity) decls;
       dots force_newline (statement arity) body;
       rule_elem arity rbrace
   | Ast.IfThen(header,branch,(_,_,_,aft)) ->
@@ -652,9 +651,8 @@ and statement arity s =
       List.iter (function x -> case_line arity x; force_newline()) cases;
       rule_elem arity rb
   | Ast.Atomic(re) -> rule_elem arity re
-  | Ast.FunDecl(header,lbrace,decls,body,rbrace) ->
+  | Ast.FunDecl(header,lbrace,body,rbrace) ->
       rule_elem arity header; rule_elem arity lbrace;
-      dots force_newline (statement arity) decls;
       dots force_newline (statement arity) body;
       rule_elem arity rbrace
   | Ast.Disj([stmt_dots]) ->
index 4209f2f..d418203 100644 (file)
@@ -327,7 +327,7 @@ and contains_only_minus =
        | _ -> false)
     | Ast0.CONTEXT(mc) -> false
     | _ -> false in
-  let mcode (_,_,_,mc,_) = mcodekind mc in
+  let mcode (_,_,_,mc,_,_) = mcodekind mc in
 
   let donothing r k e = mcodekind (Ast0.get_mcodekind e) && k e in
 
index f29e4f7..f5631a8 100644 (file)
@@ -522,13 +522,11 @@ and subtype f =
 
 let rec unify_statement s1 s2 =
   match (Ast.unwrap s1,Ast.unwrap s2) with
-    (Ast.Seq(lb1,d1,s1,rb1),Ast.Seq(lb2,d2,s2,rb2)) ->
+    (Ast.Seq(lb1,s1,rb1),Ast.Seq(lb2,s2,rb2)) ->
       conjunct_bindings (unify_rule_elem lb1 lb2)
        (conjunct_bindings
           (unify_dots unify_statement sdots s1 s2)
-          (conjunct_bindings
-             (unify_dots unify_statement sdots d1 d2)
-             (unify_rule_elem rb1 rb2)))
+          (unify_rule_elem rb1 rb2))
   | (Ast.IfThen(h1,thn1,_),Ast.IfThen(h2,thn2,_)) ->
       conjunct_bindings (unify_rule_elem h1 h2) (unify_statement thn1 thn2)
   | (Ast.IfThenElse(h1,thn1,e1,els1,_),Ast.IfThenElse(h2,thn2,e2,els2,_)) ->
@@ -558,12 +556,11 @@ let rec unify_statement s1 s2 =
           s2)
   | (Ast.Nest(s1,_,_,_,_),Ast.Nest(s2,_,_,_,_)) ->
       unify_dots unify_statement sdots s1 s2
-  | (Ast.FunDecl(h1,lb1,d1,s1,rb1),Ast.FunDecl(h2,lb2,d2,s2,rb2)) ->
+  | (Ast.FunDecl(h1,lb1,s1,rb1),Ast.FunDecl(h2,lb2,s2,rb2)) ->
       conjunct_bindings (unify_rule_elem h1 h2)
        (conjunct_bindings (unify_rule_elem lb1 lb2)
-          (conjunct_bindings (unify_dots unify_statement sdots d1 d2)
-             (conjunct_bindings (unify_dots unify_statement sdots s1 s2)
-                (unify_rule_elem rb1 rb2))))
+          (conjunct_bindings (unify_dots unify_statement sdots s1 s2)
+             (unify_rule_elem rb1 rb2)))
   | (Ast.Define(h1,s1),Ast.Define(h2,s2)) ->
       conjunct_bindings (unify_rule_elem h1 h2)
        (unify_dots unify_statement sdots s1 s2)
index 4002eb9..c113c4d 100644 (file)
@@ -40,7 +40,7 @@ let rec nub = function
 let minus_checker name = let id = Ast0.unwrap_mcode name in [id]
 
 (* take only what is in the plus code *)
-let plus_checker (nm,_,_,mc,_) =
+let plus_checker (nm,_,_,mc,_,_) =
   match mc with Ast0.PLUS -> [nm] | _ -> []
 
 let get_free checker t =
index 0772e54..39c5b46 100644 (file)
@@ -26,6 +26,8 @@ module U = Pretty_print_cocci
 
 let quiet = ref true (* true = no decoration on - context, etc *)
 
+let full_ids = ref false (* true = print rule name as well *)
+
 let start_block str =
   force_newline(); print_string "  "; open_box 0
 
@@ -77,7 +79,7 @@ let mcodekind brackets fn x info mc =
        (function x ->
          print_string lb; fn x; print_string rb)
        x plus_streams
-  | Ast0.PLUS -> fn x
+  | Ast0.PLUS -> print_int (info.Ast0.pos_info.Ast0.column); fn x
   | Ast0.MIXED(plus_streams) ->
       let (lb,rb) =
        if !quiet
@@ -91,7 +93,7 @@ let mcodekind brackets fn x info mc =
        x plus_streams);
   List.iter (function (s,_) -> print_string s) info.Ast0.strings_after
 
-let mcode fn (x,_,info,mc,pos) =
+let mcode fn (x,_,info,mc,pos,adj) =
   let fn x = fn x; meta_pos !pos in
   mcodekind (Some info.Ast0.pos_info.Ast0.line_start)(*None*) fn x info mc
 
@@ -99,7 +101,9 @@ let print_context x fn =
   mcodekind (Some (Ast0.get_line x)) fn () (Ast0.get_info x)
     (Ast0.get_mcodekind x)
 
-let print_meta (_,name) = print_string name
+let print_meta (ctx,name) =
+  if !full_ids then (print_string ctx; print_string ":");
+  print_string name
 
 (* --------------------------------------------------------------------- *)
 (* --------------------------------------------------------------------- *)
@@ -431,7 +435,7 @@ and statement arity s =
          mcode print_string iff; print_string " "; mcode print_string_box lp;
          expression exp; close_box(); mcode print_string rp; print_string " ";
          statement arity branch1;
-         mcode (function _ -> ()) ((),(),info,aft,ref Ast0.NoMetaPos)
+         mcode (function _ -> ()) ((),(),info,aft,ref Ast0.NoMetaPos,-1)
       | Ast0.IfThenElse(iff,lp,exp,rp,branch1,els,branch2,(info,aft)) ->
          print_string arity;
          mcode print_string iff; print_string " "; mcode print_string_box lp;
@@ -439,13 +443,13 @@ and statement arity s =
          statement arity branch1;
          print_string arity; mcode print_string els; print_string " ";
          statement arity branch2;
-         mcode (function _ -> ()) ((),(),info,aft,ref Ast0.NoMetaPos)
+         mcode (function _ -> ()) ((),(),info,aft,ref Ast0.NoMetaPos,-1)
       | Ast0.While(whl,lp,exp,rp,body,(info,aft)) ->
          print_string arity;
          mcode print_string whl; print_string " "; mcode print_string_box lp;
          expression exp; close_box(); mcode print_string rp; print_string " ";
          statement arity body;
-         mcode (function _ -> ()) ((),(),info,aft,ref Ast0.NoMetaPos)
+         mcode (function _ -> ()) ((),(),info,aft,ref Ast0.NoMetaPos,-1)
       | Ast0.Do(d,body,whl,lp,exp,rp,sem) ->
          print_string arity; mcode print_string d; print_string " ";
          statement arity body;
@@ -460,14 +464,14 @@ and statement arity s =
          print_option expression e2; mcode print_string sem2;
          print_option expression e3; close_box();
          mcode print_string rp; print_string " "; statement arity body;
-         mcode (function _ -> ()) ((),(),info,aft,ref Ast0.NoMetaPos)
+         mcode (function _ -> ()) ((),(),info,aft,ref Ast0.NoMetaPos,-1)
       | Ast0.Iterator(nm,lp,args,rp,body,(info,aft)) ->
          print_string arity;
          ident nm; print_string " "; mcode print_string_box lp;
          let _ = dots (function _ -> ()) expression args in
          close_box(); mcode print_string rp; print_string " ";
          statement arity body;
-         mcode (function _ -> ()) ((),(),info,aft,ref Ast0.NoMetaPos)
+         mcode (function _ -> ()) ((),(),info,aft,ref Ast0.NoMetaPos,-1)
       |        Ast0.Switch(switch,lp,exp,rp,lb,cases,rb) ->
          print_string arity;
          mcode print_string switch; print_string " ";
index d01dc06..15e8f5d 100644 (file)
@@ -411,8 +411,8 @@ let combiner bind option_default
     process_bef_aft s;
     let k s =
       match Ast.unwrap s with
-       Ast.Seq(lbrace,decls,body,rbrace) ->
-         multibind [rule_elem lbrace; statement_dots decls;
+       Ast.Seq(lbrace,body,rbrace) ->
+         multibind [rule_elem lbrace;
                      statement_dots body; rule_elem rbrace]
       | Ast.IfThen(header,branch,_) ->
          multibind [rule_elem header; statement branch]
@@ -436,10 +436,9 @@ let combiner bind option_default
       | Ast.Nest(stmt_dots,whn,_,_,_) ->
          bind (statement_dots stmt_dots)
            (multibind (List.map (whencode statement_dots statement) whn))
-      | Ast.FunDecl(header,lbrace,decls,body,rbrace) ->
+      | Ast.FunDecl(header,lbrace,body,rbrace) ->
          multibind [rule_elem header; rule_elem lbrace;
-                     statement_dots decls; statement_dots body;
-                     rule_elem rbrace]
+                     statement_dots body; rule_elem rbrace]
       | Ast.Define(header,body) ->
          bind (rule_elem header) (statement_dots body)
       | Ast.Dots(d,whn,_,_) | Ast.Circles(d,whn,_,_) | Ast.Stars(d,whn,_,_) ->
@@ -920,8 +919,8 @@ let rebuilder
     let k s =
       Ast.rewrap s
        (match Ast.unwrap s with
-         Ast.Seq(lbrace,decls,body,rbrace) ->
-           Ast.Seq(rule_elem lbrace, statement_dots decls,
+         Ast.Seq(lbrace,body,rbrace) ->
+           Ast.Seq(rule_elem lbrace,
                    statement_dots body, rule_elem rbrace)
        | Ast.IfThen(header,branch,aft) ->
            Ast.IfThen(rule_elem header, statement branch,aft)
@@ -946,9 +945,8 @@ let rebuilder
            Ast.Nest(statement_dots stmt_dots,
                     List.map (whencode statement_dots statement) whn,
                     multi,bef,aft)
-       | Ast.FunDecl(header,lbrace,decls,body,rbrace) ->
+       | Ast.FunDecl(header,lbrace,body,rbrace) ->
            Ast.FunDecl(rule_elem header,rule_elem lbrace,
-                       statement_dots decls,
                        statement_dots body, rule_elem rbrace)
        | Ast.Define(header,body) ->
            Ast.Define(rule_elem header,statement_dots body)
index 2938d41..4b97e31 100644 (file)
@@ -503,10 +503,12 @@ let visitor mode bind option_default
        (match Ast0.unwrap p with
          Ast0.VoidParam(ty) ->
            let (n,ty) = typeC ty in (n,Ast0.VoidParam(ty))
-       | Ast0.Param(ty,id) ->
+       | Ast0.Param(ty,Some id) ->
+           let ((ty_id_n,ty),id) = named_type ty id in
+           (ty_id_n, Ast0.Param(ty,Some id))
+       | Ast0.Param(ty,None) ->
            let (ty_n,ty) = typeC ty in
-           let (id_n,id) = get_option ident id in
-           (bind ty_n id_n, Ast0.Param(ty,id))
+           (ty_n, Ast0.Param(ty,None))
        | Ast0.MetaParam(name,pure) ->
            let (n,name) = meta_mcode name in
            (n,Ast0.MetaParam(name,pure))
index 262b089..e9758ae 100644 (file)
@@ -47,8 +47,8 @@ and constantrep c = match c with
   Ast_c.String (s,isWchar) -> s 
 | Ast_c.MultiString _ -> "TODO: MultiString"
 | Ast_c.Char (s,isWchar) -> s
-| Ast_c.Int s -> s 
-| Ast_c.Float (s,t) -> s
+| Ast_c.Int (s, _t) -> s 
+| Ast_c.Float (s, _t) -> s
 
 let call_pretty f a =
   let str = ref ([] : string list) in
index bcc2b2d..d75d5fa 100644 (file)
@@ -1,33 +1,39 @@
+                            Coccinelle 
+
+
 Coccinelle allows programmers to easily write some complex
 style-preserving source-to-source transformations on C source code,
 like for instance to perform some refactorings.
 
 To install Coccinelle from its source, see the instructions in install.txt.
-For more information on Coccinelle, type 'make docs' and see look at the 
-files in the docs/ directory. You may need to install the texlive-fonts-extra
-packages from your distribution to compile some of the LaTeX documentation
-files.
-
 Once you have installed Coccinelle (either from the source or from one
 of the binary form available on the Coccinelle website), You may have
 to setup a few environment variables so that the Coccinelle program
-know where to find its configuration files.
+knows where to find its configuration files.
 For bash do:
 
- source env.sh
 $ source env.sh
 
 For tcsh do:
 
- source env.csh 
 $ source env.csh 
 
 
 
 You can then test coccinelle with:
 
- spatch -sp_file demos/simple.cocci demos/simple.c
 $ spatch -sp_file demos/simple.cocci demos/simple.c
 
 If you downloaded the bytecode version of spatch you may first 
 have to install OCaml (which contains the 'ocamlrun' bytecode interpreter,
 the equivalent of 'java', the Java virtual machine, but for OCaml) and then do:
 
- ocamlrun spatch -sp_file demos/simple.cocci demos/simple.c
+  $ ocamlrun spatch -sp_file demos/simple.cocci demos/simple.c
+
+
+
+For more information on Coccinelle, type 'make docs' and have a look at the 
+files in the docs/ directory. You may need to install the texlive-fonts-extra
+packages from your distribution to compile some of the LaTeX documentation
+files.
+
index ff30864..42d5537 100644 (file)
@@ -1,19 +1,29 @@
-// clone: yacfe(master), coccinelle, acomment, 
-
 // ****************************************************************************
-// Prelude, this file is to be used with the -macro_file option of the C parser
+// Prelude, this file is used with -macro_file_builtins option of the C parser
 // ****************************************************************************
 
 /* This file contains:
  *   - macros found in <.h>
+ *   - macros found in ".h" 
+ *     but where we cant detect that it will be a "bad macro"
+ *   - hints, cf below.
+ * 
+ * A "bad macro" is a macro using free variables or when expanded
+ * that influence the control-flow of the code. In those cases it 
+ * is preferable to expand the macro so that the coccinelle engine
+ * has a more accurate representation of what is going on.
+ * 
+ *
+ *
+ *
+ * old: this file was also containing what is below but now we 
+ * try to expand on demand the macro found in the c file, so those cases
+ * are not needed any more:
  *   - macros found in .c; macros that cannot be parsed.
  *     In the future should be autodetected
  *     (not so easy to do same for macros in .h cos require to access .h file)
- *   - macros found in ".h" 
- *     but where we cant detect that it will be a "bad macro"
  *   - macros found in .c; macros correctly parsed
  *     but where we cant detect that it will be a "bad macro"
- *   - hints, cf below.
  *
  * Some of those macros could be deleted and the C code rewritten because
  * they are "bad" macros.
 // #define FOO(a,b) fn(a,b)
 #define FOO_METH_TEST(a) YACFE_IDENT_BUILDER
 
-// ****************************************************************************
-// Generic macros
-// ****************************************************************************
+//#define FOO YACFE_DECLARATOR
 
 // ****************************************************************************
-// Yacc macros 
-// ****************************************************************************
-
-#define YY_PROTO(x) x 
-#define yyconst const 
-
-
-// ****************************************************************************
-// GNU Hello macros 
+// Generic macros
 // ****************************************************************************
 
-#define __getopt_argv_const const
+// this is defined by windows compiler, and so can not be found via a macro
+// after a -extract_macros
+#define __stdcall /*could: YACFE_ATTRIBUTE*/
+#define __declspec(a) 
 
-
-// ****************************************************************************
-// Gcc (as in the source of gcc code) macros 
-// ****************************************************************************
+#define WINAPI
+#define CALLBACK
 
 
 // ****************************************************************************
 
 #define __uses_jump_to_uncached
 
+
+// last last
+#define __net_init
+#define __net_exit
+#define __net_initdata
+
+#define __paginginit // in mm
+
 // ----------------------------------------------------------------------------
 // String macros
 // ----------------------------------------------------------------------------
 
 #define  TRACE_EXIT return
 
+#define notrace
+
+#define noinline_for_stack // in fs
+#define debug_noinline // in net
 
 // ----------------------------------------------------------------------------
 // linkage
@@ -734,71 +747,3 @@ do {                                                                       \
 //#define       ACPI_MODULE_NAME(x)
 
 
-
-
-// ****************************************************************************
-// Httpd (apache) macros 
-// ****************************************************************************
-
-#define AP_DECLARE(x) x
-#define PROXY_DECLARE(x) x
-#define CACHE_DECLARE(x) x
-#define DBD_DECLARE_NONSTD(x) x
-#define DAV_DECLARE(x) x
-#define APU_DECLARE(x) x
-#define APU_DECLARE_NONSTD(x) x
-#define APR_DECLARE(x) x
-#define AP_CORE_DECLARE(x) x
-#define AP_DECLARE_NONSTD(x) x
-#define AP_CORE_DECLARE_NONSTD(x) x
-#define APR_OPTIONAL_FN_TYPE(x) x
-#define DAV_DECLARE_NONSTD(x) x
-#define APR_DECLARE_NONSTD(x) x
-
-#define APU_DECLARE_DATA
-#define APR_THREAD_FUNC
-#define AP_DECLARE_DATA
-#define PROXY_DECLARE_DATA
-#define AP_MODULE_DECLARE_DATA
-#define APR_DECLARE_DATA
-
-
-
-#define APR_INLINE inline
-#define EXPORT static
-#define REGISTER register
-
-#define MODSSL_D2I_SSL_SESSION_CONST const 
-#define MODSSL_D2I_X509_CONST const
-#define MODSSL_D2I_PrivateKey_CONST const
-#define MODSSL_D2I_SSL_SESSION_CONST const
-
-#define STACK_OF(X509_NAME) X509_NAME
-
-#define MODSSL_PCHAR_CAST  (pchar)
-
-#define WINAPI
-//#define CALLBACK
-// generate false positive in Linux 
-#define APIENTRY
-#define __declspec(x) 
-#define __stdcall
-
-
-//#define module struct xxx
-
-#define APR_POOL_IMPLEMENT_ACCESSOR(shm)
-
-#define ADD_SUITE(suite) suite;
-
-// ****************************************************************************
-// CISCO vpn client macros 
-// ****************************************************************************
-
-// #define NOREGPARM 
-// #define IN
-// #define OUT
-// #define OPTIONAL
-
-#define likely(x) x
-#define unlikely(x) x
index 8d6c161..123e95b 100644 (file)
@@ -271,6 +271,12 @@ expression X, Y;
 @@
 X < Y <=> Y > X
 
+Expression
+@ gtr_lss_eq @ 
+expression X, Y; 
+@@
+X <= Y <=> Y >= X
+
 // ---------------------------------------------------------------------------
 // Increment isomorphisms
 // ---------------------------------------------------------------------------
index 8dffbb7..b488d72 100644 (file)
@@ -68,8 +68,18 @@ let testone x compare_with_expected_flag =
           
 
 (* ------------------------------------------------------------------------ *)
-let testall () =
-
+(* note: if you get some weird results in -testall, and not in -test, 
+ * it is possible that a test file work in -test but may not 
+ * work while used inside a -testall. If we have some bugs in our
+ * parser that modify some global state and that those states 
+ * are not reseted between each test file, then having run previous
+ * test files may have an influence on another test file which mean
+ * than a test may work in isolation (via -test) but not otherwise
+ * (via -testall). Fortunately such bugs are rare.
+ * 
+ *)
+let testall ?(expected_score_file="tests/SCORE_expected.sexp") () =
   let score  = empty_score () in
 
   let expected_result_files = 
@@ -93,6 +103,8 @@ let testall () =
       try (
         Common.timeout_function timeout_testall  (fun () -> 
 
+         pr2 res;
+
          let cocci_infos = Cocci.pre_engine (cocci_file, !Config.std_iso) in
           let xs = Cocci.full_engine cocci_infos [cfile] in
          Cocci.post_engine cocci_infos;
@@ -106,7 +118,6 @@ let testall () =
           let (correct, diffxs) = Compare_c.compare_default generated expected
           in
 
-         pr2 res;
           (* I don't use Compare_c.compare_result_to_string because
            * I want to indent a little more the messages.
            *)
@@ -155,18 +166,31 @@ let testall () =
     pr2 "--------------------------------";
     pr2 "regression testing  information";
     pr2 "--------------------------------";
-
+    (* now default argument of testall:
     let expected_score_file = "tests/SCORE_expected.sexp" in
+    *)
+    let expected_score_file_orig = "tests/SCORE_expected_orig.sexp" in
     let best_of_both_file = "tests/SCORE_best_of_both.sexp" in
     let actual_score_file = "tests/SCORE_actual.sexp" in
-    
+
     pr2 ("regression file: "^ expected_score_file);
     let (expected_score : score) = 
       if Sys.file_exists expected_score_file
       then 
         let sexp = Sexp.load_sexp expected_score_file in
         Sexp_common.score_of_sexp sexp
-      else empty_score()
+      else 
+        if Sys.file_exists expected_score_file_orig 
+        then begin
+          pr2 (spf "use expected orig file (%s)" expected_score_file_orig);
+          Common.command2 (spf "cp %s %s" expected_score_file_orig 
+                                          expected_score_file);
+          let sexp = Sexp.load_sexp expected_score_file in
+          Sexp_common.score_of_sexp sexp
+        end
+       else 
+          empty_score()
     in
 
     let new_bestscore = Common.regression_testing_vs score expected_score in
@@ -195,7 +219,8 @@ let testall () =
     else 
       if good < expected_good
       then begin 
-        pr2 "Current score is lower than expected, :(";
+        pr2 "Current score is lower than expected :(";
+        pr2 (spf "(was expecting %d but got %d)" expected_good good);
         pr2 "";
         pr2 "If you think it's normal, then maybe you need to update the";
         pr2 (spf "score file %s, copying info from %s."
@@ -203,7 +228,8 @@ let testall () =
         raise (UnixExit 1);
       end
       else begin
-        pr2 "Current score is greater than expected, :)";
+        pr2 "Current score is greater than expected :)";
+        pr2 (spf "(was expecting %d but got %d)" expected_good good);
         pr2 "Generating new expected score file and saving old one";
         Common.command2_y_or_no_exit_if_no
           (spf "mv %s %s" expected_score_file (expected_score_file ^ ".save"));
index 8fcbfcd..bd0579a 100644 (file)
@@ -4,7 +4,7 @@ open Common
 (* work with tests/ *)
 (*****************************************************************************)
 val testone : string (*test*) -> bool (*compare_expected*) -> unit
-val testall : unit -> unit
+val testall : ?expected_score_file:string -> unit -> unit
 
 (*****************************************************************************)
 (* works with tests-big/. The .res, .ok, .spatch_ok, .failed, .var *)
index 74987fd..b1225a1 100644 (file)
@@ -8,12 +8,12 @@
  (bad_ptr_print.res Ok) (bad_typedef.res Ok) (badexp.res Ok)
  (badpos.res
   (Pb
-   "PROBLEM\n   exn = Failure(\"rule starting on line 1: already tagged token:\\nFile \\\"tests/badpos.c\\\", line 5, column 30,  charpos = 139\\n    around = 'reg_ptr', whole content = \\t (int) -(((struct pt_regs *) reg_ptr)->orig_eax + 2));\")\n"))
- (badtypedef.res Ok) (ben.res Ok) (bitfield.res Ok) (braces.res Ok)
- (break.res Ok) (bug1.res Ok)
+   "PROBLEM\n   exn = Failure(\"rule starting on line 1: already tagged token:\\nC code context\\nFile \\\"tests/badpos.c\\\", line 5, column 30,  charpos = 139\\n    around = 'reg_ptr', whole content = \\t (int) -(((struct pt_regs *) reg_ptr)->orig_eax + 2));\")\n"))
+ (badtypedef.res Ok) (badzero.res Ok) (ben.res Ok) (bitfield.res Ok)
+ (braces.res Ok) (break.res Ok) (bug1.res Ok)
  (bugloop.res
   (Pb
-   "PROBLEM\n   exn = Failure(\"try to delete an expanded token: flags\")\n"))
+   "INCORRECT:diff token: PF_FREEZE VS )\nFile <COCCIOUTPUTFILE>, line 12, column 16,  charpos = 390\n    around = 'PF_FREEZE', whole content = \t\t\trefrigerator(PF_FREEZE);\nFile \"tests/bugloop.res\", line 8, column 16,  charpos = 160\n    around = ')', whole content = \t\t\trefrigerator();\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,7 +1,3 @@\n    -/* this doesn't work, because on the paths where we don't find refrigerator,\n    -we expect to reach Exit without first going through current->flags & PF_FREEZE,\n    -but of course any path that goes around the loop does precisely that */\n    -\n     static int stir_transmit_thread(void *arg)\n     {\n     \n    @@ -9,7 +5,7 @@\n     \t{\n     \t\t/* if suspending, then power off and wait */\n     \t\tif (unlikely(freezing(current))) {\n    -\t\t\trefrigerator(PF_FREEZE);\n    +\t\t\trefrigerator();\n     \n     \t\t}\n     \t}\n"))
  (bugon.res Ok) (cards.res Ok) (cast.res Ok) (cast_iso.res Ok)
  (compare.res Ok) (const.res Ok) (const1bis.res Ok) (const_adding.res Ok)
  (const_array.res Ok) (const_implicit_iso.res Ok) (constty.res Ok)
  (define_exp.res Ok) (define_param.res Ok) (deftodo.res Ok) (deref.res Ok)
  (devlink.res Ok) (disjexpr.res Ok) (disjexpr_ver1.res Ok)
  (disjexpr_ver2.res Ok) (distribute.res Ok) (double.res Ok)
- (double_assign.res Ok)
- (double_switch.res (Pb "PROBLEM\n   exn = Common.Impossible\n"))
- (doublepos.res Ok)
- (doubleswitch.res (Pb "PROBLEM\n   exn = Common.Impossible\n"))
- (dowhile.res Ok) (dropf.res Ok) (dropparam.res Ok) (edots.res Ok)
- (edots_ver1.res Ok) (empty.res Ok) (end_commas.res Ok) (endif.res Ok)
- (exp.res Ok) (expnest.res Ok) (expopt.res Ok) (expopt2.res Ok)
- (expopt3.res Ok) (expopt3_ver1.res Ok) (expopt3_ver2.res Ok) (fields.res Ok)
- (fieldsmin.res Ok) (fix_flow_need.res Ok) (fn_todo.res Ok) (fnptr.res Ok)
- (fnret.res Ok) (four.res Ok) (foura.res Ok) (fp.res Ok) (fun.res Ok)
+ (double_assign.res Ok) (double_switch.res Ok) (doublepos.res Ok)
+ (doubleswitch.res Ok) (dowhile.res Ok) (dropf.res Ok) (dropparam.res Ok)
+ (edots.res Ok) (edots_ver1.res Ok) (empty.res Ok) (end_commas.res Ok)
+ (endif.res Ok) (exp.res Ok) (expnest.res Ok) (expopt.res Ok)
+ (expopt2.res Ok) (expopt3.res Ok) (expopt3_ver1.res Ok)
+ (expopt3_ver2.res Ok) (fields.res Ok) (fieldsmin.res Ok) (find_long.res Ok)
+ (fix_flow_need.res Ok) (fn_todo.res Ok) (fnptr.res Ok) (fnret.res Ok)
+ (four.res Ok) (foura.res Ok) (fp.res Ok) (fun.res Ok)
  (gilles-question.res Ok) (gotobreak.res Ok) (hd.res Ok) (headers.res Ok)
- (hex.res Ok)
- (hil1.res Ok) (if.res Ok) (ifbr.res Ok) (ifdef1.res Ok) (ifdef2.res Ok)
+ (hex.res Ok) (hil1.res Ok) (if.res Ok) (ifbr.res Ok) (ifdef1.res Ok)
+ (ifdef2.res Ok)
  (ifdef3.res
   (Pb
    "PROBLEM\n   exn = Lexer_cocci.Lexical(\"unrecognised symbol, in token rule: #\")\n"))
  (ifdef4.res Ok) (ifdef5.res Ok) (ifdef6.res Ok) (ifdef6a.res Ok)
+ (ifdefmeta.res Ok) (ifdefmeta1.res Ok) (ifdefmeta2.res Ok)
+ (ifdefmeta3.res Ok)
+ (ifdefmeta4.res
+  (Pb
+   "PROBLEM\n   exn = Unix.Unix_error(20, \"stat\", \"tests/ifdefmeta4.cocci\")\n"))
  (ifend.res Ok) (ifzer.res Ok) (inc.res Ok)
  (incdir.res
   (Pb
  (jloop1.res
   (Pb
    "PROBLEM\n   exn = Failure(\"minus: parse error: \\n = File \\\"tests/jloop1.cocci\\\", line 10, column 3,  charpos = 129\\n    around = '...>', whole content =    ...>\\n\")\n"))
- (julia10.res Ok) (julia7.res Ok) (keep_comma.res Ok)
- (km.res
-  (Pb
-   "INCORRECT:diff token: } VS memset\nFile <COCCIOUTPUTFILE>, line 4, column 0,  charpos = 85\n    around = '}', whole content = }\nFile \"tests/km.res\", line 4, column 2,  charpos = 87\n    around = 'memset', whole content =   memset(data, 0, element->string.length + 1);\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,4 +1,5 @@\n     int main() {\n       int *data = kzalloc(element->string.length + 1, GFP_KERNEL);\n       foo();\n    +  memset(data, 0, element->string.length + 1);\n     }\n"))
+ (julia10.res Ok) (julia7.res Ok) (keep_comma.res Ok) (km.res Ok)
  (kmalloc.res Ok) (kmc.res Ok) (ktype.res Ok)
  (labels_metastatement.res
   (Pb
    "INCORRECT:diff token: { VS x\nFile <COCCIOUTPUTFILE>, line 4, column 2,  charpos = 30\n    around = '{', whole content =   {\nFile \"tests/labels_metastatement.res\", line 4, column 4,  charpos = 32\n    around = 'x', whole content =     x = 3; foo();\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,15 +1,10 @@\n     int foo(int i) {\n     \n       if(1) {\n    -  {\n    -    x = 3;\n    -    foo();\n    -    z = 4;\n    -    foo();\n    -  }\n    -  foo();\n    -  }\n    -  foo(); // we dont want that it add both foo on the } and on the endif\n    +    x = 3; foo();\n    +    z = 4; foo();\n    +  } // we dont want that it add both foo on the } and on the endif\n         // (note: but need correct endif accrochage)\n    +  foo();\n     \n     }\n"))
  (labels_metastatement_ver1.res Ok) (local.res Ok) (localid.res Ok)
- (longlong.res Ok) (longlongint.res Ok) (loop.res Ok) (lvalue.res Ok)
- (macro.res Ok) (match_no_meta.res Ok) (max.res Ok)
+ (longconst.res Ok) (longlong.res Ok) (longlongint.res Ok) (loop.res Ok)
+ (lvalue.res Ok) (macro.res Ok) (macro_int16.res Ok) (match_no_meta.res Ok)
+ (max.res Ok)
  (metahex.res
   (Pb
    "INCORRECT:diff token: f VS }\nFile \"tests/metahex.c\", line 2, column 2,  charpos = 15\n    around = 'f', whole content =   f(3);\nFile \"tests/metahex.res\", line 2, column 0,  charpos = 13\n    around = '}', whole content = }\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,4 +1,2 @@\n     int main() {\n    -  f(3);\n    -  g(0x03);\n     }\n"))
  (multiplus.res Ok) (multitype.res Ok) (multitypedef.res Ok)
  (multivars.res Ok) (nest.res Ok) (nestone.res Ok) (nestseq.res Ok)
  (neststruct.res Ok) (nl.res Ok) (nocast.res Ok) (not.res Ok) (noty.res Ok)
- (null_type.res Ok) (of.res Ok) (oneline.res Ok) (opt.res Ok)
- (optional_qualifier.res Ok) (optional_storage.res Ok) (orexp.res Ok)
- (param.res Ok) (param_end.res Ok) (param_ver1.res Ok)
- (parameters_dots.res Ok) (partial.res Ok)
+ (null_type.res Ok)
+ (oddifdef.res
+  (Pb
+   "INCORRECT:diff token: #else\n VS x\nFile <COCCIOUTPUTFILE>, line 10, column 0,  charpos = 114\n    around = '#else\n', whole content = #else\nFile \"tests/oddifdef.res\", line 10, column 2,  charpos = 116\n    around = 'x', whole content =   x = 0;\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -7,8 +7,9 @@\n         a = 5;\n     \n     #ifdef FOO\n    +  x = 0;\n     #else\n    -  \n    +  x = 0;\n     #endif\n     }\n     \n    @@ -21,8 +22,9 @@\n         a = 3;\n     \n     #ifdef FOO\n    +  x = 0;\n     #else\n    -  \n    +  x = 0;\n     #endif\n     }\n     \n    @@ -35,7 +37,8 @@\n     #endif\n     \n     #ifdef FOO\n    +  x = 0;\n     #else\n    -  \n    +  x = 0;\n     #endif\n     }\n"))
+ (of.res Ok) (oneline.res Ok) (opt.res Ok) (optional_qualifier.res Ok)
+ (optional_storage.res Ok) (orexp.res Ok) (param.res Ok) (param_end.res Ok)
+ (param_ver1.res Ok) (parameters_dots.res Ok) (partial.res Ok)
  (pb_distribute_type.res
   (Pb
    "INCORRECT:PB parsing only in generated-file\n    diff (result(<) vs expected_result(>)) = \n    @@ -5,11 +5,11 @@\n     \n     \n     int foo() {\n    -  int * *x;\n    +  int **x;\n       return 0;\n     }\n     \n     int foo() {\n    -  int[45] *x;\n    +  int (*x)[45];\n       return 0;\n     }\n"))
  (wierdinit.res
   (Pb
    "seems incorrect, but only because of code that was not parsablediff token: dev_link_t VS struct\nFile \"tests/wierdinit.c\", line 4, column 1,  charpos = 27\n    around = 'dev_link_t', whole content = \tdev_link_t *link;\nFile \"tests/wierdinit.res\", line 4, column 1,  charpos = 27\n    around = 'struct', whole content = \tstruct pcmcia_device *link;\n"))
- (ws2.res Ok) (y2.res Ok) (zero.res Ok))
\ No newline at end of file
+ (ws2.res Ok) (xfield.res Ok) (y2.res Ok) (zero.res Ok))
\ No newline at end of file
diff --git a/tests/SCORE_expected.sexp.save b/tests/SCORE_expected.sexp.save
new file mode 100644 (file)
index 0000000..4e37271
--- /dev/null
@@ -0,0 +1,151 @@
+((a3d.res Ok) (a_and_e.res Ok) (a_and_e_ver1.res Ok) (addelse.res Ok)
+ (addif.res Ok) (addif1.res Ok) (addif2.res Ok) (after_if.res Ok)
+ (anon.res Ok) (ar.res Ok) (arg.res Ok) (argument.res Ok) (array_init.res Ok)
+ (array_size.res Ok) (arraysz.res Ok) (b1.res Ok) (b2.res Ok)
+ (bad_iso_example.res
+  (Pb
+   "INCORRECT:diff token: ( VS x\nFile \"tests/bad_iso_example.c\", line 2, column 6,  charpos = 19\n    around = '(', whole content =   if ((x = 3)) return;\nFile \"tests/bad_iso_example.res\", line 2, column 6,  charpos = 19\n    around = 'x', whole content =   if (x) return;\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,4 +1,4 @@\n     int main() {\n    -  if ((x = 3)) return;\n    +  if (x) return;\n     }\n     \n"))
+ (bad_ptr_print.res Ok) (bad_typedef.res Ok) (badexp.res Ok)
+ (badpos.res
+  (Pb
+   "PROBLEM\n   exn = Failure(\"rule starting on line 1: already tagged token:\\nFile \\\"tests/badpos.c\\\", line 5, column 30,  charpos = 139\\n    around = 'reg_ptr', whole content = \\t (int) -(((struct pt_regs *) reg_ptr)->orig_eax + 2));\")\n"))
+ (badtypedef.res Ok) (badzero.res Ok) (ben.res Ok) (bitfield.res Ok)
+ (braces.res Ok) (break.res Ok) (bug1.res Ok)
+ (bugloop.res
+  (Pb
+   "INCORRECT:diff token: PF_FREEZE VS )\nFile <COCCIOUTPUTFILE>, line 12, column 16,  charpos = 390\n    around = 'PF_FREEZE', whole content = \t\t\trefrigerator(PF_FREEZE);\nFile \"tests/bugloop.res\", line 8, column 16,  charpos = 160\n    around = ')', whole content = \t\t\trefrigerator();\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,7 +1,3 @@\n    -/* this doesn't work, because on the paths where we don't find refrigerator,\n    -we expect to reach Exit without first going through current->flags & PF_FREEZE,\n    -but of course any path that goes around the loop does precisely that */\n    -\n     static int stir_transmit_thread(void *arg)\n     {\n     \n    @@ -9,7 +5,7 @@\n     \t{\n     \t\t/* if suspending, then power off and wait */\n     \t\tif (unlikely(freezing(current))) {\n    -\t\t\trefrigerator(PF_FREEZE);\n    +\t\t\trefrigerator();\n     \n     \t\t}\n     \t}\n"))
+ (bugon.res Ok) (cards.res Ok) (cast.res Ok) (cast_iso.res Ok)
+ (compare.res Ok) (const.res Ok) (const1bis.res Ok) (const_adding.res Ok)
+ (const_array.res Ok) (const_implicit_iso.res Ok) (constty.res Ok)
+ (constx.res Ok) (cs_check.res Ok) (cst.res Ok) (csw.res Ok)
+ (dbg.res
+  (Pb
+   "INCORRECT:diff token: else VS (\nFile <COCCIOUTPUTFILE>, line 8, column 2,  charpos = 133\n    around = 'else', whole content = \t\telse pr = NULL;;\nFile \"tests/dbg.res\", line 7, column 5,  charpos = 130\n    around = '(', whole content = \t\tDBG(\"PCI\");\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -4,6 +4,6 @@\n     \tstruct resource *pr, *r = &dev->resource[idx];\n     \n     \tif (pr)\n    -\t\tDBG\n    -\t\telse pr = NULL;;\n    +\t\tDBG(\"PCI\");\n    +\telse pr = NULL;\n     }\n"))
+ (dc_close.res Ok) (debug.res Ok) (dec.res Ok) (decl.res Ok) (decl2.res Ok)
+ (decl_space.res Ok)
+ (decl_split.res
+  (Pb
+   "INCORRECT:diff token: int VS }\nFile \"tests/decl_split.c\", line 2, column 8,  charpos = 27\n    around = 'int', whole content =         int x, y;\nFile \"tests/decl_split.res\", line 2, column 0,  charpos = 19\n    around = '}', whole content = }\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,3 +1,2 @@\n     int func(int i) { \n    -        int x, y;\n     }\n"))
+ (define_exp.res Ok) (define_param.res Ok) (deftodo.res Ok) (deref.res Ok)
+ (devlink.res Ok) (disjexpr.res Ok) (disjexpr_ver1.res Ok)
+ (disjexpr_ver2.res Ok) (distribute.res Ok) (double.res Ok)
+ (double_assign.res Ok) (double_switch.res Ok) (doublepos.res Ok)
+ (doubleswitch.res Ok) (dowhile.res Ok) (dropf.res Ok) (dropparam.res Ok)
+ (edots.res Ok) (edots_ver1.res Ok) (empty.res Ok) (end_commas.res Ok)
+ (endif.res Ok) (exp.res Ok) (expnest.res Ok) (expopt.res Ok)
+ (expopt2.res Ok) (expopt3.res Ok) (expopt3_ver1.res Ok)
+ (expopt3_ver2.res Ok) (fields.res Ok) (fieldsmin.res Ok) (find_long.res Ok)
+ (fix_flow_need.res Ok) (fn_todo.res Ok) (fnptr.res Ok) (fnret.res Ok)
+ (four.res Ok) (foura.res Ok) (fp.res Ok) (fun.res Ok)
+ (gilles-question.res Ok) (gotobreak.res Ok) (hd.res Ok) (headers.res Ok)
+ (hex.res Ok) (hil1.res Ok) (if.res Ok) (ifbr.res Ok) (ifdef1.res Ok)
+ (ifdef2.res Ok)
+ (ifdef3.res
+  (Pb
+   "PROBLEM\n   exn = Lexer_cocci.Lexical(\"unrecognised symbol, in token rule: #\")\n"))
+ (ifdef4.res Ok) (ifdef5.res Ok) (ifdef6.res Ok) (ifdef6a.res Ok)
+ (ifdefmeta.res Ok) (ifdefmeta1.res Ok) (ifdefmeta2.res Ok)
+ (ifdefmeta3.res
+  (Pb
+   "INCORRECT:diff token: g VS #ifdef ONE\nFile <COCCIOUTPUTFILE>, line 4, column 2,  charpos = 32\n    around = 'g', whole content =   g();\nFile \"tests/ifdefmeta3.res\", line 4, column 0,  charpos = 30\n    around = '#ifdef ONE', whole content = #ifdef ONE\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,5 +1,7 @@\n     int main () {\n       f();\n       xxx();\n    +#ifdef ONE\n    +#endif\n       g();\n     }\n"))
+ (ifdefmeta4.res
+  (Pb
+   "PROBLEM\n   exn = Unix.Unix_error(20, \"stat\", \"tests/ifdefmeta4.cocci\")\n"))
+ (ifend.res Ok) (ifzer.res Ok) (inc.res Ok)
+ (incdir.res
+  (Pb
+   "INCORRECT:diff token: x VS 12\nFile \"tests/incdir.c\", line 4, column 6,  charpos = 46\n    around = 'x', whole content =   foo(x);\nFile \"tests/incdir.res\", line 4, column 6,  charpos = 46\n    around = '12', whole content =   foo(12);\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,5 +1,5 @@\n     #include \"sub/incdir2.c\"\n     \n     int main () {\n    -  foo(x);\n    +  foo(12);\n     }\n"))
+ (incl.res Ok) (inclifdef.res Ok) (include.res Ok)
+ (incompatible_value.res Ok) (inherited.res Ok) (inherited_ver1.res Ok)
+ (inhpos.res Ok) (initializer.res Ok) (initializer_many_fields.res Ok)
+ (inline.res Ok) (isococci.res Ok) (isotest.res Ok) (isotest2.res Ok)
+ (iterator.res Ok)
+ (jloop1.res
+  (Pb
+   "PROBLEM\n   exn = Failure(\"minus: parse error: \\n = File \\\"tests/jloop1.cocci\\\", line 10, column 3,  charpos = 129\\n    around = '...>', whole content =    ...>\\n\")\n"))
+ (julia10.res Ok) (julia7.res Ok) (keep_comma.res Ok) (km.res Ok)
+ (kmalloc.res Ok) (kmc.res Ok) (ktype.res Ok)
+ (labels_metastatement.res
+  (Pb
+   "INCORRECT:diff token: { VS x\nFile <COCCIOUTPUTFILE>, line 4, column 2,  charpos = 30\n    around = '{', whole content =   {\nFile \"tests/labels_metastatement.res\", line 4, column 4,  charpos = 32\n    around = 'x', whole content =     x = 3; foo();\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,15 +1,10 @@\n     int foo(int i) {\n     \n       if(1) {\n    -  {\n    -    x = 3;\n    -    foo();\n    -    z = 4;\n    -    foo();\n    -  }\n    -  foo();\n    -  }\n    -  foo(); // we dont want that it add both foo on the } and on the endif\n    +    x = 3; foo();\n    +    z = 4; foo();\n    +  } // we dont want that it add both foo on the } and on the endif\n         // (note: but need correct endif accrochage)\n    +  foo();\n     \n     }\n"))
+ (labels_metastatement_ver1.res Ok) (local.res Ok) (localid.res Ok)
+ (longconst.res Ok) (longlong.res Ok) (longlongint.res Ok) (loop.res Ok)
+ (lvalue.res Ok) (macro.res Ok) (macro_int16.res Ok) (match_no_meta.res Ok)
+ (max.res Ok)
+ (metahex.res
+  (Pb
+   "INCORRECT:diff token: f VS }\nFile \"tests/metahex.c\", line 2, column 2,  charpos = 15\n    around = 'f', whole content =   f(3);\nFile \"tests/metahex.res\", line 2, column 0,  charpos = 13\n    around = '}', whole content = }\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,4 +1,2 @@\n     int main() {\n    -  f(3);\n    -  g(0x03);\n     }\n"))
+ (metaruleelem.res Ok) (metastatement2.res Ok) (metastatement_for.res Ok)
+ (metastatement_if.res Ok) (minstruct.res Ok) (minusdots.res Ok)
+ (minusdots_ver1.res Ok)
+ (multi_func1.res
+  (Pb
+   "PROBLEM\n   exn = Failure(\"minus: parse error: \\n = File \\\"tests/multi_func1.cocci\\\", line 12, column 2,  charpos = 102\\n    around = 'fn2', whole content =   fn2(...) {\\n\")\n"))
+ (multiplus.res Ok) (multitype.res Ok) (multitypedef.res Ok)
+ (multivars.res Ok) (nest.res Ok) (nestone.res Ok) (nestseq.res Ok)
+ (neststruct.res Ok) (nl.res Ok) (nocast.res Ok) (not.res Ok) (noty.res Ok)
+ (null_type.res Ok)
+ (oddifdef.res
+  (Pb
+   "INCORRECT:diff token: #else\n VS x\nFile <COCCIOUTPUTFILE>, line 10, column 0,  charpos = 114\n    around = '#else\n', whole content = #else\nFile \"tests/oddifdef.res\", line 10, column 2,  charpos = 116\n    around = 'x', whole content =   x = 0;\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -7,8 +7,9 @@\n         a = 5;\n     \n     #ifdef FOO\n    +  x = 0;\n     #else\n    -  \n    +  x = 0;\n     #endif\n     }\n     \n    @@ -21,8 +22,9 @@\n         a = 3;\n     \n     #ifdef FOO\n    +  x = 0;\n     #else\n    -  \n    +  x = 0;\n     #endif\n     }\n     \n    @@ -35,7 +37,8 @@\n     #endif\n     \n     #ifdef FOO\n    +  x = 0;\n     #else\n    -  \n    +  x = 0;\n     #endif\n     }\n"))
+ (of.res Ok) (oneline.res Ok) (opt.res Ok) (optional_qualifier.res Ok)
+ (optional_storage.res Ok) (orexp.res Ok) (param.res Ok) (param_end.res Ok)
+ (param_ver1.res Ok) (parameters_dots.res Ok) (partial.res Ok)
+ (pb_distribute_type.res
+  (Pb
+   "INCORRECT:PB parsing only in generated-file\n    diff (result(<) vs expected_result(>)) = \n    @@ -5,11 +5,11 @@\n     \n     \n     int foo() {\n    -  int * *x;\n    +  int **x;\n       return 0;\n     }\n     \n     int foo() {\n    -  int[45] *x;\n    +  int (*x)[45];\n       return 0;\n     }\n"))
+ (pb_distribute_type2.res
+  (Pb
+   "INCORRECT:PB parsing only in generated-file\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,5 +1,5 @@\n     int foo() {\n    -  int* x;\n    +  int *x;\n       return 0;\n     }\n     \n    @@ -10,6 +10,6 @@\n     }\n     \n     int foo() {\n    -  int x[45]*;\n    +  int (*x)[45];\n       return 0;\n     }\n"))
+ (pb_distribute_type3.res
+  (Pb "PROBLEM\n   exn = Failure(\"line 7: index 53 53 already used\\n\")\n"))
+ (pb_distribute_type4.res Ok) (pb_params_iso.res Ok)
+ (pb_parsing_macro.res Ok) (pb_tag_symbols.res Ok) (pmac.res Ok)
+ (posiso.res Ok) (positionc.res Ok) (post.res Ok) (print_return.res Ok)
+ (proto.res Ok) (proto2.res Ok) (proto_ver1.res Ok) (proto_ver2.res Ok)
+ (protoassert.res Ok) (protox.res Ok) (rcu3.res Ok)
+ (remstruct.res
+  (Pb
+   "INCORRECT:not same number of entities (func, decl, ...)\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,10 +1,3 @@\n    -\n    -      .ack    = mpuio_ack_irq,\n    -      .mask   = mpuio_mask_irq,\n    -      .unmask = mpuio_unmask_irq\n    -\n    -  .b = 15,\n    -\n     int hello ( String input )\n     {\n       String input = input.lowercase();\n"))
+ (replace_typedef.res Ok) (reserved.res Ok) (retmacro.res Ok) (rets.res Ok)
+ (return.res Ok) (return_implicit.res Ok) (same_expr.res Ok)
+ (scope_problem.res
+  (Pb
+   "INCORRECT:diff token: } VS a\nFile <COCCIOUTPUTFILE>, line 6, column 2,  charpos = 44\n    around = '}', whole content =   }\nFile \"tests/scope_problem.res\", line 7, column 4,  charpos = 49\n    around = 'a', whole content =     a = 2;\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,8 +1,10 @@\n     void main(int i) {\n     \n     \n    +\n       if(1) {\n         int a;\n    +    a = 2;\n       }\n     \n     \n"))
+ (serio.res
+  (Pb
+   "INCORRECT:diff token: init_MUTEX VS mutex_init\nFile \"tests/serio.c\", line 7, column 1,  charpos = 130\n    around = 'init_MUTEX', whole content = \tinit_MUTEX(&serio->drv_sem);\nFile \"tests/serio.res\", line 7, column 1,  charpos = 130\n    around = 'mutex_init', whole content = \tmutex_init(&serio->new_lock);\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -4,5 +4,5 @@\n     \n     static void serio_init_port(struct serio *serio)\n     {\n    -\tinit_MUTEX(&serio->drv_sem);\n    +\tmutex_init(&serio->new_lock);\n     }\n"))
+ (shared_brace.res Ok) (signed.res Ok) (sis.res Ok) (sizeof.res Ok)
+ (sizeof_julia.res Ok) (skip.res Ok) (sp.res Ok) (spaces.res Ok) (spl.res Ok)
+ (static.res (Pb "PROBLEM\n   exn = Common.Impossible\n")) (stm1.res Ok)
+ (stm10.res Ok) (stm10_ver1.res Ok) (stm2.res Ok) (stm3.res Ok) (stm4.res Ok)
+ (stm5.res Ok) (stm6.res Ok) (stm7.res Ok) (stm8.res Ok) (stmt.res Ok)
+ (strangeorder.res Ok) (string.res Ok) (struct.res Ok)
+ (struct_metavar.res Ok) (struct_typedef.res Ok) (structfoo.res Ok)
+ (substruct.res Ok) (sw.res Ok) (switch.res Ok) (td.res Ok) (test0.res Ok)
+ (test1.res Ok) (test10.res Ok) (test10_ver1.res Ok) (test11.res Ok)
+ (test11_ver1.res Ok) (test12.res Ok) (test2.res Ok) (test3.res Ok)
+ (test4.res Ok) (test5.res Ok) (test5_ver1.res Ok) (test6.res Ok)
+ (test7.res Ok) (test8.res Ok) (test9.res Ok) (test_unsigned_meta.res Ok)
+ (three_types.res Ok) (threea.res Ok) (top.res Ok) (topdec.res Ok)
+ (topdec_ver1.res Ok) (topdec_ver2.res Ok) (toplevel_macrostmt.res Ok)
+ (toplevel_struct.res Ok) (tup.res Ok) (twoproto.res Ok) (ty.res Ok)
+ (ty1.res Ok) (ty_tyexp.res Ok) (type.res Ok) (type1.res Ok)
+ (type_annotated.res Ok) (type_ver1.res Ok)
+ (type_ver2.res
+  (Pb
+   "INCORRECT:PB parsing only in generated-file\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,5 +1,5 @@\n     int foo() {\n    -  int[10] *x;\n    +  int *x[10];\n       return 0;\n     }\n     \n"))
+ (typedef.res Ok)
+ (typedef3.res
+  (Pb
+   "INCORRECT:diff token: link VS p_dev\nFile <COCCIOUTPUTFILE>, line 7, column 29,  charpos = 137\n    around = 'link', whole content = \tunsigned int iobase = info->link.io.BasePort1;\nFile \"tests/typedef3.res\", line 7, column 29,  charpos = 137\n    around = 'p_dev', whole content = \tunsigned int iobase = info->p_dev->io.BasePort1;\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -4,7 +4,7 @@\n     \n     static void should_work(foo *info)\n     {\n    -\tunsigned int iobase = info->link.io.BasePort1;\n    +\tunsigned int iobase = info->p_dev->io.BasePort1;\n     }\n     \n     static void does_work(struct bluecard_info_t *info)\n"))
+ (typedef_double.res Ok)
+ (typeof.res
+  (Pb
+   "INCORRECT:diff token: x VS sizeof\nFile <COCCIOUTPUTFILE>, line 3, column 4,  charpos = 26\n    around = 'x', whole content =   f(x);\nFile \"tests/typeof.res\", line 3, column 4,  charpos = 26\n    around = 'sizeof', whole content =   f(sizeof(struct foo));\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,4 +1,4 @@\n     int main() {\n       int x;\n    -  f(x);\n    +  f(sizeof(struct foo));\n     }\n"))
+ (useless_cast.res Ok) (varargs.res Ok) (video1bis.res Ok) (void.res Ok)
+ (vpos.res Ok) (whitespace.res Ok) (wierd_argument.res Ok)
+ (wierdinit.res
+  (Pb
+   "seems incorrect, but only because of code that was not parsablediff token: dev_link_t VS struct\nFile \"tests/wierdinit.c\", line 4, column 1,  charpos = 27\n    around = 'dev_link_t', whole content = \tdev_link_t *link;\nFile \"tests/wierdinit.res\", line 4, column 1,  charpos = 27\n    around = 'struct', whole content = \tstruct pcmcia_device *link;\n"))
+ (ws2.res Ok) (xfield.res Ok) (y2.res Ok) (zero.res Ok))
\ No newline at end of file
diff --git a/tests/SCORE_expected_orig.sexp b/tests/SCORE_expected_orig.sexp
new file mode 100644 (file)
index 0000000..f79f8a9
--- /dev/null
@@ -0,0 +1,147 @@
+((a3d.res Ok) (a_and_e.res Ok) (a_and_e_ver1.res Ok) (addelse.res Ok)
+ (addif.res Ok) (addif1.res Ok) (addif2.res Ok) (after_if.res Ok)
+ (anon.res Ok) (ar.res Ok) (arg.res Ok) (argument.res Ok) (array_init.res Ok)
+ (array_size.res Ok) (arraysz.res Ok) (b1.res Ok) (b2.res Ok)
+ (bad_iso_example.res
+  (Pb
+   "INCORRECT:diff token: ( VS x\nFile \"tests/bad_iso_example.c\", line 2, column 6,  charpos = 19\n    around = '(', whole content =   if ((x = 3)) return;\nFile \"tests/bad_iso_example.res\", line 2, column 6,  charpos = 19\n    around = 'x', whole content =   if (x) return;\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,4 +1,4 @@\n     int main() {\n    -  if ((x = 3)) return;\n    +  if (x) return;\n     }\n     \n"))
+ (bad_ptr_print.res Ok) (bad_typedef.res Ok) (badexp.res Ok)
+ (badpos.res
+  (Pb
+   "PROBLEM\n   exn = Failure(\"rule starting on line 1: already tagged token:\\nFile \\\"tests/badpos.c\\\", line 5, column 30,  charpos = 139\\n    around = 'reg_ptr', whole content = \\t (int) -(((struct pt_regs *) reg_ptr)->orig_eax + 2));\")\n"))
+ (badtypedef.res Ok) (badzero.res Ok) (ben.res Ok) (bitfield.res Ok)
+ (braces.res Ok) (break.res Ok) (bug1.res Ok)
+ (bugloop.res
+  (Pb
+   "INCORRECT:diff token: PF_FREEZE VS )\nFile <COCCIOUTPUTFILE>, line 12, column 16,  charpos = 390\n    around = 'PF_FREEZE', whole content = \t\t\trefrigerator(PF_FREEZE);\nFile \"tests/bugloop.res\", line 8, column 16,  charpos = 160\n    around = ')', whole content = \t\t\trefrigerator();\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,7 +1,3 @@\n    -/* this doesn't work, because on the paths where we don't find refrigerator,\n    -we expect to reach Exit without first going through current->flags & PF_FREEZE,\n    -but of course any path that goes around the loop does precisely that */\n    -\n     static int stir_transmit_thread(void *arg)\n     {\n     \n    @@ -9,7 +5,7 @@\n     \t{\n     \t\t/* if suspending, then power off and wait */\n     \t\tif (unlikely(freezing(current))) {\n    -\t\t\trefrigerator(PF_FREEZE);\n    +\t\t\trefrigerator();\n     \n     \t\t}\n     \t}\n"))
+ (bugon.res Ok) (cards.res Ok) (cast.res Ok) (cast_iso.res Ok)
+ (compare.res Ok) (const.res Ok) (const1bis.res Ok) (const_adding.res Ok)
+ (const_array.res Ok) (const_implicit_iso.res Ok) (constty.res Ok)
+ (constx.res Ok) (cs_check.res Ok) (cst.res Ok) (csw.res Ok)
+ (dbg.res
+  (Pb
+   "INCORRECT:diff token: else VS (\nFile <COCCIOUTPUTFILE>, line 8, column 2,  charpos = 133\n    around = 'else', whole content = \t\telse pr = NULL;;\nFile \"tests/dbg.res\", line 7, column 5,  charpos = 130\n    around = '(', whole content = \t\tDBG(\"PCI\");\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -4,6 +4,6 @@\n     \tstruct resource *pr, *r = &dev->resource[idx];\n     \n     \tif (pr)\n    -\t\tDBG\n    -\t\telse pr = NULL;;\n    +\t\tDBG(\"PCI\");\n    +\telse pr = NULL;\n     }\n"))
+ (dc_close.res Ok) (debug.res Ok) (dec.res Ok) (decl.res Ok) (decl2.res Ok)
+ (decl_space.res Ok)
+ (decl_split.res
+  (Pb
+   "INCORRECT:diff token: int VS }\nFile \"tests/decl_split.c\", line 2, column 8,  charpos = 27\n    around = 'int', whole content =         int x, y;\nFile \"tests/decl_split.res\", line 2, column 0,  charpos = 19\n    around = '}', whole content = }\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,3 +1,2 @@\n     int func(int i) { \n    -        int x, y;\n     }\n"))
+ (define_exp.res Ok) (define_param.res Ok) (deftodo.res Ok) (deref.res Ok)
+ (devlink.res Ok) (disjexpr.res Ok) (disjexpr_ver1.res Ok)
+ (disjexpr_ver2.res Ok) (distribute.res Ok) (double.res Ok)
+ (double_assign.res Ok)
+ (double_switch.res (Pb "PROBLEM\n   exn = Common.Impossible\n"))
+ (doublepos.res Ok)
+ (doubleswitch.res (Pb "PROBLEM\n   exn = Common.Impossible\n"))
+ (dowhile.res Ok) (dropf.res Ok) (dropparam.res Ok) (edots.res Ok)
+ (edots_ver1.res Ok) (empty.res Ok) (end_commas.res Ok) (endif.res Ok)
+ (exp.res Ok) (expnest.res Ok) (expopt.res Ok) (expopt2.res Ok)
+ (expopt3.res Ok) (expopt3_ver1.res Ok) (expopt3_ver2.res Ok) (fields.res Ok)
+ (fieldsmin.res Ok) (fix_flow_need.res Ok) (fn_todo.res Ok) (fnptr.res Ok)
+ (fnret.res Ok) (four.res Ok) (foura.res Ok) (fp.res Ok) (fun.res Ok)
+ (gilles-question.res Ok) (gotobreak.res Ok) (hd.res Ok) (headers.res Ok)
+ (hex.res Ok) (hil1.res Ok) (if.res Ok) (ifbr.res Ok) (ifdef1.res Ok)
+ (ifdef2.res Ok)
+ (ifdef3.res
+  (Pb
+   "PROBLEM\n   exn = Lexer_cocci.Lexical(\"unrecognised symbol, in token rule: #\")\n"))
+ (ifdef4.res Ok) (ifdef5.res Ok) (ifdef6.res Ok) (ifdef6a.res Ok)
+ (ifdefmeta.res Ok) (ifdefmeta1.res Ok) (ifdefmeta2.res Ok)
+ (ifdefmeta3.res Ok)
+ (ifdefmeta4.res
+  (Pb
+   "PROBLEM\n   exn = Unix.Unix_error(20, \"stat\", \"tests/ifdefmeta4.cocci\")\n"))
+ (ifend.res Ok) (ifzer.res Ok) (inc.res Ok)
+ (incdir.res
+  (Pb
+   "INCORRECT:diff token: x VS 12\nFile \"tests/incdir.c\", line 4, column 6,  charpos = 46\n    around = 'x', whole content =   foo(x);\nFile \"tests/incdir.res\", line 4, column 6,  charpos = 46\n    around = '12', whole content =   foo(12);\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,5 +1,5 @@\n     #include \"sub/incdir2.c\"\n     \n     int main () {\n    -  foo(x);\n    +  foo(12);\n     }\n"))
+ (incl.res Ok) (inclifdef.res Ok) (include.res Ok)
+ (incompatible_value.res Ok) (inherited.res Ok) (inherited_ver1.res Ok)
+ (inhpos.res Ok) (initializer.res Ok) (initializer_many_fields.res Ok)
+ (inline.res Ok) (isococci.res Ok) (isotest.res Ok) (isotest2.res Ok)
+ (iterator.res Ok)
+ (jloop1.res
+  (Pb
+   "PROBLEM\n   exn = Failure(\"minus: parse error: \\n = File \\\"tests/jloop1.cocci\\\", line 10, column 3,  charpos = 129\\n    around = '...>', whole content =    ...>\\n\")\n"))
+ (julia10.res Ok) (julia7.res Ok) (keep_comma.res Ok) (km.res Ok)
+ (kmalloc.res Ok) (kmc.res Ok) (ktype.res Ok)
+ (labels_metastatement.res
+  (Pb
+   "INCORRECT:diff token: { VS x\nFile <COCCIOUTPUTFILE>, line 4, column 2,  charpos = 30\n    around = '{', whole content =   {\nFile \"tests/labels_metastatement.res\", line 4, column 4,  charpos = 32\n    around = 'x', whole content =     x = 3; foo();\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,15 +1,10 @@\n     int foo(int i) {\n     \n       if(1) {\n    -  {\n    -    x = 3;\n    -    foo();\n    -    z = 4;\n    -    foo();\n    -  }\n    -  foo();\n    -  }\n    -  foo(); // we dont want that it add both foo on the } and on the endif\n    +    x = 3; foo();\n    +    z = 4; foo();\n    +  } // we dont want that it add both foo on the } and on the endif\n         // (note: but need correct endif accrochage)\n    +  foo();\n     \n     }\n"))
+ (labels_metastatement_ver1.res Ok) (local.res Ok) (localid.res Ok)
+ (longlong.res Ok) (longlongint.res Ok) (loop.res Ok) (lvalue.res Ok)
+ (macro.res Ok) (match_no_meta.res Ok) (max.res Ok)
+ (metahex.res
+  (Pb
+   "INCORRECT:diff token: f VS }\nFile \"tests/metahex.c\", line 2, column 2,  charpos = 15\n    around = 'f', whole content =   f(3);\nFile \"tests/metahex.res\", line 2, column 0,  charpos = 13\n    around = '}', whole content = }\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,4 +1,2 @@\n     int main() {\n    -  f(3);\n    -  g(0x03);\n     }\n"))
+ (metaruleelem.res Ok) (metastatement2.res Ok) (metastatement_for.res Ok)
+ (metastatement_if.res Ok) (minstruct.res Ok) (minusdots.res Ok)
+ (minusdots_ver1.res Ok)
+ (multi_func1.res
+  (Pb
+   "PROBLEM\n   exn = Failure(\"minus: parse error: \\n = File \\\"tests/multi_func1.cocci\\\", line 12, column 2,  charpos = 102\\n    around = 'fn2', whole content =   fn2(...) {\\n\")\n"))
+ (multiplus.res Ok) (multitype.res Ok) (multitypedef.res Ok)
+ (multivars.res Ok) (nest.res Ok) (nestone.res Ok) (nestseq.res Ok)
+ (neststruct.res Ok) (nl.res Ok) (nocast.res Ok) (not.res Ok) (noty.res Ok)
+ (null_type.res Ok) (of.res Ok) (oneline.res Ok) (opt.res Ok)
+ (optional_qualifier.res Ok) (optional_storage.res Ok) (orexp.res Ok)
+ (param.res Ok) (param_end.res Ok) (param_ver1.res Ok)
+ (parameters_dots.res Ok) (partial.res Ok)
+ (pb_distribute_type.res
+  (Pb
+   "INCORRECT:PB parsing only in generated-file\n    diff (result(<) vs expected_result(>)) = \n    @@ -5,11 +5,11 @@\n     \n     \n     int foo() {\n    -  int * *x;\n    +  int **x;\n       return 0;\n     }\n     \n     int foo() {\n    -  int[45] *x;\n    +  int (*x)[45];\n       return 0;\n     }\n"))
+ (pb_distribute_type2.res
+  (Pb
+   "INCORRECT:PB parsing only in generated-file\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,5 +1,5 @@\n     int foo() {\n    -  int* x;\n    +  int *x;\n       return 0;\n     }\n     \n    @@ -10,6 +10,6 @@\n     }\n     \n     int foo() {\n    -  int x[45]*;\n    +  int (*x)[45];\n       return 0;\n     }\n"))
+ (pb_distribute_type3.res
+  (Pb "PROBLEM\n   exn = Failure(\"line 7: index 53 53 already used\\n\")\n"))
+ (pb_distribute_type4.res Ok) (pb_params_iso.res Ok)
+ (pb_parsing_macro.res Ok) (pb_tag_symbols.res Ok) (pmac.res Ok)
+ (posiso.res Ok) (positionc.res Ok) (post.res Ok) (print_return.res Ok)
+ (proto.res Ok) (proto2.res Ok) (proto_ver1.res Ok) (proto_ver2.res Ok)
+ (protoassert.res Ok) (protox.res Ok) (rcu3.res Ok)
+ (remstruct.res
+  (Pb
+   "INCORRECT:not same number of entities (func, decl, ...)\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,10 +1,3 @@\n    -\n    -      .ack    = mpuio_ack_irq,\n    -      .mask   = mpuio_mask_irq,\n    -      .unmask = mpuio_unmask_irq\n    -\n    -  .b = 15,\n    -\n     int hello ( String input )\n     {\n       String input = input.lowercase();\n"))
+ (replace_typedef.res Ok) (reserved.res Ok) (retmacro.res Ok) (rets.res Ok)
+ (return.res Ok) (return_implicit.res Ok) (same_expr.res Ok)
+ (scope_problem.res
+  (Pb
+   "INCORRECT:diff token: } VS a\nFile <COCCIOUTPUTFILE>, line 6, column 2,  charpos = 45\n    around = '}', whole content =   }\nFile \"tests/scope_problem.res\", line 7, column 4,  charpos = 49\n    around = 'a', whole content =     a = 2;\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,8 +1,10 @@\n     void main(int i) {\n      \n     \n    +\n       if(1) {\n         int a;\n    +    a = 2;\n       }\n     \n     \n"))
+ (serio.res
+  (Pb
+   "INCORRECT:diff token: init_MUTEX VS mutex_init\nFile \"tests/serio.c\", line 7, column 1,  charpos = 130\n    around = 'init_MUTEX', whole content = \tinit_MUTEX(&serio->drv_sem);\nFile \"tests/serio.res\", line 7, column 1,  charpos = 130\n    around = 'mutex_init', whole content = \tmutex_init(&serio->new_lock);\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -4,5 +4,5 @@\n     \n     static void serio_init_port(struct serio *serio)\n     {\n    -\tinit_MUTEX(&serio->drv_sem);\n    +\tmutex_init(&serio->new_lock);\n     }\n"))
+ (shared_brace.res Ok) (signed.res Ok) (sis.res Ok) (sizeof.res Ok)
+ (sizeof_julia.res Ok) (skip.res Ok) (sp.res Ok) (spaces.res Ok) (spl.res Ok)
+ (static.res (Pb "PROBLEM\n   exn = Common.Impossible\n")) (stm1.res Ok)
+ (stm10.res Ok) (stm10_ver1.res Ok) (stm2.res Ok) (stm3.res Ok) (stm4.res Ok)
+ (stm5.res Ok) (stm6.res Ok) (stm7.res Ok) (stm8.res Ok) (stmt.res Ok)
+ (strangeorder.res Ok) (string.res Ok) (struct.res Ok)
+ (struct_metavar.res Ok) (struct_typedef.res Ok) (structfoo.res Ok)
+ (substruct.res Ok) (sw.res Ok) (switch.res Ok) (td.res Ok) (test0.res Ok)
+ (test1.res Ok) (test10.res Ok) (test10_ver1.res Ok) (test11.res Ok)
+ (test11_ver1.res Ok) (test12.res Ok) (test2.res Ok) (test3.res Ok)
+ (test4.res Ok) (test5.res Ok) (test5_ver1.res Ok) (test6.res Ok)
+ (test7.res Ok) (test8.res Ok) (test9.res Ok) (test_unsigned_meta.res Ok)
+ (three_types.res Ok) (threea.res Ok) (top.res Ok) (topdec.res Ok)
+ (topdec_ver1.res Ok) (topdec_ver2.res Ok) (toplevel_macrostmt.res Ok)
+ (toplevel_struct.res Ok) (tup.res Ok) (twoproto.res Ok) (ty.res Ok)
+ (ty1.res Ok) (ty_tyexp.res Ok) (type.res Ok) (type1.res Ok)
+ (type_annotated.res Ok) (type_ver1.res Ok)
+ (type_ver2.res
+  (Pb
+   "INCORRECT:PB parsing only in generated-file\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,5 +1,5 @@\n     int foo() {\n    -  int[10] *x;\n    +  int *x[10];\n       return 0;\n     }\n     \n"))
+ (typedef.res Ok)
+ (typedef3.res
+  (Pb
+   "INCORRECT:diff token: link VS p_dev\nFile <COCCIOUTPUTFILE>, line 7, column 29,  charpos = 137\n    around = 'link', whole content = \tunsigned int iobase = info->link.io.BasePort1;\nFile \"tests/typedef3.res\", line 7, column 29,  charpos = 137\n    around = 'p_dev', whole content = \tunsigned int iobase = info->p_dev->io.BasePort1;\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -4,7 +4,7 @@\n     \n     static void should_work(foo *info)\n     {\n    -\tunsigned int iobase = info->link.io.BasePort1;\n    +\tunsigned int iobase = info->p_dev->io.BasePort1;\n     }\n     \n     static void does_work(struct bluecard_info_t *info)\n"))
+ (typedef_double.res Ok)
+ (typeof.res
+  (Pb
+   "INCORRECT:diff token: x VS sizeof\nFile <COCCIOUTPUTFILE>, line 3, column 4,  charpos = 26\n    around = 'x', whole content =   f(x);\nFile \"tests/typeof.res\", line 3, column 4,  charpos = 26\n    around = 'sizeof', whole content =   f(sizeof(struct foo));\n\n    diff (result(<) vs expected_result(>)) = \n    @@ -1,4 +1,4 @@\n     int main() {\n       int x;\n    -  f(x);\n    +  f(sizeof(struct foo));\n     }\n"))
+ (useless_cast.res Ok) (varargs.res Ok) (video1bis.res Ok) (void.res Ok)
+ (vpos.res Ok) (whitespace.res Ok) (wierd_argument.res Ok)
+ (wierdinit.res
+  (Pb
+   "seems incorrect, but only because of code that was not parsablediff token: dev_link_t VS struct\nFile \"tests/wierdinit.c\", line 4, column 1,  charpos = 27\n    around = 'dev_link_t', whole content = \tdev_link_t *link;\nFile \"tests/wierdinit.res\", line 4, column 1,  charpos = 27\n    around = 'struct', whole content = \tstruct pcmcia_device *link;\n"))
+ (ws2.res Ok) (xfield.res Ok) (y2.res Ok) (zero.res Ok))
\ No newline at end of file
index b3b1e6f..8e0f0d8 100644 (file)
@@ -3,6 +3,6 @@ expression X, Y;
 @@
 
   g();
-+ f(Y,0);
++ f(Y, 0);
   ...
   f(X,Y);
index c9669fc..8cf5d86 100644 (file)
@@ -6,7 +6,7 @@ identifier f;
 + /* some comment */
 + int xxx() {
 +    /* a comment by itself */
-+    return 12; /* another comment */ }
++    return 12;/* another comment */ }
 + #endif
  int
  f(...)
index 4a516a5..f455679 100644 (file)
@@ -3,7 +3,7 @@ identifier f;
 @@
 
 + #ifdef FOO
-+ int /*foo*/ xxx;
++ int/*foo*/ xxx;
 + #endif
  int
  f(...)
index 61c6d7e..2823208 100644 (file)
@@ -15,4 +15,4 @@ identifier is_delayed.fld;
 @@
 
 - schedule_work(&device->fld)
-+ schedule_delayed_work(&device->fld,0)
++ schedule_delayed_work(&device->fld, 0)
index f323d1f..ae64289 100644 (file)
@@ -2,7 +2,7 @@
 @@
 
 - f(1,2,3);
-+ g(3,2,1);
++ g(3, 2, 1);
 
 
 @@
index a421069..79f662a 100644 (file)
@@ -10,6 +10,7 @@ T I[E];
 identifier rule3.I;
 expression str;
 type rule3.T;
+declarer name MODULE_PARM;
 @@
 
 - MODULE_PARM(I,str);
diff --git a/tests/badzero.c b/tests/badzero.c
new file mode 100644 (file)
index 0000000..884c4a8
--- /dev/null
@@ -0,0 +1,10 @@
+int main () {
+  int *x;
+  int *y;
+  int z;
+  if (y - x == 0) return;
+  if ((y - x) == 0) return;
+  if (y - z == 0) return;
+  if ((y - z) == 0) return;
+}
+
diff --git a/tests/badzero.cocci b/tests/badzero.cocci
new file mode 100644 (file)
index 0000000..2f5998b
--- /dev/null
@@ -0,0 +1,26 @@
+// A pointer should not be compared to NULL
+//
+// Confidence: High
+// Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU.  GPLv2.
+// URL: http://www.emn.fr/x-info/coccinelle/rules/badzero.html
+// Options:
+
+@r disable is_zero,isnt_zero @
+expression *E;
+position p;
+@@
+
+(
+- E@p == 0
++ 27
+|
+- E@p != 0
++ 27
+|
+- 0 == E@p
++ 27
+|
+- 0 != E@p
++ 27
+)
+
diff --git a/tests/badzero.res b/tests/badzero.res
new file mode 100644 (file)
index 0000000..3810782
--- /dev/null
@@ -0,0 +1,10 @@
+int main () {
+  int *x;
+  int *y;
+  int z;
+  if (y - x == 0) return;
+  if ((y - x) == 0) return;
+  if (27) return;
+  if (27) return;
+}
+
index 2689213..7fb6d36 100644 (file)
@@ -5,7 +5,7 @@ typedef GType, GTypeInfo;
 initialiser E ;
 @@
 + static GType this_type = 0;
-+ static const GTypeInfo this_info = E ;
++ static const GTypeInfo this_info = E;
 GType get_type () {
 - static GType this_type = 0;
   if (...) {
index 33a6511..f692c7e 100644 (file)
@@ -1,6 +1,7 @@
 @@
 identifier I;
 expression str;
+declarer name MODULE_PARM;
 @@
 
 - MODULE_PARM(I,str);
index f111ec4..246f799 100644 (file)
@@ -4,7 +4,7 @@ type T;
 @@
 
 - snd_magic_cast(T, (void*) B ,...)
-+ (T *) B
++ (T *)B
 
 @@
 expression B;
diff --git a/tests/check_order1.c b/tests/check_order1.c
new file mode 100644 (file)
index 0000000..0453e89
--- /dev/null
@@ -0,0 +1,7 @@
+int main () {
+  f(one);
+  f(two);
+  f(three);
+  f(four);
+  f(five);
+}
diff --git a/tests/check_order1.cocci b/tests/check_order1.cocci
new file mode 100644 (file)
index 0000000..8be1027
--- /dev/null
@@ -0,0 +1,11 @@
+@r@
+expression E;
+@@
+
+f(E);
+
+@script:python@
+E << r.E;
+@@
+
+print E
diff --git a/tests/check_order2.c b/tests/check_order2.c
new file mode 100644 (file)
index 0000000..2204f84
--- /dev/null
@@ -0,0 +1,17 @@
+int main () {
+  g(five);
+  g(four);
+  g(three);
+  g(two);
+  g(one);
+  f(one, 1);
+  f(two, 2);
+  f(three, 3);
+  f(four, 4);
+  f(five, 5);
+  f(one, 10);
+  f(two, 20);
+  f(three, 30);
+  f(four, 40);
+  f(five, 50);
+}
diff --git a/tests/check_order2.cocci b/tests/check_order2.cocci
new file mode 100644 (file)
index 0000000..d7df751
--- /dev/null
@@ -0,0 +1,17 @@
+@s@
+expression E;
+@@
+
+g(E);
+
+@r@
+expression s.E, E1;
+@@
+
+f(E,E1);
+
+@script:python@
+E1 << r.E1;
+@@
+
+print E1
index 2a4db6b..aafed95 100644 (file)
@@ -3,5 +3,5 @@ constant X;
 @@
 
 - foo(X);
-+ foobar(X,X);
++ foobar(X, X);
 
index 5393099..20039e6 100644 (file)
@@ -3,4 +3,4 @@ expression E1;
 @@
 
 - pcmcia_get_first_tuple(handle,E1)
-+ pcmcia_get_first_tuple(link,E1)
++ pcmcia_get_first_tuple(link, E1)
index 7920922..66ce982 100644 (file)
@@ -3,4 +3,4 @@ expression E;
 @@
 
 - f(E)
-+ f(E+3)
\ No newline at end of file
++ f(E + 3)
\ No newline at end of file
diff --git a/tests/find_long.c b/tests/find_long.c
new file mode 100644 (file)
index 0000000..eb93b3e
--- /dev/null
@@ -0,0 +1,10 @@
+long function()
+{
+        long a;
+        int b;
+
+        a + b;
+        b + a;
+
+        return a;
+}
diff --git a/tests/find_long.cocci b/tests/find_long.cocci
new file mode 100644 (file)
index 0000000..cfaecb9
--- /dev/null
@@ -0,0 +1,11 @@
+@ C @
+long E1;
+int E2;
+@@
+(
+- E1;
++ (long)E1;
+|
+- E2;
++ (int)E2;
+)
diff --git a/tests/find_long.res b/tests/find_long.res
new file mode 100644 (file)
index 0000000..ae5e19c
--- /dev/null
@@ -0,0 +1,10 @@
+long function()
+{
+        long a;
+        int b;
+
+        (long)a + b;
+        (long)b + a;
+
+        return a;
+}
index ff40f23..8e07ff8 100644 (file)
@@ -1,5 +1,5 @@
 @@
 @@
 
-+struct a {int a;};
++struct a{int a;};
 f(int x) { return x; }
index 2552846..6dedccf 100644 (file)
@@ -2,6 +2,6 @@
 @@
 
 - f(int x, int y) {
-+ f(int x) {
++ f(int x){
    ...
   }
index 3145594..5bff2c7 100644 (file)
@@ -8,8 +8,8 @@ usb_fill_bulk_urb(f)
 identifier p1, p2;
 @@
 
-- void f (struct urb *p1, struct pt_regs *p2)
-+ void f (struct urb *p1)
+- void f(struct urb *p1, struct pt_regs *p2)
++ void f(struct urb *p1)
   {
     ... when != p2
   }
index b79c9ea..57d6263 100644 (file)
@@ -4,7 +4,7 @@
   {
     <...
 +   #ifdef CONFIG_NKERNEL
-+   if (irq < IRQ_LIMIT)
++   if(irq < IRQ_LIMIT)
 +   #endif
     *desc = irq_desc;
     ...>
index 644afa5..accf3ef 100644 (file)
@@ -4,7 +4,7 @@
 
 + #ifdef CONFIG_NKERNEL
 + #ifndef TIMER_32K_SYNCHRONIZED
-+ #define TIMER_32K_SYNCHRONIZED               0xffffffff
++ #define TIMER_32K_SYNCHRONIZED       0xffffffff
 + #endif
 
 + unsigned long nk_vtick_read_stamp(void)
diff --git a/tests/ifdefmeta.c b/tests/ifdefmeta.c
new file mode 100644 (file)
index 0000000..f8bca7e
--- /dev/null
@@ -0,0 +1,49 @@
+int main() {
+    buf = alloca(3
+    #ifdef PLATFORM_A
+// platform a stuff
+                    +5
+                    +50
+    #endif
+    #ifdef PLATFORM_B
+/* platform b stuff */
+                    +2
+    #endif
+            );
+    buf = alloca(3
+    #ifdef PLATFORM_A
+// platform a stuff
+                    +5
+                    +50
+    #endif
+    #ifdef PLATFORM_B
+/* platform b stuff */
+                    +2
+    #endif
+            );
+}
+
+int other() {
+    buf = alloca(3
+    #ifdef PLATFORM_A
+// platform a stuff
+                    +5
+    #endif
+    #ifdef PLATFORM_B
+/* platform b stuff */
+                    +2
+    #endif
+            );
+    buf = alloca(3
+                    +5
+                    +2
+            );
+}
+
+int third() {
+    buf = alloca(3+5+2);
+    buf = alloca(3
+                    +5
+                    +2
+            );
+}
diff --git a/tests/ifdefmeta.cocci b/tests/ifdefmeta.cocci
new file mode 100644 (file)
index 0000000..0841c09
--- /dev/null
@@ -0,0 +1,7 @@
+@@ expression E; @@
+
+-alloca(E)
++malloc(E)
+ ...
+-alloca(E)
++malloc(E)
diff --git a/tests/ifdefmeta.res b/tests/ifdefmeta.res
new file mode 100644 (file)
index 0000000..2fb4fc8
--- /dev/null
@@ -0,0 +1,42 @@
+int main() {
+    buf = malloc(3
+#ifdef PLATFORM_A
+ + 5 + 50
+#endif
+
+#ifdef PLATFORM_B
+ + 2
+#endif
+);
+    buf = malloc(3
+#ifdef PLATFORM_A
+ + 5 + 50
+#endif
+
+#ifdef PLATFORM_B
+ + 2
+#endif
+);
+}
+
+int other() {
+    buf = alloca(3
+    #ifdef PLATFORM_A
+// platform a stuff
+                    +5
+    #endif
+    #ifdef PLATFORM_B
+/* platform b stuff */
+                    +2
+    #endif
+            );
+    buf = alloca(3
+                    +5
+                    +2
+            );
+}
+
+int third() {
+    buf = malloc(3 + 5 + 2);
+    buf = malloc(3 + 5 + 2);
+}
diff --git a/tests/ifdefmeta1.c b/tests/ifdefmeta1.c
new file mode 100644 (file)
index 0000000..a82ceab
--- /dev/null
@@ -0,0 +1,17 @@
+int main() {
+    buf = alloca(3
+    #ifdef PLATFORM_A
+// platform a stuff
+
+
+                    +5
+
+
+
+    #endif
+    #ifdef PLATFORM_B
+/* platform b stuff */
+                    +2
+    #endif
+            );
+}
diff --git a/tests/ifdefmeta1.cocci b/tests/ifdefmeta1.cocci
new file mode 100644 (file)
index 0000000..c04e29d
--- /dev/null
@@ -0,0 +1,3 @@
+@@ expression E,E1; @@
+
+-E1=alloca(E);
diff --git a/tests/ifdefmeta1.res b/tests/ifdefmeta1.res
new file mode 100644 (file)
index 0000000..b2f9976
--- /dev/null
@@ -0,0 +1,2 @@
+int main() {
+}
diff --git a/tests/ifdefmeta2.c b/tests/ifdefmeta2.c
new file mode 100644 (file)
index 0000000..9950d90
--- /dev/null
@@ -0,0 +1,12 @@
+int main() {
+    buf = alloca(3
+
+
+                    +5
+
+
+
+
+                    +2
+            );
+}
diff --git a/tests/ifdefmeta2.cocci b/tests/ifdefmeta2.cocci
new file mode 100644 (file)
index 0000000..c04e29d
--- /dev/null
@@ -0,0 +1,3 @@
+@@ expression E,E1; @@
+
+-E1=alloca(E);
diff --git a/tests/ifdefmeta2.res b/tests/ifdefmeta2.res
new file mode 100644 (file)
index 0000000..b2f9976
--- /dev/null
@@ -0,0 +1,2 @@
+int main() {
+}
diff --git a/tests/ifdefmeta3.c b/tests/ifdefmeta3.c
new file mode 100644 (file)
index 0000000..6c40d0b
--- /dev/null
@@ -0,0 +1,11 @@
+int main () {
+  f();
+  if (foo) {
+    one();
+#ifdef ONE
+    two();
+#endif
+    three();
+  }
+  g();
+}
diff --git a/tests/ifdefmeta3.cocci b/tests/ifdefmeta3.cocci
new file mode 100644 (file)
index 0000000..b3b7e00
--- /dev/null
@@ -0,0 +1,8 @@
+@@
+statement S;
+@@
+
+  f();
+- S
++ xxx();
+  g();
diff --git a/tests/ifdefmeta3.res b/tests/ifdefmeta3.res
new file mode 100644 (file)
index 0000000..d470bd0
--- /dev/null
@@ -0,0 +1,5 @@
+int main () {
+  f();
+  xxx();
+  g();
+}
diff --git a/tests/ifdefmeta4.res b/tests/ifdefmeta4.res
new file mode 100644 (file)
index 0000000..b63949d
--- /dev/null
@@ -0,0 +1,3 @@
+int main () {
+  // a comment
+}
diff --git a/tests/ifelse.c b/tests/ifelse.c
new file mode 100644 (file)
index 0000000..b6745d8
--- /dev/null
@@ -0,0 +1,52 @@
+
+int f(void)
+{
+if (x1)
+   w++;
+else if (y1)
+   z--;
+else if (z1)
+   a--;
+
+if (x2)
+   w++;
+else if (y2)
+   z--;
+
+if (x3)
+   {
+   w++;
+   }
+else if (y3)
+   {
+   z--;
+   }
+
+if (x4)
+   w++;
+else if (y4)
+   z--;
+else if (z4)
+   a--;
+else if (a4)
+   a--;
+}
+
+
+function if_if(void)
+{
+if (x4)
+   w++;
+if (y4)
+   z--;
+
+dummy--;
+
+if (x5)
+   w++;
+A++;
+if (y5)
+   z--;
+
+}
+
diff --git a/tests/ifelse.cocci b/tests/ifelse.cocci
new file mode 100644 (file)
index 0000000..72fa7de
--- /dev/null
@@ -0,0 +1,93 @@
+@ if_else_3 @
+position p_3_1, p_3_2;
+expression E_3_1, E_3_2, E_3_3, E_3_4; 
+statement S_3_1, S_3_2, S_3_3, S_3_4;
+@@
+if (E_3_1)
+   S_3_1
+else if (E_3_2)
+   S_3_2
+else if@p_3_1 (E_3_3)
+   S_3_3
+else if@p_3_2 (E_3_4)
+   S_3_4
+// + foo_3();
+
+@
+
+script:python @ expr_1 << if_else_3.E_3_1;
+                expr_2 << if_else_3.E_3_2;
+                expr_3 << if_else_3.E_3_3;
+                expr_4 << if_else_3.E_3_4;
+              @@
+print "--- 4"
+print expr_1
+print expr_2
+print expr_3
+print expr_4
+
+@ if_else_2 @
+position p_2 != if_else_3.p_3_2;
+expression E_2_1, E_2_2, E_2_3; 
+statement S_2_1, S_2_2, S_2_3;
+@@
+if (E_2_1)
+   S_2_1
+else if (E_2_2)
+   S_2_2
+else if@p_2 (E_2_3)
+   S_2_3
+// + foo_2();
+
+@
+
+script:python @ expr_1 << if_else_2.E_2_1;
+                expr_2 << if_else_2.E_2_2;
+                expr_3 << if_else_2.E_2_3;
+              @@
+print "--- 3"
+print expr_1
+print expr_2
+print expr_3
+
+@ if_else_1 @ 
+// @@
+// position p1;
+expression E_1_1, E_1_2; 
+statement S_1_1, S_1_2;
+position p_1_1 != if_else_3.p_3_1;
+position p_1_2 != if_else_2.p_2;
+@@
+if@p_1_1 (E_1_1)
+   S_1_1
+else if@p_1_2 (E_1_2)
+   S_1_2
+// + foo_1();
+
+@
+
+script:python @ expr_1 << if_else_1.E_1_1;
+                expr_2 << if_else_1.E_1_2;
+              @@
+print "--- 2"
+print expr_1
+print expr_2
+
+@ if_if_1 @ 
+expression E_10_1, E_10_2; 
+statement S_10_1, S_10_2;
+@@
+if (E_10_1)
+   S_10_1
+if (E_10_2)
+   S_10_2
+// + bar();
+@
+
+script:python @ expr_1 << if_if_1.E_10_1;
+                expr_2 << if_if_1.E_10_2;
+              @@
+print "- 2"
+print expr_1
+print expr_2
+
index 6153aa7..12414ac 100644 (file)
@@ -5,7 +5,7 @@ expression E1,E2;
 @@
 
 - x = (T)kmalloc(E1,E2)
-+ x = kzalloc(E1,E2)
++ x = kzalloc(E1, E2)
   ...
 (
 - memset((T2)x,0,E1);
index 8f0c941..6719e0f 100644 (file)
@@ -1,5 +1,4 @@
 int main() {
   int *data = kzalloc(element->string.length + 1, GFP_KERNEL);
   foo();
-  memset(data, 0, element->string.length + 1);
 }
index a2504ef..208e3d4 100644 (file)
@@ -6,6 +6,6 @@ type T;
 
   x =
 -   (T)kmalloc(E1,E2)
-+   kzalloc(E1,E2)
++   kzalloc(E1, E2)
   ...
 - memset(x,0,E1);
\ No newline at end of file
index b08e687..d8981e4 100644 (file)
@@ -7,6 +7,6 @@ expression E2;
 @@
 
 - x = kmalloc(sizeof(T1),E2)
-+ x = kzalloc(sizeof(T1),E2)
++ x = kzalloc(sizeof(T1), E2)
   ...
 - memset(x,0,sizeof(*y));
diff --git a/tests/ldecl.c b/tests/ldecl.c
new file mode 100644 (file)
index 0000000..0ab3704
--- /dev/null
@@ -0,0 +1,5 @@
+ int main(){
+     int a, b;
+     int c = a + b;
+     return 0;
+}
diff --git a/tests/ldecl.cocci b/tests/ldecl.cocci
new file mode 100644 (file)
index 0000000..08ea55d
--- /dev/null
@@ -0,0 +1,7 @@
+@test@
+int E1, E2;
+int E3;
+@@
+  E3 =
+-  E1 + E2
++  E1 - E2
diff --git a/tests/longconst.c b/tests/longconst.c
new file mode 100644 (file)
index 0000000..bcf3dc5
--- /dev/null
@@ -0,0 +1,19 @@
+long function1()
+{
+        long a;
+        int b;
+        a = 1l << b;
+        a = 1u << b;
+        a = 65536l << b;
+        a = 65536u << b;
+        a = 65536 << b;
+        a = 4294967296 << b;
+        a = 65535 << b;
+        a = 4294967295 << b;
+        a = 0x7fffffff << b;
+        a = 0x1fl << b;
+        a = 0x1fu << b;
+        a = 0x1FL << b;
+        a = 0x1FU << b;
+        return a;
+}
diff --git a/tests/longconst.cocci b/tests/longconst.cocci
new file mode 100644 (file)
index 0000000..6135fba
--- /dev/null
@@ -0,0 +1,31 @@
+@@
+expression E;
+long E1;
+int E2;
+@@
+- E1 = E2 << E;
++ E1 = f(E2, "int");
+
+@@
+expression E;
+long E1;
+unsigned int E2;
+@@
+- E1 = E2 << E;
++ E1 = f(E2, "unsigned");
+
+@@
+expression E;
+long E1;
+long E2;
+@@
+- E1 = E2 << E;
++ E1 = f(E2, "long");
+
+@@
+expression E;
+long E1;
+unsigned long E2;
+@@
+- E1 = E2 << E;
++ E1 = f(E2, "unsigned long");
diff --git a/tests/longconst.res b/tests/longconst.res
new file mode 100644 (file)
index 0000000..04a2126
--- /dev/null
@@ -0,0 +1,19 @@
+long function1()
+{
+        long a;
+        int b;
+        a = f(1l, "long");
+        a = f(1u, "unsigned");
+        a = f(65536l, "long");
+        a = f(65536u, "unsigned");
+        a = f(65536, "int");
+        a = f(4294967296, "int");
+        a = f(65535, "int");
+        a = f(4294967295, "int");
+        a = f(0x7fffffff, "int");
+        a = f(0x1fl, "long");
+        a = f(0x1fu, "unsigned");
+        a = f(0x1FL, "long");
+        a = f(0x1FU, "unsigned");
+        return a;
+}
diff --git a/tests/macro_int16.c b/tests/macro_int16.c
new file mode 100644 (file)
index 0000000..85a43f3
--- /dev/null
@@ -0,0 +1,9 @@
+#define INT16 int
+//typedef int INT16;
+
+void main(void)
+{
+     INT16 a, b, c;
+     c = a + b;
+}
+
diff --git a/tests/macro_int16.cocci b/tests/macro_int16.cocci
new file mode 100644 (file)
index 0000000..fd9aeff
--- /dev/null
@@ -0,0 +1,5 @@
+@testint16@
+int E1, E2, E3;
+@@
+- E1 = E2 + E3;
++E1 = E2 - E3;
diff --git a/tests/macro_int16.res b/tests/macro_int16.res
new file mode 100644 (file)
index 0000000..ded0150
--- /dev/null
@@ -0,0 +1,9 @@
+#define INT16 int
+//typedef int INT16;
+
+void main(void)
+{
+     INT16 a, b, c;
+     c = b - a;
+}
+
index bbe7da8..00dcdd9 100644 (file)
@@ -4,4 +4,4 @@ statement S;
 
   f();
 - S
-+ foo(); S
++ foo();S
index c26462c..91bca0d 100644 (file)
@@ -11,4 +11,4 @@ rule1.T *E;
 @@
 
 - g(E)
-+ g(E,NULL)
++ g(E, NULL)
index 1ad529b..900131e 100644 (file)
@@ -5,4 +5,4 @@ expression E,E2;
 @@
 
 - x = kmalloc(sizeof(E),E2)
-+ x = kzalloc(sizeof(E),E2)
++ x = kzalloc(sizeof(E), E2)
diff --git a/tests/oddifdef.c b/tests/oddifdef.c
new file mode 100644 (file)
index 0000000..1a21d98
--- /dev/null
@@ -0,0 +1,44 @@
+void one () {
+  if (errno != ENOENT 
+#ifdef ENOTDIR
+      && errno != ENOTDIR
+#endif
+    )
+    a = 5;
+
+#ifdef FOO
+  x = 0;
+#else
+  x = 0;
+#endif
+}
+
+void two() {
+#ifdef ENOTTY
+  if (errno == ENOTTY)
+    is_a_tty=0;
+  else
+#endif
+    a = 3;
+
+#ifdef FOO
+  x = 0;
+#else
+  x = 0;
+#endif
+}
+
+void three() {
+  if (x)
+    a = 3;
+#ifndef OPENSSL_NO_SSL2
+  else if (strcmp(*argv,"-ssl2") == 0)
+    meth=SSLv2_client_method();
+#endif
+
+#ifdef FOO
+  x = 0;
+#else
+  x = 0;
+#endif
+}
diff --git a/tests/oddifdef.cocci b/tests/oddifdef.cocci
new file mode 100644 (file)
index 0000000..19bf658
--- /dev/null
@@ -0,0 +1,6 @@
+@@
+@@
+
+- x = 0;
+  ...
+- x = 0;
diff --git a/tests/oddifdef.res b/tests/oddifdef.res
new file mode 100644 (file)
index 0000000..1a21d98
--- /dev/null
@@ -0,0 +1,44 @@
+void one () {
+  if (errno != ENOENT 
+#ifdef ENOTDIR
+      && errno != ENOTDIR
+#endif
+    )
+    a = 5;
+
+#ifdef FOO
+  x = 0;
+#else
+  x = 0;
+#endif
+}
+
+void two() {
+#ifdef ENOTTY
+  if (errno == ENOTTY)
+    is_a_tty=0;
+  else
+#endif
+    a = 3;
+
+#ifdef FOO
+  x = 0;
+#else
+  x = 0;
+#endif
+}
+
+void three() {
+  if (x)
+    a = 3;
+#ifndef OPENSSL_NO_SSL2
+  else if (strcmp(*argv,"-ssl2") == 0)
+    meth=SSLv2_client_method();
+#endif
+
+#ifdef FOO
+  x = 0;
+#else
+  x = 0;
+#endif
+}
diff --git a/tests/parse_field.c b/tests/parse_field.c
new file mode 100644 (file)
index 0000000..e5fdeb4
--- /dev/null
@@ -0,0 +1,4 @@
+void blk_queue_prep_rq(struct request_queue *q, prep_rq_fn *pfn)
+{
+       q->prep_rq_fn = pfn;
+}
diff --git a/tests/parsing_pad.c b/tests/parsing_pad.c
new file mode 100644 (file)
index 0000000..c84edf9
--- /dev/null
@@ -0,0 +1,14 @@
+#ifdef SIGALRM
+#if defined(__STDC__) || defined(sgi) || defined(_AIX)
+#define SIGRETTYPE void*
+#else
+#define SIGRETTYPE int*
+#endif
+
+
+SIGRETTYPE foo(void) 
+{
+       void x;
+
+       int x$y;
+}
diff --git a/tests/parsing_pad.cocci b/tests/parsing_pad.cocci
new file mode 100644 (file)
index 0000000..9b8929c
--- /dev/null
@@ -0,0 +1,8 @@
+@@
+identifier x;
+@@
+
+//- void* x;
+//+ int* x;
+- void*
++ int*
index 9d87696..2da3b7d 100644 (file)
@@ -2,7 +2,7 @@
 @@
 
 + static struct pcmcia_driver ZZZ_driver = {
-+       .owner          = THIS_MODULE,
++       .owner = THIS_MODULE,
 + };
 
   int init (...) {
index 069b5aa..49b70cf 100644 (file)
@@ -5,4 +5,4 @@ expression E2;
 @@
 
 -    list_entry(I,T,E2)
-+    list_entry(_X(I),T,E2)
++    list_entry(_X(I), T, E2)
diff --git a/tests/slow.c b/tests/slow.c
new file mode 100644 (file)
index 0000000..d762cbc
--- /dev/null
@@ -0,0 +1,57 @@
+qboolean SV_ReadClientMessage (void)
+{
+       int             ret;
+       int             cmd;
+       char            *s;
+       
+                               if (host_client->privileged)
+                                       ret = 2;
+                               else
+                                       ret = 0;
+                               if (Q_strncasecmp(s, "status", 6) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "god", 3) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "notarget", 8) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "fly", 3) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "name", 4) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "noclip", 6) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "say", 3) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "say_team", 8) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "tell", 4) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "color", 5) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "kill", 4) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "pause", 5) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "spawn", 5) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "begin", 5) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "prespawn", 8) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "kick", 4) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "ping", 4) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "give", 4) == 0)
+                                       ret = 1;
+                               else if (Q_strncasecmp(s, "ban", 3) == 0)
+                                       ret = 1;
+                               if (ret == 2)
+                                       Cbuf_InsertText (s);
+                               else if (ret == 1)
+                                       Cmd_ExecuteString (s, src_client);
+                               else
+                                       Con_DPrintf("%s tried to %s\n", host_client->name, s);
+                               
+}
+
index 6d657c6..85094c5 100644 (file)
@@ -4,4 +4,4 @@ statement S;
 
   f();
 - S
-+ g(); S
++ g();S
index b7dd005..5ce3772 100644 (file)
@@ -2,7 +2,7 @@
 @@
 
 - struct dvb_frontend {
-+ struct dvb2_frontend {
++ struct dvb2_frontend{
         ...
 -       struct dvb_frontend_ops* ops;
 +       struct dvb_frontend_ops ops;
index 43f0d29..ce67f96 100644 (file)
@@ -6,4 +6,4 @@ expression X,Y,Z;
    g(Z);
    ...
 -  h(Y);
-+  h(X,Y,Z); 
++  h(X, Y, Z); 
index 3c4352f..e9c3b47 100644 (file)
@@ -7,5 +7,5 @@ expression X;
  g(X)
  ...
 - h(X)
-+ h(X,X)
++ h(X, X)
  
\ No newline at end of file
index 3c4352f..e9c3b47 100644 (file)
@@ -7,5 +7,5 @@ expression X;
  g(X)
  ...
 - h(X)
-+ h(X,X)
++ h(X, X)
  
\ No newline at end of file
index 8ecfec2..7d24f4d 100644 (file)
@@ -3,6 +3,6 @@ expression X, Y;
 @@
 
 - f(X)
-+ f(X,Y)
++ f(X, Y)
   ...
   g(Y)
index 30008ce..1220a9f 100644 (file)
@@ -4,6 +4,6 @@ expression X,Y;
   f(X);
   ...
 - g(Y);
-+ h(X,Y);
++ h(X, Y);
 
 //error words = [f]
\ No newline at end of file
index caf6245..85f3958 100644 (file)
@@ -3,6 +3,6 @@ expression X;
 @@
 
 - f(X)
-+ f(X,"foo")
++ f(X, "foo")
 
 //error words = [f]
\ No newline at end of file
index e9ebdd3..7ba694c 100644 (file)
@@ -3,5 +3,5 @@ expression X;
 @@
 
 - f(X);
-+ f(X,"foo");
-+ f(X,"bar");
++ f(X, "foo");
++ f(X, "bar");
index efdeb3c..dae02c9 100644 (file)
@@ -8,6 +8,6 @@ expression X,Y;
    f(X);
    ...
 -  h(Y);
-+  h(X,Y); 
++  h(X, Y); 
    ...
  }
index f10ae48..9b073c1 100644 (file)
@@ -1,4 +1,5 @@
 @@
+declarer name MODULE_PARM;
 @@
 
 - MODULE_PARM(...);
index 2ca4ce1..311745d 100644 (file)
@@ -1,11 +1,9 @@
-// better perhaps to use a 
-// declaration MODULE_PARM; 
-// declaration module_parm; 
-// ?
 @@
 expression x,y;
+declarer name MODULE_PARM;
+declarer name module_param;
 @@
 
 - MODULE_PARM(x,y);
-+ module_param(x,int,y);
++ module_param(x, int, y);
 
index 6308e60..ead69ce 100644 (file)
@@ -3,4 +3,4 @@ expression E;
 @@
 
 - foo(E);
-+ foo(E,12);
++ foo(E, 12);
diff --git a/tests/xfield.c b/tests/xfield.c
new file mode 100644 (file)
index 0000000..2db596e
--- /dev/null
@@ -0,0 +1,10 @@
+FOO(a2,b2,c2);
+
+/*
+int y;
+
+struct foo {
+  FOO(a,b,c);
+  FOO(a1,b1,c1);
+};
+*/
diff --git a/tests/xfield.cocci b/tests/xfield.cocci
new file mode 100644 (file)
index 0000000..f26e081
--- /dev/null
@@ -0,0 +1,7 @@
+@@
+declarer name FOO;
+expression a,b,c;
+@@
+
+- FOO(a,b,c);
++ int x;
diff --git a/tests/xfield.res b/tests/xfield.res
new file mode 100644 (file)
index 0000000..f7d35ad
--- /dev/null
@@ -0,0 +1,10 @@
+int x;
+
+/*
+int y;
+
+struct foo {
+  FOO(a,b,c);
+  FOO(a1,b1,c1);
+};
+*/