antlr-haskell-0.1.0.0: A Haskell implementation of the ANTLR top-down parser generator

Copyright(c) Karl Cronburg 2018
LicenseBSD3
Maintainerkarl@cs.tufts.edu
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Text.ANTLR.Allstar

Description

This module contains the glue code for hooking Sam's ParserGenerator implementation into the rest of this package.

Synopsis

Documentation

parse :: (Ord nts, Ord (Label t), Token t, Show nts, Show (Label t), Show t) => [t] -> GrammarSymbol nts (Label t) -> Set (ATNEdge nts (Label t)) -> Bool -> Either String (AST nts t) Source #

Entrypoint to the ALL(*) parsing algorithm.

atnOf :: (Ord nt, Ord t, Hashable nt, Hashable t) => Grammar s nt t -> ATNEnv nt t Source #

Go from an antlr-haskell Grammar to an Allstar ATNEnv. ALL(*) does not current support predicates and mutators.

class Token t where Source #

Input sequence type

Associated Types

type Label t :: * Source #

type Literal t :: * Source #

Methods

getLabel :: t -> Label t Source #

getLiteral :: t -> Literal t Source #

data GrammarSymbol nt t Source #

Grammar symbol types

Constructors

NT nt 
T t 
EPS 
Instances
(Eq nt, Eq t) => Eq (GrammarSymbol nt t) Source # 
Instance details

Defined in Text.ANTLR.Allstar.ParserGenerator

Methods

(==) :: GrammarSymbol nt t -> GrammarSymbol nt t -> Bool #

(/=) :: GrammarSymbol nt t -> GrammarSymbol nt t -> Bool #

(Ord nt, Ord t) => Ord (GrammarSymbol nt t) Source # 
Instance details

Defined in Text.ANTLR.Allstar.ParserGenerator

Methods

compare :: GrammarSymbol nt t -> GrammarSymbol nt t -> Ordering #

(<) :: GrammarSymbol nt t -> GrammarSymbol nt t -> Bool #

(<=) :: GrammarSymbol nt t -> GrammarSymbol nt t -> Bool #

(>) :: GrammarSymbol nt t -> GrammarSymbol nt t -> Bool #

(>=) :: GrammarSymbol nt t -> GrammarSymbol nt t -> Bool #

max :: GrammarSymbol nt t -> GrammarSymbol nt t -> GrammarSymbol nt t #

min :: GrammarSymbol nt t -> GrammarSymbol nt t -> GrammarSymbol nt t #

(Show nt, Show t) => Show (GrammarSymbol nt t) Source # 
Instance details

Defined in Text.ANTLR.Allstar.ParserGenerator

Methods

showsPrec :: Int -> GrammarSymbol nt t -> ShowS #

show :: GrammarSymbol nt t -> String #

showList :: [GrammarSymbol nt t] -> ShowS #

type ATNEnv nt t = Set (ATNEdge nt t) Source #

A set of ATN edges, defining the grammar over which the ALL(*) parsing algorithm operates.