Skip to content
GitLab
Menu
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
95b83400
Commit
95b83400
authored
Aug 16, 2001
by
Vincent Zweije
Browse files
First go at generating function definitions
parent
2c6cabd0
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
sucl/convert.dcl
View file @
95b83400
...
...
@@ -3,16 +3,21 @@ definition module convert
// $Id$
from
syntax
import
FunDef
,
FunType
from
checksupport
import
DclModule
from
rule
import
Rule
from
coreclean
import
SuclTypeSymbol
,
SuclTypeVariable
,
SuclSymbol
,
SuclSymbolKind
,
SuclVariable
// Transitively required stuff
from
syntax
import
Ident
,
Priority
,
FunctionBody
,
Optional
,
SymbolType
,
Position
,
DefOrImpFunKind
,
FunInfo
,
SymbolPtr
,
TypeVar
,
AType
,
AType
,
TypeContext
,
AttributeVar
,
AttrInequality
,
FunCall
,
Index
,
Level
,
FreeVar
,
FreeVar
,
ExprInfoPtr
,
BITVECT
,
Ptr
,
Specials
,
SymbolTableEntry
,
TypeVarInfoPtr
,
TypeAttribute
,
Annotation
,
Type
,
Context
,
Global
,
DefinedSymbol
,
Type
,
VarInfoPtr
,
AttrVarInfoPtr
,
Expression
,
VarInfoPtr
,
Ptr
,
ExprInfo
,
PtrN
,
HeapN
,
PtrN
,
STE_Kind
,
TypeVarInfo
,
VarInfo
,
AttrVarInfo
from
syntax
import
Ident
,
Priority
,
FunctionBody
,
Optional
,
SymbolType
,
Position
,
DefOrImpFunKind
,
FunInfo
,
SymbolPtr
,
TypeVar
,
AType
,
AType
,
TypeContext
,
AttributeVar
,
AttrInequality
,
FunCall
,
Index
,
Level
,
FreeVar
,
FreeVar
,
ExprInfoPtr
,
BITVECT
,
Ptr
,
Specials
,
SymbolTableEntry
,
TypeVarInfoPtr
,
TypeAttribute
,
Annotation
,
Type
,
Context
,
Global
,
DefinedSymbol
,
Type
,
VarInfoPtr
,
AttrVarInfoPtr
,
Expression
,
VarInfoPtr
,
Ptr
,
ExprInfo
,
PtrN
,
HeapN
,
PtrN
,
STE_Kind
,
TypeVarInfo
,
VarInfo
,
AttrVarInfo
,
CheckedTypeDef
,
ClassDef
,
ClassInstance
,
ConsDef
,
Declaration
,
GenericDef
,
IndexRange
,
MemberDef
,
SelectorDef
,
ATypeVar
,
DeclarationRecord
,
GenericClassInfos
,
GenericType
,
InstanceType
,
TypeDef
,
TypeKind
,
TypeRhs
,
GenericClassInfo
from
StdString
import
String
from
checksupport
import
CommonDefs
,
ConversionTable
,
Declarations
from
containers
import
NumberSet
// Cocl to Sucl for functions
cts_function
::
{#
FunDef
}
::
Int
// Index of current module
{#
FunDef
}
// Function definitions (from ICL)
->
(
[(
SuclSymbol
,
Rule
SuclTypeSymbol
SuclTypeVariable
)]
//Type rule (derives arity)
,
[(
SuclSymbol
,[
Bool
])]
// Strict arguments (just main args for now)
,
[(
SuclSymbol
,[
Rule
SuclSymbol
SuclVariable
])]
// Rewrite rules
...
...
@@ -20,6 +25,8 @@ cts_function
)
//Cocl to Sucl for exports (function decls from main dcl)
cts_exports
::
{#
FunType
}
// Function type from dcl module
->
[
SuclSymbol
]
// Function symbol for the declared function
cts_exports
::
{#
FunDef
}
// List of function definitions (from ICL)
{#
DclModule
}
// List of imported DCL modules
Int
// Index of current module
->
[
SuclSymbol
]
sucl/convert.icl
View file @
95b83400
This diff is collapsed.
Click to expand it.
sucl/supercompile.icl
View file @
95b83400
...
...
@@ -35,5 +35,7 @@ supercompile
supercompile
common_defs
array_instances
dcl_mods
main_dcl_module_n
components
fun_defs
var_heap
expression_heap
imported_funs
dcl_types
used_conses_in_dynamics
type_def_infos
type_heaps
=
(
components
,
fun_defs
,
dcl_types
,
used_conses
,
var_heap
,
type_heaps
,
expression_heap
)
where
used_conses
=
abort
"supercompile: not implemented"
// Determine defined functions
_
=
cts_function
fun_defs
_
=
cts_exports
dcl_mods
[
main_dcl_module_n
].
dcl_functions
// Determine exported functions
_
=
cts_exports
fun_defs
dcl_mods
main_dcl_module_n
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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