Added array constructors to the AST
This commit is contained in:
parent
d9ae34c7a2
commit
bcedd9af22
13
AST.hs
13
AST.hs
|
@ -235,6 +235,18 @@ data Variable =
|
||||||
| DirectedVariable Meta Direction Variable
|
| DirectedVariable Meta Direction Variable
|
||||||
deriving (Show, Eq, Typeable, Data)
|
deriving (Show, Eq, Typeable, Data)
|
||||||
|
|
||||||
|
-- | An array constructor expression.
|
||||||
|
data ArrayConstr =
|
||||||
|
-- | A simple integer range, beginning at the first value (inclusive) and ending at the second value (inclusive), with stepping 1.
|
||||||
|
-- If the first value is bigger than the second, the effective value is an empty array.
|
||||||
|
-- This will be transformed by an early pass into the second form (RepConstr).
|
||||||
|
RangeConstr Meta Expression Expression
|
||||||
|
-- | A more general and powerful array constructor as used in occam-pi.
|
||||||
|
-- The first item is the replicator, the second is the expression
|
||||||
|
| RepConstr Meta Replicator Expression
|
||||||
|
deriving (Show, Eq, Typeable, Data)
|
||||||
|
|
||||||
|
|
||||||
-- | An expression.
|
-- | An expression.
|
||||||
data Expression =
|
data Expression =
|
||||||
-- | A monadic (unary) operator.
|
-- | A monadic (unary) operator.
|
||||||
|
@ -263,6 +275,7 @@ data Expression =
|
||||||
| BytesInExpr Meta Expression
|
| BytesInExpr Meta Expression
|
||||||
| BytesInType Meta Type
|
| BytesInType Meta Type
|
||||||
| OffsetOf Meta Type Name
|
| OffsetOf Meta Type Name
|
||||||
|
| ExprConstr Meta ArrayConstr
|
||||||
deriving (Show, Eq, Typeable, Data)
|
deriving (Show, Eq, Typeable, Data)
|
||||||
|
|
||||||
-- | A list of expressions.
|
-- | A list of expressions.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user