shimmer-0.1.1: The Reflective Lambda Machine

Safe HaskellSafe
LanguageHaskell98

SMR.Source.Token

Synopsis

Documentation

data Token Source #

Tokens for for the source language.

Constructors

KEnd

End of input.

KPunc Char

Punctuation character.

KName Space Text

A scoped name.

KNat Integer

A natural number.

Instances

Eq Token Source # 

Methods

(==) :: Token -> Token -> Bool #

(/=) :: Token -> Token -> Bool #

Show Token Source # 

Methods

showsPrec :: Int -> Token -> ShowS #

show :: Token -> String #

showList :: [Token] -> ShowS #

data Space Source #

Name space of a name.

Constructors

SVar

Local variable.

SMac

Macro name.

SSym

Symbol name.

SSet

Set name.

SPrm

Primitive name.

SKey

Keyword (super primitive)

SNom

Nominal name.

Instances

Eq Space Source # 

Methods

(==) :: Space -> Space -> Bool #

(/=) :: Space -> Space -> Bool #

Show Space Source # 

Methods

showsPrec :: Int -> Space -> ShowS #

show :: Space -> String #

showList :: [Space] -> ShowS #

isToken :: Token -> Token -> Bool Source #

Check if a token is equal to the give none.

isKPunc :: Char -> Token -> Bool Source #

Check is token is punctuation using the given character.

takeNameOfToken :: Space -> Token -> Maybe Text Source #

Take the name from a token, if any.

takeAnyNameOfToken :: Token -> Maybe (Space, Text) Source #

Take the name from a token, if any.

takeNatOfToken :: Token -> Maybe Integer Source #

Take the natural number from a token, if any.