distributors-0.3.0.0: Unifying Parsers, Printers & Grammars
Copyright(C) 2026 - Eitan Chatav
LicenseBSD-style (see the file LICENSE)
MaintainerEitan Chatav <eitan.chatav@gmail.com>
Stabilityprovisional
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Lens.Grammar.Symbol

Contents

Description

 
Synopsis

Symbol

class TerminalSymbol token s | s -> token where Source #

A terminal symbol in a grammar.

Minimal complete definition

Nothing

Methods

terminal :: [token] -> s Source #

default terminal :: (p () () ~ s, Tokenized token (p token token), Monoidal p, Cochoice p) => [token] -> s Source #

Instances

Instances details
TerminalSymbol Char RegBnf Source # 
Instance details

Defined in Control.Lens.Grammar

Methods

terminal :: [Char] -> RegBnf Source #

TerminalSymbol Char RegString Source # 
Instance details

Defined in Control.Lens.Grammar

Methods

terminal :: [Char] -> RegString Source #

(Ord rule, TerminalSymbol token rule) => TerminalSymbol token (Bnf rule) Source # 
Instance details

Defined in Control.Lens.Grammar.BackusNaur

Methods

terminal :: [token] -> Bnf rule Source #

TerminalSymbol token (RegEx token) Source # 
Instance details

Defined in Control.Lens.Grammar.Kleene

Methods

terminal :: [token] -> RegEx token Source #

TerminalSymbol token k => TerminalSymbol token (Grammor k a b) Source # 
Instance details

Defined in Data.Profunctor.Grammar

Methods

terminal :: [token] -> Grammor k a b Source #

(Categorized a, a ~ Item s, IsList s, Cons s s a a, Snoc s s a a, Filterable m, Alternative m, Monad m) => TerminalSymbol a (Parsor s m () ()) Source # 
Instance details

Defined in Data.Profunctor.Grammar

Methods

terminal :: [a] -> Parsor s m () () Source #

(Categorized a, a ~ Item s, IsList s, Cons s s a a, Filterable m, Alternative m, Monad m) => TerminalSymbol a (Printor s m () ()) Source # 
Instance details

Defined in Data.Profunctor.Grammar

Methods

terminal :: [a] -> Printor s m () () Source #

class NonTerminalSymbol s where Source #

A nonTerminal symbol in a grammar.

Methods

nonTerminal :: String -> s Source #

Instances

Instances details
NonTerminalSymbol RegBnf Source # 
Instance details

Defined in Control.Lens.Grammar

NonTerminalSymbol RegString Source # 
Instance details

Defined in Control.Lens.Grammar

(Ord rule, NonTerminalSymbol rule) => NonTerminalSymbol (Bnf rule) Source # 
Instance details

Defined in Control.Lens.Grammar.BackusNaur

Methods

nonTerminal :: String -> Bnf rule Source #

NonTerminalSymbol (RegEx token) Source # 
Instance details

Defined in Control.Lens.Grammar.Kleene

Methods

nonTerminal :: String -> RegEx token Source #