platinum-parsing-0.1.0.0: General Framework for compiler development.

Copyright(c) 2017 Patrick Champion
Licensesee LICENSE file
Maintainerchlablak@gmail.com
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

PP.Lexer

Description

 

Synopsis

Documentation

type IToken = Char Source #

Input token

data OToken Source #

Output token

Constructors

OToken1 String

Token value

OToken2 [IToken] String

Token value and name

charLexer :: String -> [OToken] Source #

String to OToken (char by char lexer)

class Lexer config where Source #

Lexer class

Minimal complete definition

simulate, consumed, output

Methods

simulate :: config -> config Source #

Simulate the automaton on the input, for one iteration

consumed :: config -> Bool Source #

Check if the input is consumed

output :: config -> [OToken] Source #

Get the output tokens

consume :: config -> config Source #

Consume the complete input

Instances

Lexer DfaConfig Source #

Lexer instance for DFA configuration Dragon Book (2nd edition, fr), page 156, example 3.28