Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
53efdd8c
Commit
53efdd8c
authored
7 years ago
by
Jean-Christophe Léchenet
Committed by
Virgile Prevosto
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/kernel_internals/parsing/cparser.mly
+14
-2
14 additions, 2 deletions
src/kernel_internals/parsing/cparser.mly
with
14 additions
and
2 deletions
src/kernel_internals/parsing/cparser.mly
+
14
−
2
View file @
53efdd8c
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment