Agda-2.3.2: A dependently typed functional programming language and proof assistant

Safe Haskell | None

Agda.Syntax.Parser

Contents

- Types
- Parse functions
- Parsers
- Parse errors

Synopsis

- data Parser a
- parse :: Parser a -> String -> IO a
- parseLiterate :: Parser a -> String -> IO a
- parsePosString :: Parser a -> Position -> String -> IO a
- parseFile' :: Parser a -> AbsolutePath -> IO a
- moduleParser :: Parser Module
- exprParser :: Parser Expr
- tokensParser :: Parser [Token]
- data ParseError = ParseError {
  - errPos :: Position
  - errInput :: String
  - errPrevToken :: String
  - errMsg :: String
  }

# Types

data Parser a

Wrapped Parser type.

# Parse functions

parse :: Parser a -> String -> IO a

parseLiterate :: Parser a -> String -> IO a

parsePosString :: Parser a -> Position -> String -> IO a

parseFile' :: Parser a -> AbsolutePath -> IO a

# Parsers

moduleParser :: Parser Module

Parses a module.

exprParser :: Parser Expr

Parses an expression.

tokensParser :: Parser [Token]

Gives the parsed token stream (including comments).

# Parse errors

data ParseError

What you get if parsing fails.

Constructors

ParseError |
Fields errPos :: Position where the error occured errInput :: String the remaining input errPrevToken :: String the previous token errMsg :: String hopefully an explanation of what happened

Instances

Show ParseError |
Typeable ParseError |
Exception ParseError |
HasRange ParseError |
MonadError ParseError Parser |