antlr-haskell-0.1.0.1: 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 :: CanParse nts tok => [tok] -> GrammarSymbol nts (Label tok) -> ATNEnv nts (Label tok) -> Bool -> Either String (AST nts tok) Source #

No tokenizer required (chr == tok):

parse' :: (CanParse nts tok, Prettify chr) => Tokenizer chr tok -> [chr] -> GrammarSymbol nts (Label tok) -> ATNEnv nts (Label tok) -> Bool -> Either String (AST nts tok) Source #

Entrypoint to the ALL(*) parsing algorithm.

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

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

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 #

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

Defined in Text.ANTLR.Allstar.ParserGenerator

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

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