EBNF


Program ::= Expression

Expression ::= Value | UnaryExp | BinaryExp | DeclarationExp | Id

Value ::= ConcreteValue

ConcreteValue ::= IntegerValue | BooleanValue | StringValue | DoubleValue | DecimalValue | FloatValue | NonPositiveIntegerValue | PositiveIntegerValue | NegativeIntegerValue | NonNegativeValue | LongValue | IntValue | ShortValue | ByteValue | MonetaryValue | SharesValue | PureValue | ElementValue | ReportValue | SchemaValue | HexBinaryValue | Base64BinaryValue | QNameValue | DateUnionValue | TimeValue | DateValue | GYearMonthValue | GYearValue | GMonthDayValue | GDayValue | GDayValue | GMonthValue | TokenValue | LanguageValue | NameValue | NCNameValue | UserDefinedType

MonetaryValue ::= "$"DoubleValue"-"StringValue

ElementValue ::= "$ele("[StringValue, MonetaryValue | StringValue, IntegerValue | StringValue, DoubleValue]")"

ReportValue ::= ElementValue | ElementListValue

SchemaValue ::= StringValue | StringListValue

UnaryExp ::= "-" Expression | "not" Expression | "length" Expression | "hierarchy" Expression | audit Expression

audit :: = "benford" Expression | “chisquared” Expression | “sigma3rd” Expression

BinaryExp ::= Expression "+" Expression

| Expression "-" Expression

| Expression "and" Expression

| Expression "or" Expression

| Expression "==" Expression

| Expression "++" Expression

| Expression "@" Expression

| Expression "horizontal" Expression

| Expression "vertical" Expression

| Expression "benford" Expression

| Expression “audit” Expression

| Expression "newlabel" Expression

DeclarationExp ::= "let" Functional "in" Expression

FunctionalDeclaration ::= VarDec

| FunctionDec

| CompositeDec

| ContextDec

VarDec ::= "var" id "=" Expression

FunctionDec ::= "fun" listId "=" expression

CompositeDec ::= FunctionalDeclaration","FunctionalDeclaration

ContextDec ::= "<<" expression ">>"

IdList ::= Id | Id IdList

Aplication ::= Expression"("ListExp")"

ExpList ::= Expression | Expression, ExpList