17 lines
751 B
Plaintext
17 lines
751 B
Plaintext
Sheet -> Title Definitions;
|
|
Title -> '$' Name | [a-zA-Z0-9_\ ]+ | epsilon
|
|
// Title is either a variable whose value will be the title, constant text or none
|
|
// in the case of none, the first var will be the title
|
|
Definitions -> Definitions Definition | epsilon;
|
|
Definition -> Name ':' Type Requirements;
|
|
Name -> [a-zA-Z]+;
|
|
Type -> BOOL | INT | TEXT | TEXT '(' [0-9]+ ')' | EXP;
|
|
// ^^^^^ num of lines
|
|
EXP -> TERM '+' FACTOR | TERM '-' FACTOR;
|
|
TERM -> FACTOR '*' FACTOR | FACTOR '/' FACTOR;
|
|
FACTOR -> '(' EXP ')' | [0-9]+ | '$' Name(of type INT/BOOL);
|
|
// $Name of type bool will result in True = 1/False = 0
|
|
Requirements -> '|' Condition Requirements | epsilon;
|
|
Condition -> EXP RELOP EXP | '$' Name(of type BOOL);
|
|
RELOP -> (>|<|>=|<=|==|!=);
|