Hets - the Heterogeneous Tool Set

Copyright(c) Dominik Dietrich DFKI Bremen 2010
LicenseGPLv2 or higher, see LICENSE.txt
Maintainerdominik.dietrich@dfki.de
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone

CSL.Parse_AS_Basic

Contents

Description

Parser for abstract syntax for CSL

Synopsis

Interface to the syntax class

parseSymbItems :: Maybe (GenParser Char st SYMB_ITEMS) Source #

parseSymbMapItems :: Maybe (GenParser Char st SYMB_MAP_ITEMS) Source #

Parser utils

addToPosition Source #

Arguments

:: SourcePos

original position

-> SourcePos

relative position

-> SourcePos

new position

posInputParser :: a -> GenParser tok st (a, SourcePos, [tok], st) Source #

runSubParser :: GenParser tok st a -> st -> SourceName -> GenParser tok st' (Either ParseError (st, a)) Source #

data OpVarState a Source #

Constructors

OpVarState a (Set String) 

Instances

OperatorState a => OperatorState (OpVarState a) Source # 

Methods

addVar :: OpVarState a -> String -> OpVarState a Source #

isVar :: OpVarState a -> String -> Bool Source #

lookupOperator :: OpVarState a -> String -> Int -> Either Bool OpInfo Source #

lookupBinder :: OpVarState a -> String -> Maybe OpInfo Source #

runWithVars :: OperatorState a => [String] -> CharParser (OpVarState a) res -> CharParser a res Source #

parseError :: String -> CharParser st a Source #

pComma :: CharParser st String Source #

pSemi :: CharParser st String Source #

lstring :: String -> CharParser st String Source #

lexemeParser :: CharParser st a -> CharParser st a Source #

parser for symbols followed by whitechars

getOpName :: String -> [OPNAME] -> OPNAME Source #

mkFromOps :: [OPNAME] -> String -> [EXPRESSION] -> EXPRESSION Source #

Parser for Expressions

identifier :: CharParser st Token Source #

parsing of identifiers. an identifier is a letter followed by letters, numbers, or _, but not a keyword

prefixidentifier :: CharParser st Token Source #

signednumberExp :: CharParser st EXPRESSION Source #

parses a possibly signed number to an EXPRESSION

signednumber :: CharParser st (Either APInt String, Range) Source #

parses a possibly signed number (both integers and floats)

readRat :: String -> APFloat Source #

readDbl :: String -> Double Source #

keySignNumCompat :: CharParser st a -> CharParser st a Source #

The version in Common.Lexer is not compatible with floating point numbers which may start with ".". This one does it. This version is still not compatible with -!

oneOfKeys :: [String] -> CharParser st String Source #

plusmin :: OperatorState st => CharParser st EXPRESSION Source #

factor :: OperatorState st => CharParser st EXPRESSION Source #

parse a product of basic expressions

expexp :: OperatorState st => CharParser st EXPRESSION Source #

parse a sequence of exponentiations

expatom :: OperatorState st => CharParser st EXPRESSION Source #

parse a basic expression

expsymbol :: OperatorState st => CharParser st EXPRESSION Source #

opdecl :: OperatorState st => CharParser st OpDecl Source #

listexp :: OperatorState st => CharParser st EXPRESSION Source #

parses a list expression

intervalexp :: CharParser st EXPRESSION Source #

parser for extended parameter, e.g., [I=0,...]

extparam :: CharParser st EXTPARAM Source #

parser for formulas

parseVarList :: CharParser st EXPRESSION Source #

parseVar :: CharParser st EXPRESSION Source #

truefalseFormula :: OperatorState st => CharParser st EXPRESSION Source #

parser for atoms

predFormula :: OperatorState st => CharParser st EXPRESSION Source #

parser for predicates

aFormula :: OperatorState st => CharParser st EXPRESSION Source #

parser for formulas

negFormula :: OperatorState st => CharParser st EXPRESSION Source #

parenFormula :: OperatorState st => CharParser st EXPRESSION Source #

parses a formula within brackets

impOrFormula :: OperatorState st => CharParser st EXPRESSION Source #

parser for implications and ors (same precedence)

andFormula :: OperatorState st => CharParser st EXPRESSION Source #

a parser for and sequence of and formulas

Parser for Commands

command :: CharParser (AnnoState st) CMD Source #

parser for commands

reduceCommand :: OperatorState st => CharParser st CMD Source #

assignment :: OperatorState st => CharParser st CMD Source #

constraint :: OperatorState st => CharParser st CMD Source #

sequenceExpr :: CharParser (AnnoState st) CMD Source #

repeatExpr :: CharParser (AnnoState st) CMD Source #

singleCase :: CharParser (AnnoState st) (EXPRESSION, [CMD]) Source #

caseExpr :: CharParser (AnnoState st) CMD Source #

parser spec entries

opItem :: CharParser st OP_ITEM Source #

parser for operator declarations: example: operator a,b,c

varItems :: CharParser st [VAR_ITEM] Source #

Parser for variable declarations: example: vars x,y in {1,2}; z in [-1,1]

varItem :: CharParser st VAR_ITEM Source #

Parser for a variable declaration: example: vars x,y in {1,2}

epDecl :: CharParser st (Token, EPDomain) Source #

Parser for extended parameter declarations: example: I in [1,2];

epNumValAss :: CharParser st (Token, APInt) Source #

Parser for extended parameter default values and domain variable declarations: example: I = 1; n=2

parseDomain :: CharParser st Domain Source #

parseEPVal :: CharParser st EPVal Source #

parseEPDomain :: CharParser st EPDomain Source #

basicSpec :: AParser st BASIC_SPEC Source #

Toplevel parser for basic specs

parseBasicItems :: AParser st BASIC_ITEM Source #

Parser for basic items

parseOpDecl :: AParser st BASIC_ITEM Source #

parser for operator declarations

parseVarDecl :: AParser st BASIC_ITEM Source #

parser for variable declarations

parseEPDefValOrDomDecl :: AParser st BASIC_ITEM Source #

parser for extended parameter declarations, one of: default value for an extended parameter (I=2) a domain variable declaration (n=10)

parseEPDecl :: AParser st BASIC_ITEM Source #

parser for extended parameter declarations

parseAxItems :: AParser st BASIC_ITEM Source #

parser for Axiom_item

parser for symbol maps etc.

symb :: GenParser Char st SYMB Source #

parsing a prop symbol

symbMap :: GenParser Char st SYMB_OR_MAP Source #

parsing one symbol or a mapping of one to a second symbol

symbItems :: GenParser Char st SYMB_ITEMS Source #

Parse a list of comma separated symbols.

symbs :: GenParser Char st ([SYMB], [Token]) Source #

parse a comma separated list of symbols

symbMapItems :: GenParser Char st SYMB_MAP_ITEMS Source #

parse a list of symbol mappings

symbMaps :: GenParser Char st ([SYMB_OR_MAP], [Token]) Source #

parse a comma separated list of symbol mappings

parseCommand :: String -> Maybe CMD Source #

parseExpression :: OperatorState a => a -> String -> Maybe EXPRESSION Source #

Orphan instances

OperatorState (AnnoState st) Source # 

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 #