Skip to content
Snippets Groups Projects
Commit 53efdd8c authored by Jean-Christophe Léchenet's avatar Jean-Christophe Léchenet Committed by Virgile Prevosto
Browse files

[Parsing] Parsing of ghost parameters

Ghost parameters are parsed, but thrown after parsing
parent d8fd486b
No related branches found
No related tags found
No related merge requests found
...@@ -1022,6 +1022,18 @@ for_clause: ...@@ -1022,6 +1022,18 @@ for_clause:
| declaration { FC_DECL $1 } | declaration { FC_DECL $1 }
; ;
/* 01/12/2017: ghost_parameter_opt and ghost_parameter are parsed
then thrown
*/
ghost_parameter_opt:
/* empty */ { }
| ghost_parameter { }
;
ghost_parameter:
LGHOST parameter_list_startscope rest_par_list RPAREN RGHOST { }
;
declaration: /* ISO 6.7.*/ declaration: /* ISO 6.7.*/
decl_spec_list init_declarator_list SEMICOLON decl_spec_list init_declarator_list SEMICOLON
{ doDeclaration None ((snd $1)) (fst $1) $2 } { doDeclaration None ((snd $1)) (fst $1) $2 }
...@@ -1382,7 +1394,7 @@ function_def_start: /* (* ISO 6.9.1 *) */ ...@@ -1382,7 +1394,7 @@ function_def_start: /* (* ISO 6.9.1 *) */
(snd $1, fst $1, $2) (snd $1, fst $1, $2)
} }
/* (* New-style function that does not have a return type *) */ /* (* New-style function that does not have a return type *) */
| IDENT parameter_list_startscope rest_par_list RPAREN | IDENT parameter_list_startscope rest_par_list RPAREN ghost_parameter_opt
{ let (params, isva) = $3 in { let (params, isva) = $3 in
let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_end_pos 1) in let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_end_pos 1) in
let fdec = let fdec =
...@@ -1403,7 +1415,7 @@ function_def_start: /* (* ISO 6.9.1 *) */ ...@@ -1403,7 +1415,7 @@ function_def_start: /* (* ISO 6.9.1 *) */
(* Default is int type *) (* Default is int type *)
(loc, [SpecType Tint], fdec) (loc, [SpecType Tint], fdec)
} }
| IDENT LPAREN RPAREN | IDENT LPAREN RPAREN ghost_parameter_opt
{ {
let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_start_pos 1) in let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_start_pos 1) in
let fdec = ($1, PROTO(JUSTBASE,[],false),[],loc) in let fdec = ($1, PROTO(JUSTBASE,[],false),[],loc) in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment