first usable version

This commit is contained in:
Peter
2023-11-09 09:46:07 +01:00
parent 70b3e9c722
commit 6b5ab857cb
22 changed files with 675 additions and 153 deletions

View File

@@ -0,0 +1,48 @@
module IBAF-Statements
imports
IBAF-Expressions
Funcons
// Language "IBAFlang"
lexical syntax // Language
syntax // Language
context-free syntax // Language
L-stmt.L-stmt--L-type-L-id-EQUALS-L-exp-SEMI =
L-type L-id "=" L-exp ";"
L-stmt.L-stmt--R-print-LPAREN-L-exp-RPAREN-SEMI =
"print" "(" L-exp ")" ";"
L-stmt.L-stmt--L-stmt-L-stmt =
L-stmt L-stmt
L-type.L-type--R-int =
"int"
L-type.L-type--R-bool =
"bool"
L-type.L-type--L-id =
L-id
context-free syntax // Semantics
FCT.T-execute =
"execute" "[:" L-stmt ":]"
context-free syntax // Desugaring
variables // Meta-variables
L-stmt = "(:Stmt" [1-9]? ":)" {prefer}
L-stmt? = "(:Stmt" [1-9]? "?:)" {prefer}
L-stmt* = "(:Stmt" [1-9]? "*:)" {prefer}
L-stmt+ = "(:Stmt" [1-9]? "+:)" {prefer}
L-type = "(:Typ" [1-9]? ":)" {prefer}
L-type? = "(:Typ" [1-9]? "?:)" {prefer}
L-type* = "(:Typ" [1-9]? "*:)" {prefer}
L-type+ = "(:Typ" [1-9]? "+:)" {prefer}
// SDF comments
sorts // ASTs
T-start