summaryrefslogtreecommitdiff
path: root/src/Language/Fiddle/Ast
diff options
context:
space:
mode:
Diffstat (limited to 'src/Language/Fiddle/Ast')
-rw-r--r--src/Language/Fiddle/Ast/Internal/SyntaxTree.hs28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/Language/Fiddle/Ast/Internal/SyntaxTree.hs b/src/Language/Fiddle/Ast/Internal/SyntaxTree.hs
index b597a25..2774507 100644
--- a/src/Language/Fiddle/Ast/Internal/SyntaxTree.hs
+++ b/src/Language/Fiddle/Ast/Internal/SyntaxTree.hs
@@ -18,7 +18,7 @@ module Language.Fiddle.Ast.Internal.SyntaxTree
FieldSpan (..),
QRegMetadata (..),
QBitsMetadata (..),
- RegSz(..),
+ RegSz (..),
-- Witness Types
Witness (..),
-- AST Types
@@ -107,7 +107,7 @@ deriving instance
(FromJSON (When s (FieldSpan Bytes))) =>
FromJSON (QRegMetadata s)
-data RegSz = RegSz8 | RegSz16 | RegSz32 | RegSz64
+data RegSz = RegSz8 | RegSz16 | RegSz32 | RegSz64
deriving (Eq, Ord, Show, Enum, Generic, ToJSON, FromJSON)
regSzToBits :: RegSz -> N Bits
@@ -519,6 +519,30 @@ data ObjTypeDecl stage f a where
assertAnnot :: a
} ->
ObjTypeDecl stage f a
+ -- | A character buffer
+ BufferDecl ::
+ { -- | Metadata about this declaration.
+ qRegMeta :: When (stage .>= Qualified) (QRegMetadata (stage .>= Checked)),
+ -- | Identifier for this buffer
+ bufIdent :: Guaranteed (stage .>= Qualified) (Identifier f a),
+ -- | Size of this buffer
+ bufSize :: ConstExpression Bytes stage f a,
+ -- | Annotation for this buf statement.
+ bufAnnot :: a
+ } ->
+ ObjTypeDecl stage f a
+ SkipToStatement ::
+ { -- | Witness that we are in the proper stage. These statements will turn
+ -- into buffer statements during the consistency check.
+ disableSkipToStatementsAfterConsistencyCheck :: Witness (stage .< Checked),
+ -- | Metadata
+ qRegMeta :: When (stage .>= Qualified) (QRegMetadata (stage .>= Checked)),
+ -- | The address to skip to.
+ skipToExpression :: ConstExpression Bytes stage f a,
+ -- | The annotation of the skipToStatement
+ skipToAnnot :: a
+ } ->
+ ObjTypeDecl stage f a
-- | A register declaration.
RegisterDecl ::
{ -- | Offset within the register. Calculated during the consistency check.