summaryrefslogtreecommitdiff
path: root/lib/Language/Elna/SymbolTable.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2024-09-08 02:08:13 +0200
committerEugen Wissner <belka@caraus.de>2024-09-08 02:08:13 +0200
commit1cbbef19afcf997315431e3aa45f824fe8a8a0e7 (patch)
tree8813df9aab3185a9c2b778499ecb041a6c58cead /lib/Language/Elna/SymbolTable.hs
parenta625bbff505c912f8a19f62bcb92313a63c60ed4 (diff)
downloadelna-1cbbef19afcf997315431e3aa45f824fe8a8a0e7.tar.gz
Stub the implementation for all phases
Diffstat (limited to 'lib/Language/Elna/SymbolTable.hs')
-rw-r--r--lib/Language/Elna/SymbolTable.hs22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/Language/Elna/SymbolTable.hs b/lib/Language/Elna/SymbolTable.hs
index b56d0c7..c8406fc 100644
--- a/lib/Language/Elna/SymbolTable.hs
+++ b/lib/Language/Elna/SymbolTable.hs
@@ -1,15 +1,22 @@
module Language.Elna.SymbolTable
- ( Info(..)
+ ( SymbolTable
+ , empty
+ {-, Info(..)
, ParameterInfo(..)
- , SymbolTable
, builtInSymbolTable
- , empty
, enter
, fromList
, lookup
- , member
+ , member -}
) where
+data SymbolTable = SymbolTable -- (HashMap Identifier Info)
+ deriving (Eq, Show)
+
+empty :: SymbolTable
+empty = SymbolTable -- HashMap.empty
+
+{-
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as HashMap
import Data.List (sort)
@@ -20,9 +27,6 @@ import Language.Elna.Location (Identifier(..))
import Language.Elna.Types (Type(..), intType, booleanType)
import Prelude hiding (lookup)
-newtype SymbolTable = SymbolTable (HashMap Identifier Info)
- deriving (Eq, Show)
-
instance Semigroup SymbolTable
where
(SymbolTable lhs) <> (SymbolTable rhs) = SymbolTable $ rhs <> lhs
@@ -37,9 +41,6 @@ builtInSymbolTable = SymbolTable $ HashMap.fromList
, ("int", TypeInfo intType)
]
-empty :: SymbolTable
-empty = SymbolTable HashMap.empty
-
enter :: Identifier -> Info -> SymbolTable -> Maybe SymbolTable
enter identifier info table@(SymbolTable hashTable)
| member identifier table = Nothing
@@ -76,3 +77,4 @@ data Info
| VariableInfo Bool Type
| ProcedureInfo SymbolTable (Vector ParameterInfo)
deriving (Eq, Show)
+-}