Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
3cda476c
Commit
3cda476c
authored
Nov 02, 2000
by
Martin Wierich
Browse files
optimizing performance of explicitimports
parent
6b57219a
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
frontend/explicitimports.dcl
View file @
3cda476c
...
@@ -2,8 +2,8 @@ definition module explicitimports
...
@@ -2,8 +2,8 @@ definition module explicitimports
import
syntax
,
checksupport
import
syntax
,
checksupport
possiblyFilterExplImportedDecls
::
![
ImportDeclaration
]
u
:[
w
:(.
Index
,
y
:
Declarations
)]
Position
u0
:
{#
DclModule
}
!*
CheckState
possiblyFilterExplImportedDecls
::
![
ImportDeclaration
]
u
:[
w
:(.
Index
,
y
:
Declarations
)]
Position
*
{#
DclModule
}
!*
CheckState
->
(!
v
:[
x
:(
Index
,
z
:
Declarations
)],!
u0
:
{#
DclModule
},!.
CheckState
),
[
y
<=
z
,
w
<=
x
,
u
<=
v
]
->
(!
v
:[
x
:(
Index
,
z
:
Declarations
)],!
.
{#
DclModule
},!.
CheckState
),
[
y
<=
z
,
w
<=
x
,
u
<=
v
]
checkExplicitImportCompleteness
::
!
Int
![
ExplicitImport
]
!*{#
DclModule
}
!*{#
FunDef
}
!*
ExpressionHeap
!*
CheckState
checkExplicitImportCompleteness
::
!
Int
![
ExplicitImport
]
!*{#
DclModule
}
!*{#
FunDef
}
!*
ExpressionHeap
!*
CheckState
->
(!.{#
DclModule
},!.{#
FunDef
},!.
ExpressionHeap
,!.
CheckState
)
->
(!.{#
DclModule
},!.{#
FunDef
},!.
ExpressionHeap
,!.
CheckState
)
...
...
frontend/explicitimports.icl
View file @
3cda476c
This diff is collapsed.
Click to expand it.
frontend/utilities.dcl
View file @
3cda476c
...
@@ -124,11 +124,12 @@ mapFilterYesSt f l st
...
@@ -124,11 +124,12 @@ mapFilterYesSt f l st
:==
map_filter_yes_st
l
st
:==
map_filter_yes_st
l
st
where
where
map_filter_yes_st
[]
st
map_filter_yes_st
[]
st
#!
st
=
st
=
([],
st
)
=
([],
st
)
map_filter_yes_st
[
h
:
t
]
st
map_filter_yes_st
[
h
:
t
]
st
#!
(
opt_f_h
,
st
)
=
f
h
st
#!
(
opt_f_h
,
st
)
=
f
h
st
(
t2
,
st
)
=
map_filter_yes_st
t
st
(
t2
,
st
)
=
map_filter_yes_st
t
st
f_h_t2
=
optCons
opt_f_h
t2
(
f_h_t2
,
_)
=
optCons
opt_f_h
t2
st
=
st
st
=
st
=
(
f_h_t2
,
st
)
=
(
f_h_t2
,
st
)
...
@@ -136,15 +137,16 @@ iMapFilterYesSt f fr to st
...
@@ -136,15 +137,16 @@ iMapFilterYesSt f fr to st
:==
i_map_filter_yes_st
fr
to
st
:==
i_map_filter_yes_st
fr
to
st
where
where
i_map_filter_yes_st
fr
to
st
i_map_filter_yes_st
fr
to
st
#!
st
=
st
|
fr
>=
to
|
fr
>=
to
=
([],
st
)
=
([],
st
)
#!
(
opt_f_fr
,
st
)
=
f
fr
st
#!
(
opt_f_fr
,
st
)
=
f
fr
st
(
t
,
st
)
=
i_map_filter_yes_st
(
inc
fr
)
to
st
(
t
,
st
)
=
i_map_filter_yes_st
(
inc
fr
)
to
st
f_fr_t2
=
optCons
opt_f_fr
t
(
f_fr_t2
,
_)
=
optCons
opt_f_fr
t
st
=
st
st
=
st
=
(
f_fr_t2
,
st
)
=
(
f_fr_t2
,
st
)
optCons
::
!(
Optional
.
a
)
!
u
:[.
a
]
->
v
:[.
a
]
,[
u
<=
v
]
optCons
::
!(
Optional
.
a
)
!
u
:[.
a
]
->
(!
v
:[.
a
]
,
!
Int
)
,[
u
<=
v
]
revAppend
::
![
a
]
![
a
]
->
[
a
]
// Reverse the list using the second argument as accumulator.
revAppend
::
![
a
]
![
a
]
->
[
a
]
// Reverse the list using the second argument as accumulator.
revMap
::
!(.
a
->
.
b
)
![.
a
]
!
u
:[.
b
]
->
u
:[.
b
]
revMap
::
!(.
a
->
.
b
)
![.
a
]
!
u
:[.
b
]
->
u
:[.
b
]
...
...
frontend/utilities.icl
View file @
3cda476c
...
@@ -209,11 +209,12 @@ mapFilterYesSt f l st
...
@@ -209,11 +209,12 @@ mapFilterYesSt f l st
:==
map_filter_yes_st
l
st
:==
map_filter_yes_st
l
st
where
where
map_filter_yes_st
[]
st
map_filter_yes_st
[]
st
#!
st
=
st
=
([],
st
)
=
([],
st
)
map_filter_yes_st
[
h
:
t
]
st
map_filter_yes_st
[
h
:
t
]
st
#!
(
opt_f_h
,
st
)
=
f
h
st
#!
(
opt_f_h
,
st
)
=
f
h
st
(
t2
,
st
)
=
map_filter_yes_st
t
st
(
t2
,
st
)
=
map_filter_yes_st
t
st
f_h_t2
=
optCons
opt_f_h
t2
(
f_h_t2
,
_)
=
optCons
opt_f_h
t2
st
=
st
st
=
st
=
(
f_h_t2
,
st
)
=
(
f_h_t2
,
st
)
...
@@ -222,19 +223,20 @@ iMapFilterYesSt f fr to st
...
@@ -222,19 +223,20 @@ iMapFilterYesSt f fr to st
:==
i_map_filter_yes_st
fr
to
st
:==
i_map_filter_yes_st
fr
to
st
where
where
i_map_filter_yes_st
fr
to
st
i_map_filter_yes_st
fr
to
st
#!
st
=
st
|
fr
>=
to
|
fr
>=
to
=
([],
st
)
=
([],
st
)
#!
(
opt_f_fr
,
st
)
=
f
fr
st
#!
(
opt_f_fr
,
st
)
=
f
fr
st
(
t
,
st
)
=
i_map_filter_yes_st
(
inc
fr
)
to
st
(
t
,
st
)
=
i_map_filter_yes_st
(
inc
fr
)
to
st
f_fr_t2
=
optCons
opt_f_fr
t
(
f_fr_t2
,
_)
=
optCons
opt_f_fr
t
st
=
st
st
=
st
=
(
f_fr_t2
,
st
)
=
(
f_fr_t2
,
st
)
optCons
::
!(
Optional
.
a
)
!
u
:[.
a
]
->
v
:[.
a
]
,[
u
<=
v
]
optCons
::
!(
Optional
.
a
)
!
u
:[.
a
]
->
(!
v
:[.
a
]
,
!
Int
)
,[
u
<=
v
]
optCons
No
l
optCons
No
l
=
l
=
(
l
,
0
)
optCons
(
Yes
x
)
l
optCons
(
Yes
x
)
l
=
[
x
:
l
]
=
(
[
x
:
l
]
,
0
)
eqMerge
::
![
a
]
![
a
]
->
[
a
]
|
Eq
a
eqMerge
::
![
a
]
![
a
]
->
[
a
]
|
Eq
a
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment