25 lines
465 B
Plaintext
25 lines
465 B
Plaintext
Language "IBAFlang"
|
|
|
|
Syntax START:start ::= statement*
|
|
Semantics start[[ _:start ]] : =>null-type
|
|
Rule start[[ Stmt* ]] = initialise-binding execute-block[[ '{' Stmt* '}' ]]
|
|
|
|
|
|
|
|
|
|
|
|
Lexis keyword ::= 'else' | 'false' | 'if' | 'true' | 'while' | 'int'
|
|
Lexis SDF
|
|
/*
|
|
lexical syntax
|
|
``id`` = ``keyword`` {reject}
|
|
lexical restrictions
|
|
``id`` -/- [A-Za-z0-9]
|
|
*/
|
|
|
|
Syntax SDF
|
|
/*
|
|
context-free syntax
|
|
``exp ::= exp '+' exp`` {assoc}
|
|
``exp ::= exp '&&' exp`` {assoc}
|
|
*/ |