Handbook
Glossary
normalize* ( node -- node' )
Vocabulary
compiler
.
tree
.
normalization
Inputs
node
an
object
Outputs
node'
an
object
Definition
IN:
compiler.tree.normalization
GENERIC:
normalize*
( node -- node' )
Methods
USING:
accessors
compiler.tree
compiler.tree.normalization
;
M:
#alien-callback
normalize*
[
normalize
]
change-child
;
USING:
accessors
arrays
assocs
compiler.tree
compiler.tree.normalization
compiler.utilities
kernel
math.order
namespaces
sequences
;
M:
#branch
normalize*
[
[
[
[
normalize*
]
map-flat
introduction-stack
get
2array
]
with-scope
]
map
unzip
swap
]
change-children
swap
[
remaining-introductions
set
]
[
[
length
]
[
min
]
map-reduce
introduction-stack
[
swap
head
]
change
]
bi
;
USING:
combinators
compiler.tree
compiler.tree.normalization
kernel
math
;
M:
#call-recursive
normalize*
dup
unchanged-underneath
{
{
[
dup
0
<
]
[
call<return
]
}
{
[
dup
0
=
]
[
drop
]
}
{
[
dup
0
>
]
[
call>return
]
}
}
cond
;
USING:
accessors
compiler.tree
compiler.tree.normalization
kernel
namespaces
sequences
;
M:
#enter-recursive
normalize*
[
introduction-stack
get
prepend
]
change-out-d
dup
[
label>>
]
keep
>>enter-recursive
drop
dup
[
label>>
]
[
out-d>>
]
bi
>>enter-out
drop
;
USING:
accessors
compiler.tree
compiler.tree.normalization
compiler.tree.normalization.renaming
kernel
sequences
;
M:
#introduce
normalize*
out-d>>
[
length
pop-introductions
]
keep
add-renamings
f
;
USING:
accessors
compiler.tree
compiler.tree.normalization
kernel
namespaces
;
M:
#phi
normalize*
remaining-introductions
get
swap
dup
terminated>>
[
eliminate-phi-introductions
]
curry
change-phi-in-d
;
USING:
accessors
compiler.tree
compiler.tree.normalization
kernel
sequences
stack-checker.backend
;
M:
#recursive
normalize*
[
[
child>>
first
]
[
in-d>>
]
bi
>>in-d
drop
]
[
dup
label>>
introductions>>
make-values
[
(normalize)
]
curry
change-child
]
bi
;
USING:
compiler.tree
compiler.tree.normalization
;
M:
node
normalize*
;