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

Description

The Data type of variables and its utilities used in parsing

Synopsis

The types

data Scoped i Source #

The data type of a struct tag

Constructors

Scoped

The constructor of a struct tag

Fields

Instances

Instances details
Show i => Show (Scoped i) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope

Methods

showsPrec :: Int -> Scoped i -> ShowS #

show :: Scoped i -> String #

showList :: [Scoped i] -> ShowS #

Generic (Scoped i) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope

Associated Types

type Rep (Scoped i) :: Type -> Type #

Methods

from :: Scoped i -> Rep (Scoped i) x #

to :: Rep (Scoped i) x -> Scoped i #

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

Defined in Htcc.Parser.ConstructionData.Scope

Methods

rnf :: Scoped i -> () #

Generic1 Scoped Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope

Associated Types

type Rep1 Scoped :: k -> Type #

Methods

from1 :: forall (a :: k). Scoped a -> Rep1 Scoped a #

to1 :: forall (a :: k). Rep1 Scoped a -> Scoped a #

type Rep (Scoped i) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope

type Rep (Scoped i) = D1 ('MetaData "Scoped" "Htcc.Parser.ConstructionData.Scope" "htcc-0.0.0.1-I8tHuOdNzco4DzUthNftqr" 'False) (C1 ('MetaCons "Scoped" 'PrefixI 'True) ((S1 ('MetaSel ('Just "curNestDepth") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural) :*: (S1 ('MetaSel ('Just "vars") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vars i)) :*: S1 ('MetaSel ('Just "structs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Tags i)))) :*: (S1 ('MetaSel ('Just "typedefs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Typedefs i)) :*: (S1 ('MetaSel ('Just "functions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Functions i)) :*: S1 ('MetaSel ('Just "enumerators") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Enumerators i))))))
type Rep1 Scoped Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope

data LookupVarResult i Source #

A type that represents the result of a variable search

Constructors

FoundGVar (GVar i)

A type constructor indicating that a global variable has been found

FoundLVar (LVar i)

A type constructor indicating that a local variable has been found

FoundEnum (Enumerator i)

A type constructor indicating that a enumerator has been found

NotFound

A type constructor indicating that it was not found

Instances

Instances details
Eq i => Eq (LookupVarResult i) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope

Show i => Show (LookupVarResult i) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope

Operations for scope

addLVar :: (Integral i, Bits i) => StorageClass i -> TokenLC i -> Scoped i -> Either (ASTError i) (ATree i, Scoped i) Source #

addLVar has a scoped type argument and is the same function as addLVar internally.

addGVar :: (Integral i, Bits i) => StorageClass i -> TokenLC i -> Scoped i -> Either (ASTError i) (ATree i, Scoped i) Source #

addGVar has a scoped type argument and is the same function as addGVar internally.

addGVarWith :: (Integral i, Bits i) => StorageClass i -> TokenLC i -> GVarInitWith i -> Scoped i -> Either (ASTError i) (ATree i, Scoped i) Source #

addGVarWith has a scoped type argument and is the same function as addLiteral internally.

addLiteral :: (Integral i, Bits i) => StorageClass i -> TokenLC i -> Scoped i -> Either (ASTError i) (ATree i, Scoped i) Source #

addLiteral has a scoped type argument and is the same function as addLiteral internally.

addTag :: Num i => StorageClass i -> TokenLC i -> Scoped i -> Either (ASTError i) (Scoped i) Source #

addTag has a scoped type argument and is the same function as add internally.

addTypedef :: (Eq i, Num i) => StorageClass i -> TokenLC i -> Scoped i -> Either (ASTError i) (Scoped i) Source #

addTypedef has a scoped type argument and is the same function as add internally.

addFunction :: Num i => Bool -> StorageClass i -> TokenLC i -> Scoped i -> Either (ASTError i) (Scoped i) Source #

addFunction has a scoped type argument and is the same function as add internally.

addEnumerator :: Num i => StorageClass i -> TokenLC i -> i -> Scoped i -> Either (ASTError i) (Scoped i) Source #

addEnumerator has a scoped type argument and is the same function as add internally.

succNest :: Scoped i -> Scoped i Source #

succNest has a scoped type argument and is the same function as succNest internally.

fallBack :: Scoped i -> Scoped i -> Scoped i Source #

fallBack has a scoped type argument and is the same function as fallBack internally.

lookupLVar :: Text -> Scoped i -> Maybe (LVar i) Source #

lookupLVar has a scoped type argument and is the same function as lookupLVar internally.

lookupGVar :: Text -> Scoped i -> Maybe (GVar i) Source #

lookupGVar has a scoped type argument and is the same function as lookupGVar internally.

lookupVar :: Text -> Scoped i -> LookupVarResult i Source #

lookupVar has a scoped type argument and is the same function as lookupVar internally.

lookupTag :: Text -> Scoped i -> Maybe (Tag i) Source #

lookupTag has a scoped type argument and is the same function as lookupTag internally.

lookupTypedef :: Text -> Scoped i -> Maybe (Typedef i) Source #

lookupTypedef has a scoped type argument and is the same function as lookupTypedef internally.

lookupFunction :: Text -> Scoped i -> Maybe (Function i) Source #

lookupFunction has a scoped type argument and is the same function as lookupFunction internally.

lookupEnumerator :: Text -> Scoped i -> Maybe (Enumerator i) Source #

lookupEnumerator has a scoped type argument and is the same function as lookupFunction internally.

initScope :: Scoped i Source #

Helper function representing an empty scoped data

resetLocal :: Scoped i -> Scoped i Source #

resetLocal has a scoped type argument and is the same function as resetLocal internally.