Clean up file structure
This commit is contained in:
parent
52da9f0507
commit
b85ff076ba
4 changed files with 10 additions and 8 deletions
|
|
@ -1,8 +1,7 @@
|
||||||
module Mima.Asm.Phase1
|
module Mima.Asm.Phase1
|
||||||
( AsmToken
|
( module Mima.Asm.Phase1.Types
|
||||||
, Phase1
|
, module Mima.Asm.Phase1.Parse
|
||||||
, parsePhase1
|
, module Mima.Asm.Phase1.Format
|
||||||
, formatPhase1
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Mima.Asm.Phase1.Format
|
import Mima.Asm.Phase1.Format
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,7 @@ instance Onion Directive where
|
||||||
peel (MetaStart a _ _ _) = a
|
peel (MetaStart a _ _ _) = a
|
||||||
peel (MetaStop a _ _) = a
|
peel (MetaStop a _ _) = a
|
||||||
|
|
||||||
|
-- | A single token. The @s@ type parameter is the type of location annotations.
|
||||||
data AsmToken a
|
data AsmToken a
|
||||||
= TokenLabel (Name a)
|
= TokenLabel (Name a)
|
||||||
| TokenInstruction (Instruction a)
|
| TokenInstruction (Instruction a)
|
||||||
|
|
@ -165,4 +166,6 @@ instance Onion AsmToken where
|
||||||
peel (TokenDirective a) = peel a
|
peel (TokenDirective a) = peel a
|
||||||
peel (TokenComment a _ _) = a
|
peel (TokenComment a _ _) = a
|
||||||
|
|
||||||
|
-- | Representation of an assembly file in phase 1. The @s@ type parameter is
|
||||||
|
-- the type of location annotations.
|
||||||
type Phase1 s = [AsmToken s]
|
type Phase1 s = [AsmToken s]
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
module Mima.Asm.Phase2
|
module Mima.Asm.Phase2
|
||||||
( phase2
|
( phase1To2
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import qualified Mima.Asm.Phase1 as P1
|
import qualified Mima.Asm.Phase1 as P1
|
||||||
import Mima.Asm.Weed
|
import Mima.Asm.Weed
|
||||||
import qualified Mima.Vm.State as Vm
|
import qualified Mima.Vm.State as Vm
|
||||||
|
|
||||||
phase2 :: P1.Phase1 s -> Weed (WeedError s) Vm.MimaState
|
phase1To2 :: P1.Phase1 s -> Weed (WeedError s) Vm.MimaState
|
||||||
phase2 = error "to be implemented"
|
phase1To2 = error "to be implemented"
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import Data.Foldable
|
||||||
import qualified Data.Map.Strict as Map
|
import qualified Data.Map.Strict as Map
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
|
|
||||||
import qualified Mima.Asm.Phase1.Types as P1
|
import qualified Mima.Asm.Phase1 as P1
|
||||||
import Mima.Asm.Phase2.Types
|
import Mima.Asm.Phase2.Types
|
||||||
import Mima.Asm.Phase2.Util
|
import Mima.Asm.Phase2.Util
|
||||||
import Mima.Asm.Types
|
import Mima.Asm.Types
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue