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/29 04:34] – 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 defined by this regular expression: | ||
- | |||
- | [[: | ||
- | |||
- | The recognized tokens are: | ||
- | |||
- | ^ Token ^ Id ^ | ||
- | | // | ||
- | | //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 |