htcc-0.0.0.1: The full scratch implementation of tiny C compiler (x86_64)
Copyright(c) roki 2019
LicenseMIT
Maintainerfalgon53@yahoo.co.jp
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Htcc.Parser.ConstructionData.Scope.Typedef

Description

The Data type of variables and its utilities used in parsing

Synopsis

Documentation

data Typedef a Source #

The data type of a typedef tag

Constructors

Typedef

The contypedefor of a typedef tag

Fields

Instances

Instances details
Eq a => Eq (Typedef a) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope.Typedef

Methods

(==) :: Typedef a -> Typedef a -> Bool #

(/=) :: Typedef a -> Typedef a -> Bool #

Ord a => Ord (Typedef a) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope.Typedef

Methods

compare :: Typedef a -> Typedef a -> Ordering #

(<) :: Typedef a -> Typedef a -> Bool #

(<=) :: Typedef a -> Typedef a -> Bool #

(>) :: Typedef a -> Typedef a -> Bool #

(>=) :: Typedef a -> Typedef a -> Bool #

max :: Typedef a -> Typedef a -> Typedef a #

min :: Typedef a -> Typedef a -> Typedef a #

Show a => Show (Typedef a) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope.Typedef

Methods

showsPrec :: Int -> Typedef a -> ShowS #

show :: Typedef a -> String #

showList :: [Typedef a] -> ShowS #

Generic (Typedef a) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope.Typedef

Associated Types

type Rep (Typedef a) :: Type -> Type #

Methods

from :: Typedef a -> Rep (Typedef a) x #

to :: Rep (Typedef a) x -> Typedef a #

NFData i => NFData (Typedef i) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope.Typedef

Methods

rnf :: Typedef i -> () #

ManagedScope (Typedef i) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope.Typedef

type Rep (Typedef a) Source # 
Instance details

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)))

type Typedefs a = Map Text (Typedef a) Source #

The typedefs data type

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.