Module

Perspectives.Parsing.Arc.Expression.AST

An Abstract Syntax Tree data model for Perspectives expressions. The expression grammar is below.

step = simpleStep | unaryStep | compoundStep | let*

simpleStep = ArcIdentifier

| binding

| binder

| context

| extern

| Value

| variable

| this

| >>= SequenceFunction

unaryStep = 'not' step | 'createRole' ArcIdentifier | 'createContext' ArcIdentifier | 'exists' ArcIdentifier

compoundStep = 'filter' step 'with' step | step operator step | 'bind_' step 'in' step

operator = '>>' | '==' | '<' | '>' | '<=' | '>=' | 'and' | 'or' | '+' | '-' | '*' | '/'

assignment = ArcIdentifier AssignmentOperator step

AssignmentOperator = '=' | '=+' | '=-'

RoleName = ArcIdentifier

PropertyName = ArcIdentifier

Value = number | boolean | string | date

SequenceFunction = 'sum' | 'count' | 'product' | 'minimum' | 'maximum'

let* = 'let*' binding+ 'in' body

binding = variable '<-' step

body = step | assignment+

variable = lowerCaseName

#Step

data Step

Step represents an Expression conforming to the grammar given above.

Constructors

Instances

#BinaryStep

newtype BinaryStep

Constructors

Instances

#LetStep

newtype LetStep

Constructors

Instances

#PureLetStep

#WithTextRange

type WithTextRange f = { end :: ArcPosition, start :: ArcPosition | f }

#Assignment

data Assignment

Constructors

Instances

Modules