| Copyright | (c) roki 2019 |
|---|---|
| License | MIT |
| Maintainer | falgon53@yahoo.co.jp |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Htcc.Parser.ConstructionData.Scope.Typedef
Description
The Data type of variables and its utilities used in parsing
Documentation
The data type of a typedef tag
Constructors
| Typedef | The contypedefor of a typedef tag |
Fields
| |
Instances
| Eq a => Eq (Typedef a) Source # | |
| Ord a => Ord (Typedef a) Source # | |
Defined in Htcc.Parser.ConstructionData.Scope.Typedef | |
| Show a => Show (Typedef a) Source # | |
| Generic (Typedef a) Source # | |
| NFData i => NFData (Typedef i) Source # | |
Defined in Htcc.Parser.ConstructionData.Scope.Typedef | |
| ManagedScope (Typedef i) Source # | |
| type Rep (Typedef a) Source # | |
Defined in Htcc.Parser.ConstructionData.Scope.Typedef type Rep (Typedef a) = D1 ('MetaData "Typedef" "Htcc.Parser.ConstructionData.Scope.Typedef" "htcc-0.0.0.1-I8tHuOdNzco4DzUthNftqr" 'False) (C1 ('MetaCons "Typedef" 'PrefixI 'True) (S1 ('MetaSel ('Just "tdtype") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StorageClass a)) :*: S1 ('MetaSel ('Just "tdNestDepth") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural))) | |
add :: (Num i, Eq i) => Natural -> StorageClass i -> TokenLC i -> Typedefs i -> Either (ASTError i) (Typedefs i) Source #
Given the current nesting number, type, identifier token, and Typedefs, 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 Typedefs and return it.
If the token does not indicate an identifier, an error indicating internal compiler error is returned.