fix-parser-simple-15318.1: Simple fix-expression parser

Parser.Fix.Simple

Description

Simple fix-expression parser

If in doubt, just use parsefix

Synopsis

Documentation

data TokenType Source

Constructors

TokenPlain

Plain, i.e. operand

TokenLParenth 
TokenRParenth 
TokenOper Fixity Integer

Operator, with fixity and precedence

Instances

data Fixity Source

Fixity/Associativity

Instances

parsefix :: (t -> a, t -> t -> a, t -> t -> t -> a) -> (t -> TokenType) -> [t] -> [a]Source

Shunt and Fold

foldfix :: (t -> a, t -> t -> a, t -> t -> t -> a) -> (t -> TokenType) -> [t] -> [a]Source

Fold expression in postfix form

shunt :: (t -> TokenType) -> [t] -> [t]Source

Change from infix to postfix form

Precedence at start is zero