Hets - the Heterogeneous Tool Set
CopyrightChristian Maeder and Uni Bremen 2006
LicenseGPLv2 or higher, see LICENSE.txt
MaintainerChristian.Maeder@dfki.de
Stabilityexperimental
Portabilityportable
Safe HaskellSafe

Common.Prec

Description

Precedence checking

Synopsis

Documentation

data PrecMap Source #

a precedence map using numbers for faster lookup

Constructors

PrecMap 

Fields

Instances

Instances details
Data PrecMap Source # 
Instance details

Defined in Common.Prec

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PrecMap -> c PrecMap

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PrecMap

toConstr :: PrecMap -> Constr

dataTypeOf :: PrecMap -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PrecMap)

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PrecMap)

gmapT :: (forall b. Data b => b -> b) -> PrecMap -> PrecMap

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PrecMap -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PrecMap -> r

gmapQ :: (forall d. Data d => d -> u) -> PrecMap -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> PrecMap -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PrecMap -> m PrecMap

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PrecMap -> m PrecMap

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PrecMap -> m PrecMap

Show PrecMap Source # 
Instance details

Defined in Common.Prec

Methods

showsPrec :: Int -> PrecMap -> ShowS

show :: PrecMap -> String

showList :: [PrecMap] -> ShowS

Generic PrecMap 
Instance details

Defined in HasCASL.ATC_HasCASL

Associated Types

type Rep PrecMap :: Type -> Type

Methods

from :: PrecMap -> Rep PrecMap x

to :: Rep PrecMap x -> PrecMap

FromJSON PrecMap 
Instance details

Defined in HasCASL.ATC_HasCASL

Methods

parseJSON :: Value -> Parser PrecMap

parseJSONList :: Value -> Parser [PrecMap]

ToJSON PrecMap 
Instance details

Defined in HasCASL.ATC_HasCASL

Methods

toJSON :: PrecMap -> Value

toEncoding :: PrecMap -> Encoding

toJSONList :: [PrecMap] -> Value

toEncodingList :: [PrecMap] -> Encoding

ShATermConvertible PrecMap 
Instance details

Defined in HasCASL.ATC_HasCASL

Methods

toShATermAux :: ATermTable -> PrecMap -> IO (ATermTable, Int)

toShATermList' :: ATermTable -> [PrecMap] -> IO (ATermTable, Int)

fromShATermAux :: Int -> ATermTable -> (ATermTable, PrecMap)

fromShATermList' :: Int -> ATermTable -> (ATermTable, [PrecMap])

type Rep PrecMap 
Instance details

Defined in HasCASL.ATC_HasCASL

type Rep PrecMap = D1 ('MetaData "PrecMap" "Common.Prec" "main" 'False) (C1 ('MetaCons "PrecMap" 'PrefixI 'True) (S1 ('MetaSel ('Just "precMap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Id Int)) :*: S1 ('MetaSel ('Just "maxWeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

getIdPrec :: PrecMap -> Set Id -> Id -> Int Source #

dropPrefix :: [a] -> [b] -> [b] Source #

drop as many elements as are in the first list

isLeftArg :: Id -> [a] -> Bool Source #

check if a left argument will be added. (The Int is the number of current arguments.)

isRightArg :: Id -> [a] -> Bool Source #

check if a right argument will be added.

checkArg :: AssocEither -> GlobalAnnos -> (Id, Int) -> (Id, Int) -> Id -> Bool Source #

nextWeight :: AssocEither -> GlobalAnnos -> Id -> Id -> Id Source #

compute the left or right weight for the application

checkPrec :: GlobalAnnos -> (Id, Int) -> (Id, Int) -> [a] -> (AssocEither -> Id) -> Bool Source #

check precedence of an argument and a top-level operator.

typeInstTok :: Token Source #

token for instantiation lists of polymorphic operations

polyId :: Id -> Id Source #

mark an identifier as polymorphic with a typeInstTok token

unPolyId :: Id -> Maybe Id Source #

remove the typeInstTok token again

getGenPolyTokenList :: String -> Id -> [Token] Source #

get the token lists for polymorphic ids