Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lustre-v6
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
verimag
synchrone
lustre-v6
Commits
6cac80b4
Commit
6cac80b4
authored
12 years ago
by
Pascal Raymond
Browse files
Options
Downloads
Patches
Plain Diff
...
parent
c0a2882e
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/getEff.ml
+70
-65
70 additions, 65 deletions
src/getEff.ml
with
70 additions
and
65 deletions
src/getEff.ml
+
70
−
65
View file @
6cac80b4
...
...
@@ -143,7 +143,11 @@ let rec (of_node : Eff.id_solver -> SyntaxTreeCore.node_exp srcflagged ->
*)
(*
C'EST ICI QU'IL FAUT TRAITER LES MACROS PREDEF !
TRAITER LES MACROS PREDEF :
- ici, on juste besoin de fabriquer les arguments statiques effectifs
partir des arguments donns et des args attendus.
- on cherche pas faire rentrer dans le moule, on dlgue
*)
let
static_args_eff
=
match
static_args
with
...
...
@@ -169,12 +173,12 @@ C'EST ICI QU'IL FAUT TRAITER LES MACROS PREDEF !
(** [check_static_arg this pn id sa (symbols, acc)] compile a static arg
into a static_arg
*)
and
(
check_static_arg
:
Eff
.
id_solver
->
SyntaxTreeCore
.
static_param
srcflagged
->
SyntaxTreeCore
.
static_ar
g
srcflagged
->
Eff
.
static_arg
)
=
fun
node_id_solver
sp
sa
->
and
check_static_arg
(
node_id_solver
:
Eff
.
id_solver
)
(
sp
:
SyntaxTreeCore
.
static_
p
ar
am
srcflagged
)
(
sa
:
SyntaxTreeCore
.
static_arg
srcflagged
)
:
Eff
.
static_arg
=
(
let
rec
(
eff_type_and_type_exp_are_equal
:
Eff
.
type_
->
SyntaxTreeCore
.
type_exp_core
->
bool
)
=
fun
teff
texp
->
...
...
@@ -229,73 +233,74 @@ and (check_static_arg : Eff.id_solver ->
else
(
neff
.
inlist_eff
,
neff
.
outlist_eff
)
in
let
sa_eff
=
(* sa = donn ; sp = attendu *)
let
sa_eff
=
match
sa
.
it
,
sp
.
it
with
|
StaticArgIdent
idref
,
StaticParamConst
(
id
,
type_exp
)
->
let
ceff
=
node_id_solver
.
id2const
idref
sa
.
src
in
let
t_ceff
=
type_of_const
ceff
in
check_type_arg
t_ceff
type_exp
;
ConstStaticArgEff
(
id
,
ceff
)
|
StaticArgIdent
idref
,
StaticParamType
(
id
)
->
let
teff
=
node_id_solver
.
id2type
idref
sa
.
src
in
TypeStaticArgEff
(
id
,
teff
)
|
StaticArgConst
ce
,
StaticParamConst
(
id
,
type_exp
)
->
(
let
ceff
=
EvalConst
.
f
node_id_solver
ce
in
let
t_ceff
=
type_of_const
(
List
.
hd
ceff
)
in
check_type_arg
t_ceff
type_exp
;
match
ceff
with
|
[
ceff
]
->
ConstStaticArgEff
(
id
,
ceff
)
|
_
->
assert
false
(* should not occur *)
)
|
StaticArgType
te
,
StaticParamType
id
->
let
teff
=
of_type
n
ode
_
id
_solver
te
in
TypeStaticArgEff
(
id
,
teff
)
|
StaticArgIdent
idref
,
StaticParamNode
(
id
,
vii
,
vio
,_
)
->
(* idref is an alias, hence it cannot have static argument
*)
let
sargs
=
[]
in
let
neff
=
node_id_solver
.
id2node
idref
sargs
sa
.
src
in
(* ICI a revoir ? *
)
(* let (inlist, outlist) = check_node_arg neff vii vio in *)
let
_
=
check_node_arg
neff
vii
vio
in
NodeStaticArgEff
(
id
,
neff
.
node_key_eff
)
|
StaticArgNode
(
CALL_n
ne
)
,
StaticParamNode
(
id
,
vii
,
vio
,_
)
->
let
neff
=
of_node
node_id_solver
ne
in
(* ICI a revoir ? *)
(* let (inlist, outlist) = check_node_arg neff vii vio in *
)
let
_
=
check_node_arg
neff
vii
vio
in
NodeStaticArgEff
(
id
,
neff
.
node_key_eff
)
|
StaticArgNode
(
Predef_n
(
op
,
sargs
))
,
StaticParamNode
(
id
,
vii
,
vio
,_
)
->
let
sargs_eff
=
translate_predef_static_args
node_id_solver
op
.
it
sargs
sa
.
src
in
let
opeff
=
PredefEvalType
.
make_node_exp_eff
node_id_solver
None
op
.
it
sa
.
src
sargs_eff
in
(* ICI a revoir ? *)
(* let (inlist, outlist) = check_node_arg opeff vii vio in *)
let
_
=
check_node_arg
opeff
vii
vio
in
NodeStaticArgEff
(
id
,
opeff
.
node_key_eff
)
|
StaticArgIdent
idref
,
StaticParamConst
(
id
,
type_exp
)
->
let
ceff
=
node_id_solver
.
id2const
idref
sa
.
src
in
let
t_ceff
=
type_of_const
ceff
in
check_type_arg
t_ceff
type_exp
;
ConstStaticArgEff
(
id
,
ceff
)
|
StaticArgIdent
idref
,
StaticParamType
(
id
)
->
let
teff
=
node_id_solver
.
id2type
idref
sa
.
src
in
TypeStaticArgEff
(
id
,
teff
)
|
StaticArgConst
ce
,
StaticParamConst
(
id
,
type_exp
)
->
(
let
ceff
=
EvalConst
.
f
node_id_solver
ce
in
let
t_ceff
=
type_of_const
(
List
.
hd
ceff
)
in
check_type_arg
t_ceff
type_exp
;
match
ceff
with
|
[
ceff
]
->
ConstStaticArgEff
(
id
,
ceff
)
|
_
->
assert
false
(* should not occur *)
)
|
StaticArgType
te
,
StaticParamType
id
->
let
teff
=
of_type
node_id_solver
te
in
TypeStaticArgEff
(
id
,
teff
)
|
StaticArgIdent
idref
,
StaticParamN
ode
(
id
,
vii
,
vio
,_
)
->
(* idref is an alias, hence it cannot have static argument *
)
let
sargs
=
[]
in
let
neff
=
node_id_solver
.
id2node
idref
sargs
sa
.
src
in
(* ICI a revoir ?
*)
(*
let
(inlist, outlist) = check_node_arg neff vii vio in *)
let
_
=
check_node_arg
neff
vii
vio
in
NodeStaticArgEff
(
id
,
neff
.
node_key_eff
)
|
StaticArgNode
(
CALL_n
ne
)
,
StaticParamNode
(
id
,
vii
,
vio
,_
)
->
let
neff
=
of_node
node_id_solver
ne
in
(* ICI a revoir ? *)
(*
let
(inlist, outlist) = check_node_arg neff vii vio in *)
let
_
=
check_node_arg
neff
vii
vio
in
NodeStaticArgEff
(
id
,
neff
.
node_key_eff
)
|
StaticArgNode
(
Predef_n
(
op
,
sargs
))
,
StaticParamNode
(
id
,
vii
,
vio
,_
)
->
let
sargs_eff
=
translate_predef_static_args
node_id_solver
op
.
it
sargs
sa
.
src
in
let
opeff
=
PredefEvalType
.
make_node_exp_eff
node_id_solver
None
op
.
it
sa
.
src
sargs_eff
in
(* ICI a revoir ? *)
(* let (inlist, outlist) = check_node_arg opeff vii vio in *)
let
_
=
check_node_arg
opeff
vii
vio
in
NodeStaticArgEff
(
id
,
opeff
.
node_key_eff
)
|
StaticArgNode
(
|
StaticArgNode
(
(
MERGE_n
_
|
ARRAY_SLICE_n
_
|
ARRAY_ACCES_n
_
|
STRUCT_ACCESS_n
_
|
IDENT_n
_
|
ARRAY_n
|
HAT_n
|
CONCAT_n
|
WITH_n
(
_
)
|
TUPLE_n
|
WHEN_n
(
_
)
|
CURRENT_n
|
FBY_n
|
ARROW_n
|
PRE_n
))
,
_
->
assert
false
|
StaticArgType
_
,
StaticParamNode
(
id
,_,_,_
)
|
StaticArgType
_
,
StaticParamConst
(
id
,_
)
|
StaticArgType
_
,
StaticParamNode
(
id
,_,_,_
)
|
StaticArgType
_
,
StaticParamConst
(
id
,_
)
|
StaticArgNode
_
,
StaticParamType
(
id
)
|
StaticArgNode
_
,
StaticParamConst
(
id
,_
)
|
StaticArgNode
_
,
StaticParamType
(
id
)
|
StaticArgNode
_
,
StaticParamConst
(
id
,_
)
|
StaticArgConst
_
,
StaticParamNode
(
id
,_,_,_
)
|
StaticArgConst
_
,
StaticParamType
(
id
)
->
assert
false
(* can it occur actually? Let's wait it occurs...*)
|
StaticArgConst
_
,
StaticParamNode
(
id
,_,_,_
)
|
StaticArgConst
_
,
StaticParamType
(
id
)
->
assert
false
(* can it occur actually? Let's wait it occurs...*)
in
sa_eff
sa_eff
)
(******************************************************************************)
...
...
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