sp11 Language Reference
Regular Grammar
( legend )Character Set | ||||
---|---|---|---|---|
let | Byte | :: | '\00' .. '\ff'
| |
let | Control | :: | '\00' .. '\1f' | '\7f' | '\ff'
| |
Basic elements of tokens | ||||
let | Printable | :: | ||
ign | Space | :: | " " | "\t"
| |
ign | Line | :: | "\n" | "\r"
| |
ign | Page | :: | "\p"
| |
ign | Etx | :: | "\1a" { Byte }
| |
Definitions and simple tokens | ||||
let | ULetter | :: | 'A' .. 'Z' | |
let | LLetter | :: | 'a' .. 'z' | |
let | Letter | :: | ||
let | Bit | :: | '0' | '1' | |
let | Hex1 | :: | '0' .. '9' | 'a' .. 'f' | 'A' .. 'Z' | |
let | Hex2 | :: | ||
let | Hex4 | :: | ||
let | Digit | :: | '0' .. '9' | |
let | Space11 | :: | '\08' | '\09' | '\0a' | '\0b' | '\0c' | '\0d' | |
let | NQSpecial | :: | '!\"#$%&+,-./:;<=>?@[\\]^_\`{|}(*)~' | |
let | Sign | :: | '+' | '-' | |
let | ComChar | :: | ||
Comments et al | ||||
com | ComBlock | :: | < "(*" > < "*)" > | |
com | ComLine | :: | ||
Complex tokens | ||||
tok | Ide [I] | :: | Letter { Letter | Digit | '_' } | |
tok | Bin | :: | "%" Bit + | |
tok | Nat | :: | Digit + | |
tok | Flt | :: | Digit + "." [ Digit + ] [ 'eE' [ Sign ] Digit + ] | |
tok | Lit | :: | '\"' Hex4 + '\"' | |
tok | Str | :: | '\'' { Space | Space11 | Letter | Digit | NQSpecial | "\'\'" } '\'' | |
tok | Opr | :: | NQSpecial | ">=" | "<=" | "<>" | ":=" [ ':' ] | "<*" | "**" | ":<>:" | "||" |
Context-free Grammar
( legend )start | Step11 | :: | ||
let | Schemas | :: | ||
let | Schemas0 | :: | ||
| | ||||
let | Schema | :: | schema Ide ; SchemaBody end_schema ; | |
let | SchemaBody | :: | ||
let | Interfaces | :: | ||
| | ||||
let | Interface | :: | use from Ide References ; | |
| | reference from Ide References ; | |||
let | References | :: | ( References1 ) | |
| | ||||
let | References1 | :: | ||
let | References0 | :: | ||
| | ||||
let | Ref | :: | ||
| | ||||
let | ConstDecl | :: | constant Constants end_constant ; | |
| | ||||
let | Constants | :: | ||
let | Constants0 | :: | ||
| | ||||
let | Constant | :: | ||
let | TypeN | :: | ||
let | Type | :: | logical | |
| | boolean | |||
| | binary Size | |||
| | integer | |||
| | string Size | |||
| | real OptExp3 | |||
| | number | |||
let | TypeA | :: | ||
| | ||||
| | ||||
| | array Bound of KeyOpt KeyUniq TypeB | |||
let | TypeB | :: | ||
| | ||||
| | ||||
let | Bound | :: | ||
let | Size | :: | ||
| | ||||
let | KeyOpt | :: | ||
| | optional | |||
let | KeyUniq | :: | ||
| | unique | |||
let | KeyFix | :: | ||
| | fixed | |||
let | Exp | :: |
| |
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
let | Exp1 | :: |
| |
| | ||||
| | ||||
| | ||||
| | ||||
let | Exp2 | :: |
| |
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
let | Exp3 | :: |
| |
| | ||||
let | Exp4 | :: | { Exp1 IvalOpr Exp1 IvalOpr Exp1 }
| |
| | [ ExpRng0 ] | |||
| | ||||
| | not Exp5 | |||
| | ||||
| | - Exp5 | |||
| | + Exp5 | |||
let | IvalOpr | :: | < | |
| | <= | |||
let | Exp5 | :: |
| |
| | pi Quals | |||
| | ||||
| | ||||
| | true | |||
| | const_e Quals | |||
| | self Quals | |||
| | unknown | |||
| | ||||
| | ? Quals | |||
| | ||||
| | ( Exp ) | |||
| | ||||
| | false | |||
let | ExpRng0 | :: | ||
| | ||||
let | ExpRng | :: | ||
| | ||||
let | Quals | :: | ||
| | ||||
let | ExpQual | :: | . Ide | |
| | \ Ide | |||
| | [ ExpRng ] | |||
let | Exps | :: | ||
let | Exps0 | :: | ||
| | ||||
let | Fun0 | :: | ||
let | Fun | :: | nvl | |
| | sqrt | |||
| | lobound | |||
| | value | |||
| | atan | |||
| | exists | |||
| | blength | |||
| | typeof | |||
| | usedin | |||
| | loindex | |||
| | log2 | |||
| | log10 | |||
| | tan | |||
| | exp | |||
| | acos | |||
| | sizeof | |||
| | log | |||
| | hiindex | |||
| | odd | |||
| | ||||
| | value_in | |||
| | length | |||
| | value_unique | |||
| | hibound | |||
| | asin | |||
| | rolesof | |||
| | sin | |||
| | format | |||
| | cos | |||
| | abs | |||
let | FunP | :: | ||
| | remove | |||
| | insert | |||
let | FPars | :: | ||
| | ( FPars1 ) | |||
let | FPars1 | :: | ||
let | FPars0 | :: | ||
| | ||||
let | FParsP | :: | ( FParsP1 ) | |
| | ||||
let | FParsP1 | :: | ||
let | FParsP0 | :: | ||
| | ||||
let | FPar | :: | ||
let | FParP | :: | ||
| | ||||
let | APars | :: | ( APars1 ) | |
| | ||||
let | APars1 | :: | ||
let | APars0 | :: | ||
| | ||||
let | Decls | :: | ||
| | ||||
let | Decls0 | :: | ||
| | ||||
let | Decl0 | :: | type Ide = TypeU ; Where1 end_type ; | |
| | ||||
| | FunHead AHead Stmts1 end_function ; | |||
| | ProcHead AHead Stmts end_procedure ; | |||
let | Decl | :: | RuleHead AHead Stmts Where end_rule ; | |
| | ||||
let | Ids | :: | ||
let | Ids0 | :: | ||
| | ||||
let | ObjHead | :: | ||
let | ProcHead | :: | ||
let | FunHead | :: | ||
let | ObjBody | :: | EAttrDecls DAttrDecls IAttrDecls RuleUniqs Where1 | |
let | EAttrDecls | :: | ||
| | ||||
let | EAttrDecl | :: | ||
let | Attrs | :: | ||
let | Attrs0 | :: | ||
| | ||||
let | DAttrDecls | :: | ||
| | derive DAttrDecl DAttrDecls0 | |||
let | DAttrDecls0 | :: | ||
| | ||||
let | DAttrDecl | :: | ||
let | IAttrDecls | :: | inverse IAttrDecl IAttrDecls0 | |
| | ||||
let | IAttrDecls0 | :: | ||
| | ||||
let | IAttrDecl | :: | ||
let | RuleUniqs | :: | ||
| | unique LblAttrs ; RuleUniqs0 | |||
let | RuleUniqs0 | :: | ||
| | ||||
let | LblAttrs | :: | ||
| | ||||
let | TypeI | :: | ||
| | ||||
| | ||||
let | TypeU | :: | enumeration of ( Ids ) | |
| | ||||
| | select ( Ids ) | |||
| | ||||
| | ||||
let | Attr | :: | ||
| | ||||
let | SubSup0 | :: | ||
let | SubSup | :: | ||
| | supertype CondSubType | |||
| | abstract supertype OptCondSubType | |||
let | SubSup1 | :: | subtype of ( Ids ) | |
| | ||||
let | CondSubType | :: | of ( ExpSup ) | |
let | OptCondSubType | :: | ||
| | ||||
let | ExpSup | :: |
| |
| | ||||
let | ExpSup1 | :: |
| |
| | ||||
let | ExpSup2 | :: | ||
| | ( ExpSup ) | |||
| | oneof ( ExpSups ) | |||
let | ExpSups | :: | ||
let | ExpSups0 | :: | ||
| | ||||
let | RuleHead | :: | ||
let | AHead | :: | ||
let | LocalDecl | :: | ||
| | local Vars end_local ; | |||
let | Vars | :: | ||
let | Vars0 | :: | ||
| | ||||
let | Var | :: | ||
let | TypeP | :: | array Bound of KeyOpt KeyUniq TypeP | |
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
| | generic Label | |||
let | OptExp | :: | := Exp | |
| | ||||
let | OptExp1 | :: | ( Exp ) | |
| | ||||
let | OptExp2 | :: | by Exp1 | |
| | ||||
let | OptExp3 | :: | ( Exp1 ) | |
| | ||||
let | Where | :: | ||
let | Where0 | :: | ||
| | ||||
let | Where1 | :: | ||
| | ||||
let | Label | :: | : Ide | |
| | ||||
let | ExpLbl | :: | ||
| | ||||
let | Stmts | :: | ||
| | ||||
let | Stmts1 | :: | ||
let | StmtsElse | :: | ||
| | else Stmts1 | |||
let | LoopCtrl | :: | while Exp | |
| | ||||
| | until Exp | |||
| | ||||
let | Cases | :: | ||
| | ||||
let | Case | :: | ||
| | otherwise : Stmt | |||
let | Stmt | :: | ; | |
| | if Exp then Stmts1 StmtsElse end_if ; | |||
| | escape ; | |||
| | ||||
| | ||||
| | skip ; | |||
| | alias Ide for Ide Quals ; Stmts1 end_alias ; | |||
| | ||||
| | return OptExp1 ; | |||
| | repeat LoopCtrl ; Stmts1 end_repeat ; | |||
| | begin Stmts1 end ; |