buzz_syntax_bnf

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
buzz_syntax_bnf [2017/11/09 13:17] – [Grammar] rootbuzz_syntax_bnf [2018/07/17 18:59] (current) ilpincy
Line 10: Line 10:
 The recognized tokens are: The recognized tokens are:
  
-^ Token                         ^ Id              +^ Token                                   ^ Id                
-| //identifier//                  | ''TOKID''         | +| //identifier//                          | ''TOKID''         | 
-| //numeric constant//            | ''TOKCONST''      | +| //numeric constant//                    | ''TOKCONST''      | 
-| '''''_string_''''' ''"''_string_''"'' | ''TOKSTRING''     | +| '''''_string_''''' ''"''_string_''"''   | ''TOKSTRING''     | 
-| ''var''                         | ''TOKVAR''        | +| ''var''                                 | ''TOKVAR''        | 
-| ''nil''                         | ''TOKNIL''        | +| ''nil''                                 | ''TOKNIL''        | 
-| ''if''                          | ''TOKIF''         | +| ''if''                                  | ''TOKIF''         | 
-| ''else''                        | ''TOKELSE''       | +| ''else''                                | ''TOKELSE''       | 
-| ''function''                    | ''TOKFUN''        | +| ''function''                            | ''TOKFUN''        | 
-| ''return''                      | ''TOKRETURN''     | +| ''return''                              | ''TOKRETURN''     | 
-| ''for''                         | ''TOKFOR''        | +| ''for''                                 | ''TOKFOR''        | 
-| ''while''                       | ''TOKWHILE''      | +| ''while''                               | ''TOKWHILE''      | 
-| ''and'', ''or''                   | ''TOKANDOR''      +| ''and'', ''or''                         | ''TOKLANDOR''     
-| ''not''                         | ''TOKNOT''        +| ''not''                                 | ''TOKLNOT''       
-| ''+'', ''-''                      | ''TOKADDSUB''     | +| ''+'', ''-''                            | ''TOKADDSUB''     | 
-| ''*'', ''/''                      | ''TOKMULDIV''     | +| ''*'', ''/''                            | ''TOKMULDIV''     | 
-| ''%''                           | ''TOKMOD''        | +| ''%''                                   | ''TOKMOD''        | 
-| ''^''                           | ''TOKPOW''        | +| ''^''                                   | ''TOKPOW''        | 
-| ''{''                           | ''TOKBLOCKOPEN'' +| ''<<'' ''>>''                           | ''TOKLRSHIFT''    | 
-| ''}''                           | ''TOKBLOCKCLOSE''+| ''&'' ''|''                             | ''TOKBANDOR''     | 
-| ''(''                           | ''TOKPAROPEN''    | +| ''!''                                   | ''TOKBNOT''       | 
-| '')''                           | ''TOKPARCLOSE''   | +| ''{''                                   | ''TOKBLOCKOPEN'' 
-| ''[''                           | ''TOKIDXOPEN''    | +| ''}''                                   | ''TOKBLOCKCLOSE''
-| '']''                           | ''TOKIDXCLOSE''   | +| ''(''                                   | ''TOKPAROPEN''    | 
-| '';'' ''\n''                      | ''TOKSTATEND''    | +| '')''                                   | ''TOKPARCLOSE''   | 
-| '',''                           | ''TOKLISTSEP''    | +| ''[''                                   | ''TOKIDXOPEN''    | 
-| ''=''                           | ''TOKASSIGN''     | +| '']''                                   | ''TOKIDXCLOSE''   | 
-| ''.''                           | ''TOKDOT''        | +| '';'' ''\n''                            | ''TOKSTATEND''    | 
-| ''<'' ''<='' ''>'' ''>='' ''=='' ''!=''   | ''TOKCMP''        |+| '',''                                   | ''TOKLISTSEP''    | 
 +| ''=''                                   | ''TOKASSIGN''     | 
 +| ''.''                                   | ''TOKDOT''        | 
 +| ''<'' ''<='' ''>'' ''>='' ''=='' ''!='' | ''TOKCMP''        |
  
 ===== Grammar ===== ===== Grammar =====
Line 58: Line 61:
  
   conditionlist      ::= condition | conditionlist TOKLISTSEP condition   conditionlist      ::= condition | conditionlist TOKLISTSEP condition
-  condition          ::= comparison | condition TOKANDOR comparison | NOT condition+  condition          ::= comparison | condition TOKLANDOR comparison | TOKLNOT condition
   comparison         ::= expression | expression TOKCMP expression   comparison         ::= expression | expression TOKCMP expression
  
Line 64: Line 67:
   product            ::= modulo | product TOKMULDIV modulo   product            ::= modulo | product TOKMULDIV modulo
   modulo             ::= power | modulo TOKMOD power   modulo             ::= power | modulo TOKMOD power
-  power              ::= operand powerrest+  power              ::= bitshift powerrest
   powerrest          ::= <nil> | TOKPOW power   powerrest          ::= <nil> | TOKPOW power
 +  bitshift           ::= bitwiseandor | operand TOKLRSHIFT bitwiseandor
 +  bitwiseandor       ::= bitwisenot | bitwiseandor TOKBANDOR bitwisenot
 +  bitwisenot         ::= operand | TOKBNOT bitwisenot
   operand            ::= TOKNIL | TOKCONST | TOKSTRING | TOKPAROPEN condition TOKPARCLOSE | TOKADDSUB power | idref | lambda | tabledef   operand            ::= TOKNIL | TOKCONST | TOKSTRING | TOKPAROPEN condition TOKPARCLOSE | TOKADDSUB power | idref | lambda | tabledef
  
  • buzz_syntax_bnf.1510233437.txt.gz
  • Last modified: 2017/11/09 13:17
  • by root