Hets - the Heterogeneous Tool Set
Copyright(c) Christian Maeder and Uni Bremen 2002-2006
LicenseGPLv2 or higher, see LICENSE.txt
MaintainerChristian.Maeder@dfki.de
Stabilityprovisional
Portabilityportable
Safe HaskellNone

Common.AnnoState

Description

Parsing of interspersed annotations

  • a parser state to collect annotations
  • parsing annoted keywords
  • parsing an annoted item list
Synopsis

Documentation

type AParser st = GenParser Char (AnnoState st) Source #

parsers that can collect annotations via side effects

class AParsable a where Source #

Methods

aparser :: AParser st a Source #

Instances

Instances details
AParsable () Source # 
Instance details

Defined in Common.AnnoState

Methods

aparser :: AParser st () Source #

AParsable C_SIG_ITEM Source # 
Instance details

Defined in CoCASL.Parse_AS

AParsable C_BASIC_ITEM Source # 
Instance details

Defined in CoCASL.Parse_AS

AParsable COL_SIG_ITEM Source # 
Instance details

Defined in COL.Parse_AS

AParsable CspBasicExt Source # 
Instance details

Defined in CspCASL.Parse_CspCASL

AParsable EM_SIG_ITEM Source # 
Instance details

Defined in ExtModal.Parse_AS

AParsable EM_BASIC_ITEM Source # 
Instance details

Defined in ExtModal.Parse_AS

AParsable FplExt Source # 
Instance details

Defined in Fpl.As

AParsable H_SIG_ITEM Source # 
Instance details

Defined in Hybrid.Parse_AS

AParsable H_BASIC_ITEM Source # 
Instance details

Defined in Hybrid.Parse_AS

AParsable M_SIG_ITEM Source # 
Instance details

Defined in Modal.Parse_AS

AParsable M_BASIC_ITEM Source # 
Instance details

Defined in Modal.Parse_AS

AParsable Procdecls Source # 
Instance details

Defined in VSE.Parse

class TermParser a where Source #

Minimal complete definition

Nothing

Methods

termParser Source #

Arguments

:: Bool 
-> AParser st a

True for terms, formulas otherwise

Instances

Instances details
TermParser () Source # 
Instance details

Defined in Common.AnnoState

Methods

termParser :: Bool -> AParser st () Source #

TermParser C_FORMULA Source # 
Instance details

Defined in CoCASL.Parse_AS

Methods

termParser :: Bool -> AParser st C_FORMULA Source #

TermParser DL_FORMULA Source # 
Instance details

Defined in CASL_DL.Parse_AS

Methods

termParser :: Bool -> AParser st DL_FORMULA Source #

TermParser ConstraintFORMULA Source # 
Instance details

Defined in ConstraintCASL.Formula

TermParser CspSen Source # 
Instance details

Defined in CspCASL.SignCSP

Methods

termParser :: Bool -> AParser st CspSen Source #

TermParser EM_FORMULA Source # 
Instance details

Defined in ExtModal.Parse_AS

Methods

termParser :: Bool -> AParser st EM_FORMULA Source #

TermParser TermExt Source # 
Instance details

Defined in Fpl.As

Methods

termParser :: Bool -> AParser st TermExt Source #

TermParser H_FORMULA Source # 
Instance details

Defined in Hybrid.Parse_AS

Methods

termParser :: Bool -> AParser st H_FORMULA Source #

TermParser M_FORMULA Source # 
Instance details

Defined in Modal.Parse_AS

Methods

termParser :: Bool -> AParser st M_FORMULA Source #

TermParser Dlformula Source # 
Instance details

Defined in VSE.Parse

Methods

termParser :: Bool -> AParser st Dlformula Source #

aToTermParser :: AParser st a -> Bool -> AParser st a Source #

data AnnoState st Source #

just the list of currently collected annotations

Constructors

AnnoState 

Fields

Instances

Instances details
OperatorState (AnnoState st) Source # 
Instance details

Defined in CSL.Parse_AS_Basic

Methods

addVar :: AnnoState st -> String -> AnnoState st Source #

isVar :: AnnoState st -> String -> Bool Source #

lookupOperator :: AnnoState st -> String -> Int -> Either Bool OpInfo Source #

lookupBinder :: AnnoState st -> String -> Maybe OpInfo Source #

emptyAnnos :: st -> AnnoState st Source #

no annotations

parseAnnos :: AnnoState a -> GenParser Char st (AnnoState a) Source #

add further annotations to the input state

parseLineAnnos :: AnnoState a -> GenParser Char st (AnnoState a) Source #

add only annotations on consecutive lines to the input state

addAnnos :: AParser st () Source #

add annotations to the internal state

addLineAnnos :: AParser st () Source #

add only annotations on consecutive lines to the internal state

getAnnos :: AParser st [Annotation] Source #

extract all annotation from the internal state, resets the internal state to emptyAnnos

mLineAnnos :: GenParser Char st [Annotation] Source #

annotations on consecutive lines

annos :: AParser st [Annotation] Source #

explicitly parse annotations, reset internal state

lineAnnos :: AParser st [Annotation] Source #

explicitly parse annotations on consecutive lines. reset internal state

tryItemEnd :: [String] -> AParser st () Source #

succeeds if the previous item is finished

startKeyword :: [String] Source #

keywords that indicate a new item for tryItemEnd. the quantifier exists does not start a new item.

annoParser :: AParser st a -> AParser st (Annoted a) Source #

parse preceding annotations and the following item

trailingAnnosParser :: AParser st a -> AParser st [Annoted a] Source #

parse preceding and consecutive trailing annotations of an item in between. Unlike annosParser do not treat all trailing annotations as preceding annotations of the next item.

annosParser :: AParser st a -> AParser st [Annoted a] Source #

parse an item list preceded and followed by annotations

itemList :: [String] -> String -> ([String] -> AParser st b) -> ([Annoted b] -> Range -> a) -> AParser st a Source #

parse an item list preceded by a singular or plural keyword, interspersed with semicolons and an optional semicolon at the end

auxItemList :: [String] -> [Token] -> AParser st b -> ([Annoted b] -> Range -> a) -> AParser st a Source #

generalized version of itemList for an other keyword list for tryItemEnd and without pluralKeyword

itemAux :: [String] -> AParser st a -> AParser st ([a], [Token], [[Annotation]]) Source #

parse an item list without a starting keyword

wrapAnnos :: AParser st a -> AParser st a Source #

collect preceding and trailing annotations

asKey :: String -> AParser st Token Source #

parse an annoted keyword

annoted keywords

semiOrComma :: CharParser st Token Source #

trySemi :: AParser st Token Source #

check for a semicolon beyond annotations

trySemiOrComma :: AParser st Token Source #

check for a semicolon or comma beyond annotations and trailing line annos

optSemi :: AParser st ([Token], [Annotation]) Source #

optional semicolon followed by annotations on consecutive lines