diff options
author | Camil Staps | 2016-07-05 17:25:10 +0200 |
---|---|---|
committer | Camil Staps | 2016-07-05 17:25:10 +0200 |
commit | ceb0b74bd0b368124679378ebfb2cf316deb2e39 (patch) | |
tree | 7f5c562952bcf0427d838274177123765fe93cf5 /ABC/CStack.icl | |
parent | ProgramStore as array for efficiency (diff) |
Added Machine as module level
Diffstat (limited to 'ABC/CStack.icl')
-rw-r--r-- | ABC/CStack.icl | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/ABC/CStack.icl b/ABC/CStack.icl deleted file mode 100644 index 74ca885..0000000 --- a/ABC/CStack.icl +++ /dev/null @@ -1,26 +0,0 @@ -implementation module ABC.CStack - -import StdEnv - -import ABC.Def -import ABC.Misc - -:: CStack :== [InstrId] - -instance toString CStack where toString xs = "[" <++ (",", xs) <+ "]" - -cs_init :: CStack -cs_init = [] - -cs_get :: CSrc CStack -> InstrId -cs_get _ [] = abortn "cs_get: index too large" -cs_get 0 [i:_] = i -cs_get i [_:s] = cs_get (i-1) s - -cs_popn :: CSrc CStack -> CStack -cs_popn 0 s = s -cs_popn _ [] = abortn "cs_popn: popping too many elements" -cs_popn i [_:s] = cs_popn (i-1) s - -cs_push :: InstrId CStack -> CStack -cs_push i s = [i:s] |