shimmer-0.1.3.3: The Reflective Lambda Machine

Safe HaskellSafe
LanguageHaskell98

SMR.Source.Parser

Synopsis

Documentation

data Config s p Source #

Constructors

Config 

Fields

parseDecls Source #

Arguments

:: Config s p

Primop configration.

-> [Located Token]

Tokens to parse.

-> Either (Error s p) [Decl s p] 

Parse some Shimmer declarations from a list of tokens.

parseExp Source #

Arguments

:: Config s p

Primop configuration.

-> [Located Token]

Tokens to parse.

-> Either (Error s p) (Exp s p) 

Parse a Shimmer expression from a list of tokens.

pDecls :: Config s p -> Parser s p [Decl s p] Source #

Parser for a list of declarations.

pDecl :: Config s p -> Parser s p (Decl s p) Source #

Parser for a single declaration.

pExp :: Config s p -> Parser s p (Exp s p) Source #

Parser for an expression.

pExpApp :: Config s p -> Parser s p (Exp s p) Source #

Parser for an application.

pExpAtom :: Config s p -> Parser s p (Exp s p) Source #

Parser for an atomic expression.

pParam :: Parser s p Param Source #

Parser for a function parameter.

pTrain :: Config s p -> Parser s p [Car s p] Source #

Parser for a substitution train. The cars are produced in reverse order.

pTrainCar :: Config s p -> Parser s p (Car s p) Source #

Parse a single car in the train.

pCarSimRec :: Config s p -> Parser s p (Car s p) Source #

Parser for a substitution environment.

Snv   ::= '[' Bind*, ']'

pBind :: Config s p -> Parser s p (SnvBind s p) Source #

Parser for a binding.

Bind ::= Name '=' Exp
      |  Name ^ Nat '=' Exp

pUps :: Parser s p Ups Source #

Parser for an ups.

Ups  ::= '{' Bump*, '}'

pBump :: Parser s p UpsBump Source #

Parser for a bump.

Bump ::= Name : Nat
      |  Name ^ Nat : Nat

pNat :: Parser s p Integer Source #

Parser for a natural number.

pText :: Parser s p Text Source #

Parser for a text string.

pNameOfSpace :: Space -> Parser s p Text Source #

Parser for a name in the given name space.

pName :: Parser s p (Space, Text) Source #

Parser for a name of any space.

pEnd :: Parser s p () Source #

Parser for the end of input token.

pPunc :: Char -> Parser s p () Source #

Parser for a punctuation character.