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.Tag

Description

The Data type of variables and its utilities used in parsing

Synopsis

Documentation

data Tag i Source #

The data type of a tag

Constructors

Tag

The constructor of a tag

Fields

Instances

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

Defined in Htcc.Parser.ConstructionData.Scope.Tag

Methods

(==) :: Tag i -> Tag i -> Bool #

(/=) :: Tag i -> Tag i -> Bool #

Ord i => Ord (Tag i) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope.Tag

Methods

compare :: Tag i -> Tag i -> Ordering #

(<) :: Tag i -> Tag i -> Bool #

(<=) :: Tag i -> Tag i -> Bool #

(>) :: Tag i -> Tag i -> Bool #

(>=) :: Tag i -> Tag i -> Bool #

max :: Tag i -> Tag i -> Tag i #

min :: Tag i -> Tag i -> Tag i #

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

Defined in Htcc.Parser.ConstructionData.Scope.Tag

Methods

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

show :: Tag i -> String #

showList :: [Tag i] -> ShowS #

Generic (Tag i) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope.Tag

Associated Types

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

Methods

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

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

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

Defined in Htcc.Parser.ConstructionData.Scope.Tag

Methods

rnf :: Tag i -> () #

ManagedScope (Tag i) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope.Tag

Methods

lookup :: Text -> Map Text (Tag i) -> Maybe (Tag i) Source #

fallBack :: Map Text (Tag i) -> Map Text (Tag i) -> Map Text (Tag i) Source #

initial :: Map Text (Tag i) Source #

type Rep (Tag i) Source # 
Instance details

Defined in Htcc.Parser.ConstructionData.Scope.Tag

type Rep (Tag i) = D1 ('MetaData "Tag" "Htcc.Parser.ConstructionData.Scope.Tag" "htcc-0.0.0.1-I8tHuOdNzco4DzUthNftqr" 'False) (C1 ('MetaCons "Tag" 'PrefixI 'True) (S1 ('MetaSel ('Just "sttype") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StorageClass i)) :*: S1 ('MetaSel ('Just "stNestDepth") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural)))

type Tags i = Map Text (Tag i) Source #

The Tags data type

add :: Num i => Natural -> StorageClass i -> TokenLC i -> Tags i -> Either (ASTError i) (Tags i) Source #

Given the current nesting number, type, identifier token, and Tags, 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 Tags and return it. If the token does not indicate an identifier, an error indicating internal compiler error is returned.