File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ SOURCES = \
1010 cparser.mly \
1111 ctoxml.ml \
1212 frontc.ml
13+ OCAMLYACC_FLAGS = -v
1314
1415$(eval $(call ocaml_lib,frontc,$(SOURCES)))
1516
Original file line number Diff line number Diff line change @@ -542,18 +542,22 @@ typedef_type:
542542;
543543typedef_sub :
544544 NAMED_TYPE {(NAMED_TYPE $1, [])}
545- | NAMED_TYPE CONST {(NAMED_TYPE $1, [BASE_CONST])}
546545| comp_type {($1, [])}
547- | comp_type CONST {($1, [BASE_CONST])}
548546| typedef_qual {$1}
549547 /* !!TODO!! Unknown named type support : add option for it */
550548| IDENT { Clexer. add_type $1; (NAMED_TYPE $1, [])}
549+ | NAMED_TYPE CONST {(NAMED_TYPE $1, [BASE_CONST])}
550+ | NAMED_TYPE VOLATILE {(NAMED_TYPE $1, [BASE_VOLATILE])}
551+ | comp_type CONST {($1, [BASE_CONST])}
552+ | comp_type VOLATILE {($1, [BASE_VOLATILE])}
551553| IDENT CONST { Clexer. add_type $1; (NAMED_TYPE $1, [BASE_CONST])}
554+ | IDENT VOLATILE { Clexer. add_type $1; (NAMED_TYPE $1, [BASE_VOLATILE])}
552555;
553556typedef_qual :
554557 qual_type {$1}
555558| typedef_qual qual_type {apply_qual $1 $2}
556559| typedef_qual CONST {(fst $1, BASE_CONST::(snd $1))}
560+ | typedef_qual VOLATILE {(fst $1, BASE_VOLATILE::(snd $1))}
557561;
558562typedef_defs :
559563 typedef_def {[$1]}
Original file line number Diff line number Diff line change 1+ typedef const int t1 ;
2+ typedef volatile int t2 ;
3+
4+ typedef int const t3 ;
5+ typedef int volatile t4 ;
6+
7+ typedef const t t5 ;
8+ typedef volatile t t6 ;
9+
10+ typedef t const t7 ;
11+ typedef t volatile t8 ;
12+
13+ typedef const struct t t9 ;
14+ typedef volatile struct t t10 ;
15+
16+ typedef struct t const t11 ;
17+ typedef struct t volatile t12 ;
You can’t perform that action at this time.
0 commit comments