flp-0.1.0.0: A layout spec language for memory managers implemented in Rust.

Safe HaskellSafe
LanguageHaskell2010

Language.Floorplan.Core.Syntax

Synopsis

Documentation

type Nat = Int Source #

type Align = Int Source #

type ExistsID Source #

Arguments

 = String

Formal identifiers (bound by Exists)

type NameID Source #

Arguments

 = String

Names of bound layers and fields

data Exp a Source #

Constructors

Prim Nat

Primitive number of bytes

Con Nat (Exp a)

Constrained

(:@) (Exp a) Align

Alignment

(:+) (Exp a) (Exp a)

Sequencing

(:||) (Exp a) (Exp a)

Union / alternation

(:::) NameID (Exp a)

Layer (and field) name binding

Exists ExistsID (Exp a)

Formal name binding

(:#) ExistsID (Exp a)

Repetitions

Attr a (Exp a)

Extensible attributes

Instances
Eq a => Eq (Exp a) Source # 
Instance details

Defined in Language.Floorplan.Core.Syntax

Methods

(==) :: Exp a -> Exp a -> Bool #

(/=) :: Exp a -> Exp a -> Bool #

Ord a => Ord (Exp a) Source # 
Instance details

Defined in Language.Floorplan.Core.Syntax

Methods

compare :: Exp a -> Exp a -> Ordering #

(<) :: Exp a -> Exp a -> Bool #

(<=) :: Exp a -> Exp a -> Bool #

(>) :: Exp a -> Exp a -> Bool #

(>=) :: Exp a -> Exp a -> Bool #

max :: Exp a -> Exp a -> Exp a #

min :: Exp a -> Exp a -> Exp a #

Show a => Show (Exp a) Source # 
Instance details

Defined in Language.Floorplan.Core.Syntax

Methods

showsPrec :: Int -> Exp a -> ShowS #

show :: Exp a -> String #

showList :: [Exp a] -> ShowS #

data Attribute ty Source #

Constructors

Contains NameID 
BaseType ty 
Instances
Eq ty => Eq (Attribute ty) Source # 
Instance details

Defined in Language.Floorplan.Core.Syntax

Methods

(==) :: Attribute ty -> Attribute ty -> Bool #

(/=) :: Attribute ty -> Attribute ty -> Bool #

Ord ty => Ord (Attribute ty) Source # 
Instance details

Defined in Language.Floorplan.Core.Syntax

Methods

compare :: Attribute ty -> Attribute ty -> Ordering #

(<) :: Attribute ty -> Attribute ty -> Bool #

(<=) :: Attribute ty -> Attribute ty -> Bool #

(>) :: Attribute ty -> Attribute ty -> Bool #

(>=) :: Attribute ty -> Attribute ty -> Bool #

max :: Attribute ty -> Attribute ty -> Attribute ty #

min :: Attribute ty -> Attribute ty -> Attribute ty #

Show ty => Show (Attribute ty) Source # 
Instance details

Defined in Language.Floorplan.Core.Syntax

Methods

showsPrec :: Int -> Attribute ty -> ShowS #

show :: Attribute ty -> String #

showList :: [Attribute ty] -> ShowS #

type BaseExp = Exp (Attribute BaseType) Source #

Default core expression type for FLP compiler targeting Rust library (with contains(...) attibutes):

accum :: (Exp a -> Maybe b) -> Exp a -> [b] Source #

Accumulate the results of applying some function to every node in the Exp AST.

callSub :: (Exp a -> [b]) -> Exp a -> [b] Source #

Call the given function on all subexpressions. Good for fixedpoint functions calling on themselves in recursive case where they don't care which type they see. This is slightly dangerous in the case where something gets added to the core calculus. If this happens, PLEASE check all callers of this function to see if they should handle the new case personally.

expSize :: Exp a -> Maybe Int Source #

Conservatively computes the size of the given expression, returning Nothing when a fixed size isn't easily known.

l2r :: forall a b. (Maybe Nat -> Exp a -> Maybe b) -> Exp a -> [b] Source #

Just like accum, but also tracks the number of bytes of memory that come before the subexpression for which we call the fncn.