Commit 7a910a49 authored by Vincent Zweije's avatar Vincent Zweije
Browse files

Proto conversion from compiler structures to sucl structures

parent 8d14a213
......@@ -6,7 +6,7 @@ COCL = cocl
#COCLFLAGS = -lat
SYS = Clean\ System\ Files
MODULES = basic pretty pfun graph dnc rule trd rewr complete history spine trace absmodule spine strat loop law supercompile
MODULES = basic pretty pfun graph dnc rule trd rewr complete history spine trace absmodule spine strat loop law coreclean convert supercompile
ABC = $(patsubst %,$(SYS)/%.abc,$(MODULES))
......@@ -23,6 +23,8 @@ $(SYS)/%.abc: %.icl
$(COCL) $(COCLFLAGS) $*
$(SYS)/supercompile.abc: supercompile.icl supercompile.dcl
$(SYS)/convert.abc: convert.icl convert.dcl rule.dcl
$(SYS)/coreclean.abc: coreclean.icl coreclean.dcl
$(SYS)/law.abc: law.icl law.dcl
$(SYS)/loop.abc: loop.icl loop.dcl trace.dcl strat.dcl history.dcl rule.dcl graph.dcl basic.dcl
$(SYS)/strat.abc: strat.icl strat.dcl history.dcl spine.dcl dnc.dcl rule.dcl graph.dcl pfun.dcl basic.dcl
......
definition module convert
// $Id$
from syntax import FunDef
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,SymbolTableEntry,TypeVarInfoPtr,TypeAttribute,Annotation,Type,Context,Global,DefinedSymbol,Type,VarInfoPtr,AttrVarInfoPtr,Expression,VarInfoPtr,Ptr,ExprInfo,PtrN,HeapN,PtrN,STE_Kind,TypeVarInfo,VarInfo,AttrVarInfo
from StdString import String
// Cocl to Sucl for functions
cts_function
:: {#FunDef}
-> ( [(SuclSymbol,Rule SuclTypeSymbol SuclTypeVariable)]//Type rule (derives arity)
, [(SuclSymbol,[Bool])] // Strict arguments (just main args for now)
, [(SuclSymbol,[Rule SuclSymbol SuclVariable])] // Rewrite rules
, [(SuclSymbol,SuclSymbolKind)] // Kind of symbol
)
implementation module convert
// $Id$
import coreclean
import rule
import syntax
import StdEnv
// $Id$
// Cocl to Sucl for functions
cts_function
:: {#FunDef}
-> ( [(SuclSymbol,Rule SuclTypeSymbol SuclTypeVariable)]//Type rule (derives arity)
, [(SuclSymbol,[Bool])] // Strict arguments (just main args for now)
, [(SuclSymbol,[Rule SuclSymbol SuclVariable])] // Rewrite rules
, [(SuclSymbol,SuclSymbolKind)] // Kind of symbol
)
cts_function _ = abort "cts_function: not implemented"
// SuclSymbolKind distinguishes functions, constructors, and primitives
// SuclSymbol are the Sucl symbols, such as SuclInt Int, etc.
definition module coreclean
// $Id$
:: SuclTypeSymbol
:: SuclTypeVariable
:: SuclSymbol
:: SuclSymbolKind
:: SuclVariable
implementation module coreclean
// $Id$
:: SuclTypeSymbol
= SuclINT
:: SuclTypeVariable
= SuclANONYMOUS Int
:: SuclSymbol
= SuclInt Int
:: SuclSymbolKind
= SuclFunction
| SuclConstructor
| SuclPrimitive
:: SuclVariable
= SuclAnonymous Int
......@@ -32,4 +32,4 @@ supercompile
supercompile common_defs array_instances 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"
where used_conses = abort "supercompile: not implemented"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment