# SAP Grammar The order of statements is representative of the hierarchy of the AST. ## Foundation -> ? `Eof` ## Statements -> | | | | | -> `Set` `Ident` `Assign` -> `Return` -> `defineFunction` `LParen` `RParen` ? `End` -> `Repeat` ( | | ) -> `Times` ? `End` -> `Until` ? `End` -> `Forever` ? `End` -> `Display` ? ## Expressions -> Infix operations -> (`Or` )* -> (`And` )* -> ((`Eq`|`NotEq`) )* -> ((`Less`|`LessEq`|`More`|`MoreEq`) )* -> ((`Plus` | `Minus`) )* -> ((`Mult` | `Div` | `Mod`) )* Postfix operations -> ( | )* Prefix operations -> (`Not`|`Minus`)* Mono operations (not really operating on anything tho, could be an entity?) -> `Ident` | -> (`LParen` `RParen`) | Entities -> | | -> `If` `Then` ? (`Otherwise` ?)? `End` -> `LBracket` ? `LBracket` ## Literals -> `Int` | `Float` | `Bool` | `String` ## Aliases -> ((`Semi`|`NewLine`) )* (`Semi`|`NewLine`)? -> `LBracket` `RBracket` -> `LParen` ? `RParen` -> (`,` )*