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

Common.Token

Description

Parser for CASL Ids based on Common.Lexer

Synopsis

Casl keyword lists

casl_reserved_ops :: [String] Source #

reserved signs

formula_ops :: [String] Source #

these formula signs are legal in terms, but illegal in declarations

casl_reserved_fops :: [String] Source #

all reseverd signs

casl_basic_reserved_words :: [String] Source #

reserved keywords

casl_structured_reserved_words :: [String] Source #

reserved keywords

criticalKeywords :: [String] Source #

keywords terminating a basic spec or starting a new library item

terminatingKeywords :: [String] Source #

keywords terminating a basic spec

startingKeywords :: [String] Source #

keywords starting a library item

otherStartKeywords :: [String] Source #

keywords that may follow a defining equal sign

continuationKeywords :: [String] Source #

other intermediate keywords

casl_reserved_words :: [String] Source #

reserved keywords

formula_words :: [String] Source #

these formula words are legal in terms, but illegal in declarations

casl_reserved_fwords :: [String] Source #

all reserved words

a single Token parser taking lists of key symbols and words as parameter

sid :: ([String], [String]) -> GenParser Char st Token Source #

a simple Token parser depending on reserved signs and words (including a quoted char, dot-words or a single digit)

Token lists parsers

braceP :: GenParser Char st [Token] -> GenParser Char st [Token] Source #

balanced mixfix components within braces

bracketP :: GenParser Char st [Token] -> GenParser Char st [Token] Source #

balanced mixfix components within square brackets

innerMix1 :: ([String], [String]) -> GenParser Char st [Token] Source #

an sid optionally followed by other mixfix components (without no two consecutive sids)

innerMix2 :: ([String], [String]) -> GenParser Char st [Token] Source #

mixfix components not starting with a sid (possibly places)

innerList :: ([String], [String]) -> GenParser Char st [Token] Source #

any mixfix components within braces or brackets

topMix1 :: ([String], [String]) -> GenParser Char st [Token] Source #

mixfix components starting with a sid (outside innerList)

topMix2 :: ([String], [String]) -> GenParser Char st [Token] Source #

mixfix components starting with braces (braceP) that may follow sid outside innerList. (Square brackets after a sid will be taken as a compound list.)

topMix3 :: ([String], [String]) -> GenParser Char st [Token] Source #

mixfix components starting with square brackets (bracketP) that may follow a place (placeT) (outside innerList)

afterPlace :: ([String], [String]) -> GenParser Char st [Token] Source #

any (topMix1, topMix2, topMix3) mixfix components that may follow a place (placeT) at the top level

middle :: ([String], [String]) -> GenParser Char st [Token] Source #

places possibly followed by other (afterPlace) mixfix components

tokStart :: ([String], [String]) -> GenParser Char st [Token] Source #

many (balanced, top-level) mixfix components (afterPlace) possibly interspersed with multiple places (placeT)

start :: ([String], [String]) -> GenParser Char st [Token] Source #

any (balanced, top-level) mixfix components possibly starting with places but no single placeT only.

parser for mixfix and compound Ids

comps :: ([String], [String]) -> GenParser Char st ([Id], Range) Source #

parsing a compound list

mixId :: ([String], [String]) -> ([String], [String]) -> GenParser Char st Id Source #

parse mixfix components (start) and an optional compound list (comps) if the last token was no place. Accept possibly further places. Key strings (second argument) within compound list may differ from top-level key strings (first argument)!

casl_keys :: [String] -> ([String], [String]) Source #

the Casl key strings (signs first) with additional keywords

parseId :: [String] -> GenParser Char st Id Source #

Casl ids for operations and predicates

consId :: [String] -> GenParser Char st Id Source #

disallow barS within the top-level of constructor names

sortId :: [String] -> GenParser Char st Id Source #

Casl sorts are simple words (varId), but may have a compound list (comps)

parser for simple Ids

varId :: [String] -> GenParser Char st Token Source #

parse a simple word not in casl_reserved_fwords

nonSkippingSimpleId :: GenParser Char st Token Source #

non-skipping version for simple ids

simpleId :: GenParser Char st Token Source #

like varId. SIMPLE_ID for spec- and view names

parser for key Tokens

quMarkT :: GenParser Char st Token Source #

parse a question mark key sign (quMark)

colonST :: GenParser Char st Token Source #

parse a colonS possibly immediately followed by a quMark

crossT :: GenParser Char st Token Source #

parse the product key sign (prodS or timesS)