feat[bytecode]: A lot of scaffolding for setup
This commit is contained in:
parent
766528677f
commit
f9ea61d348
7 changed files with 130 additions and 0 deletions
21
src/Language/Scalie/Bytecode/Object.hs
Normal file
21
src/Language/Scalie/Bytecode/Object.hs
Normal file
|
@ -0,0 +1,21 @@
|
|||
{-# LANGUAGE Trustworthy #-} -- Trustworthy because it imports Vector but does not do unsafe things
|
||||
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
||||
|
||||
-- | This module describes a Bytecode Object, similar to a java classfile. It will hold source information, shared constants and
|
||||
|
||||
module Language.Scalie.Bytecode.Object (Object(..)) where
|
||||
import Data.Kind (Type)
|
||||
import Data.Vector (Vector)
|
||||
import Language.Scalie.Ast.Provenance (Provenance)
|
||||
import Language.Scalie.Bytecode.Instruction (Instruction)
|
||||
import Language.Scalie.Ast.Provenance.SourceLocation (SourceLocation)
|
||||
import Text.Show (Show)
|
||||
import Text.Read (Read)
|
||||
import Data.Semigroup (Semigroup)
|
||||
import Data.Monoid (Monoid)
|
||||
|
||||
type Object :: Type
|
||||
type role Object
|
||||
newtype Object = Object { instructions :: Vector (Provenance SourceLocation Instruction) }
|
||||
deriving stock (Show, Read)
|
||||
deriving newtype (Semigroup, Monoid)
|
Loading…
Add table
Add a link
Reference in a new issue