curry-frontend-1.0.4: Compile the functional logic language Curry to several intermediate formats

Copyright(c) 2002 - 2004 Wolfgang Lux
2011 - 2013 Björn Peemöller
LicenseBSD-3-clause
Maintainerbjp@informatik.uni-kiel.de
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Env.OpPrec

Description

In order to parse infix expressions correctly, the compiler must know the precedence and fixity of each operator. Operator precedences are associated with entities and will be checked after renaming was applied. Nevertheless, we need to save precedences for ambiguous names in order to handle them correctly while computing the exported interface of a module.

If no fixity is assigned to an operator, it will be given the default precedence 9 and assumed to be a left-associative operator.

Note: this modified version uses Haskell type Integer for representing the precedence. This change had to be done due to the introduction of unlimited integer constants in the parser / lexer.

Synopsis

Documentation

data OpPrec Source #

Operator precedence.

Constructors

OpPrec Infix Precedence 
Instances
Eq OpPrec Source # 
Instance details

Defined in Env.OpPrec

Methods

(==) :: OpPrec -> OpPrec -> Bool #

(/=) :: OpPrec -> OpPrec -> Bool #

Show OpPrec Source # 
Instance details

Defined in Env.OpPrec

Pretty OpPrec Source # 
Instance details

Defined in Env.OpPrec

Methods

pPrint :: OpPrec -> Doc #

pPrintPrec :: Int -> OpPrec -> Doc #

pPrintList :: [OpPrec] -> Doc #

defaultP :: OpPrec Source #

Default operator declaration (associativity and precedence).

defaultAssoc :: Infix Source #

Default operator associativity.

defaultPrecedence :: Precedence Source #

Default operator precedence.

mkPrec :: Maybe Precedence -> Precedence Source #

type OpPrecEnv = TopEnv PrecInfo Source #

Environment mapping identifiers to their operator precedence.

data PrecInfo Source #

Precedence information for an identifier.

Constructors

PrecInfo QualIdent OpPrec 
Instances
Eq PrecInfo Source # 
Instance details

Defined in Env.OpPrec

Show PrecInfo Source # 
Instance details

Defined in Env.OpPrec

Pretty PrecInfo Source # 
Instance details

Defined in Env.OpPrec

Entity PrecInfo Source # 
Instance details

Defined in Env.OpPrec

bindP :: ModuleIdent -> Ident -> OpPrec -> OpPrecEnv -> OpPrecEnv Source #

Bind an operator precedence.

lookupP :: Ident -> OpPrecEnv -> [PrecInfo] Source #

Lookup the operator precedence for an Ident.

qualLookupP :: QualIdent -> OpPrecEnv -> [PrecInfo] Source #

Lookup the operator precedence for an QualIdent.