From 1640830bf5dc0630481e698512064215eb3e8249 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 10 Oct 2021 19:55:59 +0200 Subject: WIP --- Language/C.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Language/C.hs') diff --git a/Language/C.hs b/Language/C.hs index 9a65115..8b2a9d5 100644 --- a/Language/C.hs +++ b/Language/C.hs @@ -44,6 +44,9 @@ data Stmt | SCall Name [Expr] -- | @SFor ty i lo hi body@: @for (ty i = lo; i < hi; i++) body@ | SFor Type Name Expr Expr [Stmt] + -- | @SWhile pre cond post@: @while (true) { pre; if (!cond) break; post; }@ + -- Special case if @pre == []@: @while (cond) { post; } + | SWhile [Stmt] Expr [Stmt] | SIf Expr [Stmt] [Stmt] deriving (Show, Eq) @@ -56,6 +59,7 @@ data Expr | EIndex Name Expr | EPtrTo Expr | ESizeOf Type + | ECast Type Expr deriving (Show, Eq) -- cgit v1.2.3-70-g09d2