MyNixOS website logo
Description

Haskell 98 parser combintors for INFOB3TC at Utrecht University.

This library tries to be a drop in replacement for uu-tc that provides error messages. However, we could not avoid additional type class constraints on parse. Notice that you might need to add Ord and ErrorsPretty constraints to your own functions and ensure your own data types are deriving (Ord, Show). See parse's documentation in the ParseLib.Abstract.Core module too.

If you are only interested in full parses of some parser p, enforce full parses on the Parser level using the ParseLib.Abstract.Derived.eof combinator as in parse (p <* eof) input. This ensures error reporting.

Report bugs to gitlab or [email protected], please.

uu-tc generates no error messages at all. Here is an example of an error messages generated by this library when I made a mistake writing a lexer.

input:3:8:
  |
3 | PRODID:-//hacksw/handcal//NONSGML v1.0//EN
  |        ^^^^^^^^^^^
unexpected "-//hacksw/h"
expecting "2.0", "BEGIN", "DESCRIPTION", "DTEND", "DTSTAMP", "DTSTART", "END", "LOCATION", "PRODID", "SUMMARY", "UID", "VCALENDAR", "VERSION", "VEVENT", ':', crlf newline, or end of input

Here is an example of an error messages generated by this library when I made a mistake writing a parser.

input:10:
  KeyClass
  UpperId "Hello"
  COpen
  KeyVoid
  LowerId "main"
  POpen
  PClose
  COpen
  LowerId "print"
  POpen
> ConstInt 97
  PClose
  Semicolon
  CClose
  CClose
unexpected '(ConstInt 97)'
expecting '(PClose)'

Description of uu-tc

Course software for INFOB3TC (Languages & Compilers)

This library currently contains two Haskell 98 parser combinator libraries.

  • The default library, available as ParseLib or more explicitly by importing ParseLib.Simple, is the one described in the lecture notes, using a type synonym as the type for parsers.

  • The second library can be chosen by importing ParseLib.Abstract. It defines the same functions as ParseLib.Simple, but keeps the parser type abstract.

In future versions of this package, more libraries with more advanced implementations of parser combinators may be added.

Metadata

Version

0.3.0.0

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows