| Copyright | (c) roki 2019 |
|---|---|
| License | MIT |
| Maintainer | falgon53@yahoo.co.jp |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Htcc.Parser.ConstructionData.Scope.Enumerator
Description
The Data type of variables and its utilities used in parsing
Synopsis
- data Enumerator i = Enumerator {
- enVal :: i
- enUnderlying :: StorageClass i
- type Enumerators i = Map Text (Enumerator i)
- add :: Num i => StorageClass i -> TokenLC i -> i -> Enumerators i -> Either (ASTError i) (Enumerators i)
Documentation
data Enumerator i Source #
The data type of a enumerator
Constructors
| Enumerator | |
Fields
| |
Instances
type Enumerators i = Map Text (Enumerator i) Source #
The typedefs data typedefs
add :: Num i => StorageClass i -> TokenLC i -> i -> Enumerators i -> Either (ASTError i) (Enumerators i) Source #
Given the flag (when that is added function, it is True. otherwise False), type, identifier token, and Enumerators,
if the specified identifier already exists in the same scope,
return an error message and its location as a pair.
Otherwise, add a new tag to Enumerators and return it.
If the token does not indicate an identifier, an error indicating internal compiler error is returned.