Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
isabelle_contrib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Frédéric Tuong
isabelle_contrib
Commits
2a06b7d8
Commit
2a06b7d8
authored
3 years ago
by
Frédéric Tuong
Browse files
Options
Downloads
Patches
Plain Diff
simplify
parent
47d6cb3c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
C11-FrontEnd/examples/C2.thy
+2
-2
2 additions, 2 deletions
C11-FrontEnd/examples/C2.thy
C11-FrontEnd/examples/C_paper.thy
+2
-5
2 additions, 5 deletions
C11-FrontEnd/examples/C_paper.thy
C11-FrontEnd/src/C_Command.thy
+19
-13
19 additions, 13 deletions
C11-FrontEnd/src/C_Command.thy
with
23 additions
and
20 deletions
C11-FrontEnd/examples/C2.thy
+
2
−
2
View file @
2a06b7d8
...
...
@@ -376,8 +376,8 @@ subsection \<open>Continuation Calculus with the C Environment: Presentation in
declare [[C_parser_trace = false]]
ML\<open>
fun C src
= C_Module.C'
(C_Module.env (Context.the_generic_context ())) src
val C' = C_Module.C'
val C
= C_Module.C'
NONE
val C' = C_Module.C'
o SOME
\<close>
C \<comment> \<open>Nesting C code without propagating the C environment\<close> \<open>
...
...
This diff is collapsed.
Click to expand it.
C11-FrontEnd/examples/C_paper.thy
+
2
−
5
View file @
2a06b7d8
...
...
@@ -50,17 +50,14 @@ ML\<open>
val
_
=
Theory
.
setup
(
C_Inner_Syntax
.
command
C_Inner_Isar_Cmd
.
setup
'
C_Parse
.
ML_source
(
"
\<simeq>
setup"
,
\<^here>
,
\<^here>
))
val
C'
=
C_Module
.
C'
fun
C
opt
=
case
opt
of
NONE
=
>
C'
(
C_Module
.
env
(
Context
.
the_generic_context
()))
|
SOME
env
=
>
C'
env
val
C
=
C_Module
.
C'
fun
C_def
dir
name
_
_
=
Context
.
map_theory
(
C_Inner_Syntax
.
command'
(
C_Inner_Syntax
.
drop1
(
C_Scan
.
Right
(
(
fn
src
=
>
fn
context
=
>
C
'
(
C_Stack
.
Data_Lang
.
get'
context
|
>
#2
)
src
context
)
C
_Module
.
C'
(
SOME
(
C_Stack
.
Data_Lang
.
get'
context
|
>
#2
)
)
src
context
)
,
dir
)))
C_Parse
.
C_source
name
)
...
...
This diff is collapsed.
Click to expand it.
C11-FrontEnd/src/C_Command.thy
+
19
−
13
View file @
2a06b7d8
...
...
@@ -360,19 +360,25 @@ fun C source =
exec_eval
source
#>
Local_Theory
.
propagate_ml_env
fun
C'
env_lang
src
context
=
context
|
>
C_Env
.
empty_env_tree
|
>
C_Context
.
eval_source'
env_lang
(
fn
src
=
>
start
src
context
)
err
accept
src
|
>
(
fn
(_,
{
context
,
reports_text
,
error_lines
}
)
=
>
tap
(
fn
_
=
>
case
error_lines
of
[]
=
>
()
|
l
=
>
warning
(
cat_lines
(
rev
l
)))
(
C_Stack
.
Data_Tree
.
map
(
curry
C_Stack
.
Data_Tree_Args
.
merge
(
reports_text
,
[]))
context
))
val
C'
=
let
fun
C
env_lang
src
context
=
context
|
>
C_Env
.
empty_env_tree
|
>
C_Context
.
eval_source'
env_lang
(
fn
src
=
>
start
src
context
)
err
accept
src
|
>
(
fn
(_,
{
context
,
reports_text
,
error_lines
}
)
=
>
tap
(
fn
_
=
>
case
error_lines
of
[]
=
>
()
|
l
=
>
warning
(
cat_lines
(
rev
l
)))
(
C_Stack
.
Data_Tree
.
map
(
curry
C_Stack
.
Data_Tree_Args
.
merge
(
reports_text
,
[]))
context
))
in
fn
NONE
=
>
(
fn
src
=
>
C
(
env
(
Context
.
the_generic_context
()))
src
)
|
SOME
env_lang
=
>
C
env_lang
end
fun
C_export_file
(
pos
,
_)
lthy
=
let
...
...
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