Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| buzz_syntax_bnf_specification [2015/07/27 21:10] – ilpincy | buzz_syntax_bnf_specification [2016/04/10 00:15] (current) – removed ilpincy | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Buzz Syntax BNF Specification ====== | ||
| - | ===== Tokens ===== | ||
| - | |||
| - | An **identifier** in Buzz is any sequence of alphanumeric characters starting with a letter or an underscore ('' | ||
| - | The recognized tokens are: | ||
| - | |||
| - | ^ Token ^ Id ^ | ||
| - | | _identifier_ | ||
| - | | _numeric constant_ | ||
| - | | ''''' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '' | ||
| - | | '';'' | ||
| - | | '','' | ||
| - | | '' | ||
| - | | '' | ||
| - | | ''<'' | ||
| - | |||
| - | ===== Grammar ===== | ||
| - | |||
| - | script | ||
| - | |||
| - | statlist | ||
| - | stat ::= <nil> | vardef | fundef | if | loop | command | ||
| - | |||
| - | block ::= TOKBLOCKOPEN statlist TOKBLOCKCLOSE | ||
| - | |||
| - | vardef | ||
| - | fundef | ||
| - | if ::= TOKIF TOKPAROPEN condition TOKPARCLOSE block endif | ||
| - | endif ::= <nil> | TOKELSE block | ||
| - | loop ::= forloop | whileloop | ||
| - | forloop | ||
| - | | ||
| - | whileloop | ||
| - | |||
| - | conditionlist | ||
| - | condition | ||
| - | comparison | ||
| - | |||
| - | expression | ||
| - | product | ||
| - | modulo | ||
| - | power ::= operand powerrest | ||
| - | powerrest | ||
| - | operand | ||
| - | |||
| - | command | ||
| - | assignment | ||
| - | assignmentlist | ||
| - | |||
| - | idlist | ||
| - | idreflist | ||
| - | idref ::= TOKID | idref TOKDOT TOKID | idref TOKIDXOPEN expression TOKIDXCLOSE | idref TOKPAROPEN conditionlist TOKPARCLOSE | ||
| - | |||
| - | lambda | ||