« blib/lib/SPVM/Document/Language/Statements.pm
↑ Summary
blib/lib/SPVM/Document/Language/System.pm »
| 1 | =head1 Name | ||
| 2 | |||
| 3 | SPVM::Document::Language::SyntaxParsing - Syntax Parsing in the SPVM Language | ||
| 4 | |||
| 5 | =head1 Description | ||
| 6 | |||
| 7 | This document describes the grammer of the SPVM language and syntax parsing. | ||
| 8 | |||
| 9 | =head1 Syntax Parsing | ||
| 10 | |||
| 11 | Syntax parsing is the step to build an AST. | ||
| 12 | |||
| 13 | Thie step is just after L<tokenization|SPVM::Document::Language::Tokenization>. | ||
| 14 | |||
| 15 | Syntax parsing is performed according to the grammer of the SPVM language. | ||
| 16 | |||
| 17 | =head2 Grammer | ||
| 18 | |||
| 19 | The grammer of the SPVM language is described using L<GNU Bison|https://en.wikipedia.org/wiki/GNU_Bison> syntax. | ||
| 20 | |||
| 21 | %token <opval> CLASS HAS GET SET METHOD OUR ENUM MY USE AS REQUIRE ALIAS ALLOW OUTMOST_CLASS MUTABLE | ||
| 22 | %token <opval> ATTRIBUTE MAKE_READ_ONLY MAKE_FIXED_LENGTH INTERFACE EVAL_ERROR_ID EVAL_ERROR_NAME ARGS_WIDTH VERSION_DECL VERSION_FROM | ||
| 23 | %token <opval> IF UNLESS ELSIF ELSE FOR WHILE LAST NEXT SWITCH CASE DEFAULT BREAK EVAL BREAK_POINT | ||
| 24 | %token <opval> SYMBOL_NAME VAR_NAME CONSTANT EXCEPTION_VAR COPY_FIELDS EXISTS DELETE | ||
| 25 | %token <opval> UNDEF VOID BYTE SHORT INT LONG FLOAT DOUBLE STRING OBJECT ELEMENT TRUE FALSE END_OF_FILE | ||
| 26 | %token <opval> RW RO WO INIT END NEW OF BASIC_TYPE_ID EXTENDS SUPER SET_LENGTH SET_CAPACITY | ||
| 27 | %token <opval> RETURN WEAKEN DIE WARN WARN_LEVEL DIAG PRINT SAY STDERR OUTMOST_CLASS_NAME UNWEAKEN ENABLE_OPTIONS DISABLE_OPTIONS | ||
| 28 | %type <opval> grammar | ||
| 29 | %type <opval> field_name method_name class_name | ||
| 30 | %type <opval> basic_type opt_basic_type array_type array_type_with_length type runtime_type ref_type return_type | ||
| 31 | %type <opval> union_type generic_type | ||
| 32 | %type <opval> opt_classes classes class class_block opt_extends version_decl version_from | ||
| 33 | %type <opval> opt_definitions definitions definition | ||
| 34 | %type <opval> enumeration enumeration_block opt_enumeration_items enumeration_items enumeration_items_without_last_comma enumeration_item | ||
| 35 | %type <opval> method opt_args args args_without_last_comma arg use use_without_alias require class_alias our has getter opt_getter setter opt_setter anon_method_field interface allow | ||
| 36 | %type <opval> anon_method anon_method_fields anon_method_fields_without_last_comma | ||
| 37 | %type <opval> opt_attributes attributes | ||
| 38 | %type <opval> opt_statements statements statement if_statement else_statement | ||
| 39 | %type <opval> for_statement while_statement foreach_statement | ||
| 40 | %type <opval> switch_statement case_statement case_statements opt_case_statements default_statement | ||
| 41 | %type <opval> block eval_block init_block end_block switch_block if_require_statement | ||
| 42 | %type <opval> die exists delete | ||
| 43 | %type <opval> var_decl var | ||
| 44 | %type <opval> operator opt_operators operators operators_without_last_comma opt_operator | ||
| 45 | %type <opval> void_return_operator warn warn_level | ||
| 46 | %type <opval> unary_operator array_length | ||
| 47 | %type <opval> inc dec | ||
| 48 | %type <opval> binary_operator arithmetic_operator bit_operator comparison_operator string_concatenation logical_operator defined_or ternary_operator | ||
| 49 | %type <opval> assign | ||
| 50 | %type <opval> new array_init | ||
| 51 | %type <opval> type_check type_cast can | ||
| 52 | %type <opval> call_method caller | ||
| 53 | %type <opval> array_element_access field_access hash_value_access | ||
| 54 | %type <opval> weaken_field unweaken_field isweak_field | ||
| 55 | %type <opval> sequential copy_fields break_point | ||
| 56 | %left <opval> ',' FATCAMMA | ||
| 57 | %right <opval> ASSIGN SPECIAL_ASSIGN | ||
| 58 | %right <oval> '?' ':' | ||
| 59 | %left <opval> LOGICAL_OR DEFINED_OR | ||
| 60 | %left <opval> LOGICAL_AND | ||
| 61 | %left <opval> BIT_OR BIT_XOR | ||
| 62 | %left <opval> BIT_AND | ||
| 63 | %nonassoc <opval> NUMEQ NUMNE STREQ STRNE | ||
| 64 | %nonassoc <opval> NUMGT NUMGE NUMLT NUMLE STRGT STRGE STRLT STRLE ISA ISA_ERROR IS_TYPE IS_ERROR IS_COMPILE_TYPE NUMERIC_CMP STRING_CMP CAN | ||
| 65 | %left <opval> SHIFT | ||
| 66 | %left <opval> '+' '-' '.' | ||
| 67 | %left <opval> '*' DIVIDE DIVIDE_UNSIGNED_INT DIVIDE_UNSIGNED_LONG MODULO MODULO_UNSIGNED_INT MODULO_UNSIGNED_LONG | ||
| 68 | %right <opval> LOGICAL_NOT BIT_NOT '@' REFERENCE DEREFERENCE PLUS MINUS CONVERT SCALAR STRING_LENGTH ISWEAK TYPE_NAME COMPILE_TYPE_NAME DUMP NEW_STRING_LEN IS_READ_ONLY IS_FIXED_LENGTH COPY ADDRESS IS_OPTIONS CAPACITY CALLER | ||
| 69 | %nonassoc <opval> INC DEC | ||
| 70 | %left <opval> ARROW | ||
| 71 | %nonassoc <opval> ')' | ||
| 72 | %left <opval> '(' | ||
| 73 | %left <opval> '[' '{' | ||
| 74 | |||
| 75 | grammar | ||
| 76 | : opt_classes | ||
| 77 | |||
| 78 | field_name | ||
| 79 | : SYMBOL_NAME | ||
| 80 | |||
| 81 | method_name | ||
| 82 | : SYMBOL_NAME | ||
| 83 | |||
| 84 | class_name | ||
| 85 | : SYMBOL_NAME | ||
| 86 | |||
| 87 | runtime_type | ||
| 88 | : basic_type | ||
| 89 | | array_type | ||
| 90 | |||
| 91 | type | ||
| 92 | : runtime_type | ||
| 93 | | ref_type | ||
| 94 | | union_type | ||
| 95 | | generic_type | ||
| 96 | | MUTABLE type | ||
| 97 | |||
| 98 | union_type | ||
| 99 | : type BIT_OR type | ||
| 100 | |||
| 101 | generic_type | ||
| 102 | : basic_type OF type | ||
| 103 | |||
| 104 | basic_type | ||
| 105 | : SYMBOL_NAME | ||
| 106 | | BYTE | ||
| 107 | | SHORT | ||
| 108 | | INT | ||
| 109 | | LONG | ||
| 110 | | FLOAT | ||
| 111 | | DOUBLE | ||
| 112 | | OBJECT | ||
| 113 | | STRING | ||
| 114 | |||
| 115 | ref_type | ||
| 116 | : basic_type '*' | ||
| 117 | |||
| 118 | array_type | ||
| 119 | : basic_type '[' ']' | ||
| 120 | | array_type '[' ']' | ||
| 121 | | basic_type '.' '.' '.' | ||
| 122 | |||
| 123 | array_type_with_length | ||
| 124 | : basic_type '[' operator ']' | ||
| 125 | | array_type '[' operator ']' | ||
| 126 | |||
| 127 | return_type | ||
| 128 | : type | ||
| 129 | | VOID | ||
| 130 | | ELEMENT | ||
| 131 | | ELEMENT '[' ']' | ||
| 132 | |||
| 133 | opt_classes | ||
| 134 | : /* Empty */ | ||
| 135 | | classes | ||
| 136 | |||
| 137 | classes | ||
| 138 | : classes class | ||
| 139 | | class | ||
| 140 | |||
| 141 | class | ||
| 142 | : CLASS opt_basic_type opt_extends class_block END_OF_FILE | ||
| 143 | | CLASS opt_basic_type opt_extends ':' opt_attributes class_block END_OF_FILE | ||
| 144 | | CLASS opt_basic_type opt_extends ';' END_OF_FILE | ||
| 145 | | CLASS opt_basic_type opt_extends ':' opt_attributes ';' END_OF_FILE | ||
| 146 | | opt_statements END_OF_FILE | ||
| 147 | |||
| 148 | opt_basic_type | ||
| 149 | : /* Empty */ | ||
| 150 | | basic_type | ||
| 151 | |||
| 152 | opt_extends | ||
| 153 | : /* Empty */ | ||
| 154 | | EXTENDS basic_type | ||
| 155 | |||
| 156 | class_block | ||
| 157 | : '{' opt_definitions '}' | ||
| 158 | |||
| 159 | opt_definitions | ||
| 160 | : /* Empty */ | ||
| 161 | | definitions | ||
| 162 | |||
| 163 | definitions | ||
| 164 | : definitions definition | ||
| 165 | | definition | ||
| 166 | |||
| 167 | definition | ||
| 168 | : version_decl | ||
| 169 | | version_from | ||
| 170 | | use | ||
| 171 | | class_alias | ||
| 172 | | allow | ||
| 173 | | interface | ||
| 174 | | init_block | ||
| 175 | | end_block | ||
| 176 | | enumeration | ||
| 177 | | our | ||
| 178 | | has ';' | ||
| 179 | | method | ||
| 180 | |||
| 181 | init_block | ||
| 182 | : INIT block | ||
| 183 | |||
| 184 | end_block | ||
| 185 | : END block | ||
| 186 | |||
| 187 | version_decl | ||
| 188 | : VERSION_DECL CONSTANT ';' | ||
| 189 | |||
| 190 | version_from | ||
| 191 | : VERSION_FROM basic_type ';' | ||
| 192 | |||
| 193 | use_without_alias | ||
| 194 | : USE basic_type ';' | ||
| 195 | |||
| 196 | use | ||
| 197 | : use_without_alias | ||
| 198 | | USE basic_type AS class_name ';' | ||
| 199 | |||
| 200 | require | ||
| 201 | : REQUIRE basic_type | ||
| 202 | |||
| 203 | class_alias | ||
| 204 | : ALIAS basic_type AS class_name ';' | ||
| 205 | |||
| 206 | allow | ||
| 207 | : ALLOW basic_type ';' | ||
| 208 | |||
| 209 | interface | ||
| 210 | : INTERFACE basic_type ';' | ||
| 211 | |||
| 212 | enumeration | ||
| 213 | : opt_attributes ENUM enumeration_block | ||
| 214 | |||
| 215 | enumeration_block | ||
| 216 | : '{' opt_enumeration_items '}' | ||
| 217 | |||
| 218 | opt_enumeration_items | ||
| 219 | : /* Empty */ | ||
| 220 | | enumeration_items | ||
| 221 | |||
| 222 | enumeration_items | ||
| 223 | : enumeration_items_without_last_comma | ||
| 224 | | enumeration_items_without_last_comma ',' | ||
| 225 | |||
| 226 | enumeration_items_without_last_comma | ||
| 227 | : enumeration_items_without_last_comma ',' enumeration_item | ||
| 228 | | enumeration_item | ||
| 229 | |||
| 230 | enumeration_item | ||
| 231 | : method_name | ||
| 232 | | method_name ASSIGN CONSTANT | ||
| 233 | |||
| 234 | our | ||
| 235 | : OUR VAR_NAME ':' opt_attributes type opt_getter opt_setter ';' | ||
| 236 | |||
| 237 | has | ||
| 238 | : HAS field_name ':' opt_attributes type opt_getter opt_setter | ||
| 239 | |||
| 240 | opt_getter | ||
| 241 | : /* Empty */ | ||
| 242 | | getter | ||
| 243 | |||
| 244 | getter | ||
| 245 | : GET block | ||
| 246 | |||
| 247 | opt_setter | ||
| 248 | : /* Empty */ | ||
| 249 | | setter | ||
| 250 | |||
| 251 | setter | ||
| 252 | : SET block | ||
| 253 | | SET '(' arg ')' block | ||
| 254 | | SET ':' return_type '(' arg ')' block | ||
| 255 | | SET ':' return_type | ||
| 256 | |||
| 257 | method | ||
| 258 | : opt_attributes METHOD method_name ':' return_type '(' opt_args ')' block | ||
| 259 | | opt_attributes METHOD method_name ':' return_type '(' opt_args ')' ';' | ||
| 260 | | opt_attributes METHOD ':' return_type '(' opt_args ')' block | ||
| 261 | | opt_attributes METHOD ':' return_type '(' opt_args ')' ';' | ||
| 262 | |||
| 263 | anon_method | ||
| 264 | : opt_attributes METHOD ':' return_type '(' opt_args ')' block | ||
| 265 | | '[' anon_method_fields ']' opt_attributes METHOD ':' return_type '(' opt_args ')' block | ||
| 266 | |||
| 267 | opt_args | ||
| 268 | : /* Empty */ | ||
| 269 | | args | ||
| 270 | |||
| 271 | args | ||
| 272 | : args_without_last_comma | ||
| 273 | | args_without_last_comma ',' | ||
| 274 | |||
| 275 | args_without_last_comma | ||
| 276 | : args_without_last_comma ',' arg | ||
| 277 | | arg | ||
| 278 | |||
| 279 | arg | ||
| 280 | : var ':' type | ||
| 281 | | var ':' type ASSIGN operator | ||
| 282 | |||
| 283 | anon_method_fields | ||
| 284 | : anon_method_fields_without_last_comma | ||
| 285 | | anon_method_fields_without_last_comma ',' | ||
| 286 | |||
| 287 | anon_method_fields_without_last_comma | ||
| 288 | : anon_method_fields_without_last_comma ',' anon_method_field | ||
| 289 | | anon_method_field | ||
| 290 | |||
| 291 | anon_method_field | ||
| 292 | : HAS field_name ':' opt_attributes type | ||
| 293 | | HAS field_name ':' opt_attributes type ASSIGN operator | ||
| 294 | | var ':' opt_attributes type | ||
| 295 | | var ':' opt_attributes type ASSIGN operator | ||
| 296 | | var ':' | ||
| 297 | |||
| 298 | opt_attributes | ||
| 299 | : /* Empty */ | ||
| 300 | | attributes | ||
| 301 | |||
| 302 | attributes | ||
| 303 | : attributes ATTRIBUTE | ||
| 304 | | ATTRIBUTE | ||
| 305 | |||
| 306 | opt_statements | ||
| 307 | : /* Empty */ | ||
| 308 | | statements | ||
| 309 | |||
| 310 | statements | ||
| 311 | : statements statement | ||
| 312 | | statement | ||
| 313 | |||
| 314 | statement | ||
| 315 | : if_statement | ||
| 316 | | for_statement | ||
| 317 | | foreach_statement | ||
| 318 | | while_statement | ||
| 319 | | block | ||
| 320 | | switch_statement | ||
| 321 | | case_statement | ||
| 322 | | default_statement | ||
| 323 | | eval_block | ||
| 324 | | if_require_statement | ||
| 325 | | LAST ';' | ||
| 326 | | NEXT ';' | ||
| 327 | | BREAK ';' | ||
| 328 | | RETURN ';' | ||
| 329 | | RETURN operator ';' | ||
| 330 | | die ';' | ||
| 331 | | operator ';' | ||
| 332 | | void_return_operator ';' | ||
| 333 | | ';' | ||
| 334 | | use_without_alias | ||
| 335 | |||
| 336 | die | ||
| 337 | : DIE operator | ||
| 338 | | DIE | ||
| 339 | | DIE basic_type operator | ||
| 340 | | DIE basic_type | ||
| 341 | | DIE operator ',' operator | ||
| 342 | |||
| 343 | void_return_operator | ||
| 344 | : warn | ||
| 345 | | warn_level | ||
| 346 | | PRINT operator | ||
| 347 | | PRINT STDERR operator | ||
| 348 | | SAY operator | ||
| 349 | | SAY STDERR operator | ||
| 350 | | weaken_field | ||
| 351 | | unweaken_field | ||
| 352 | | MAKE_READ_ONLY operator | ||
| 353 | | MAKE_FIXED_LENGTH operator | ||
| 354 | | ENABLE_OPTIONS operator | ||
| 355 | | DISABLE_OPTIONS operator | ||
| 356 | | copy_fields | ||
| 357 | | delete | ||
| 358 | | SET_LENGTH '(' operator ',' operator ')' | ||
| 359 | | SET_CAPACITY '(' operator ',' operator ')' | ||
| 360 | | break_point | ||
| 361 | |||
| 362 | for_statement | ||
| 363 | : FOR '(' opt_operator ';' opt_operator ';' opt_operator ')' block | ||
| 364 | |||
| 365 | foreach_statement | ||
| 366 | : FOR var_decl '(' '@' operator ')' block | ||
| 367 | | FOR var_decl '(' '@' '{' operator '}' ')' block | ||
| 368 | |||
| 369 | while_statement | ||
| 370 | : WHILE '(' operator ')' block | ||
| 371 | |||
| 372 | switch_statement | ||
| 373 | : SWITCH '(' operator ')' switch_block | ||
| 374 | |||
| 375 | switch_block | ||
| 376 | : '{' opt_case_statements '}' | ||
| 377 | | '{' opt_case_statements default_statement '}' | ||
| 378 | |||
| 379 | opt_case_statements | ||
| 380 | : /* Empty */ | ||
| 381 | | case_statements | ||
| 382 | |||
| 383 | case_statements | ||
| 384 | : case_statements case_statement | ||
| 385 | | case_statement | ||
| 386 | |||
| 387 | case_statement | ||
| 388 | : CASE operator ':' block | ||
| 389 | | CASE operator ':' | ||
| 390 | |||
| 391 | default_statement | ||
| 392 | : DEFAULT ':' block | ||
| 393 | | DEFAULT ':' | ||
| 394 | |||
| 395 | if_require_statement | ||
| 396 | : IF '(' require ')' block | ||
| 397 | | IF '(' require ')' block ELSE block | ||
| 398 | |||
| 399 | if_statement | ||
| 400 | : IF '(' operator ')' block else_statement | ||
| 401 | | UNLESS '(' operator ')' block else_statement | ||
| 402 | |||
| 403 | else_statement | ||
| 404 | : /* NULL */ | ||
| 405 | | ELSE block | ||
| 406 | | ELSIF '(' operator ')' block else_statement | ||
| 407 | |||
| 408 | block | ||
| 409 | : '{' opt_statements '}' | ||
| 410 | |||
| 411 | eval_block | ||
| 412 | : EVAL block | ||
| 413 | |||
| 414 | var_decl | ||
| 415 | : MY var ':' type | ||
| 416 | | MY var | ||
| 417 | |||
| 418 | var | ||
| 419 | : VAR_NAME | ||
| 420 | |||
| 421 | opt_operators | ||
| 422 | : /* Empty */ | ||
| 423 | | operators | ||
| 424 | |||
| 425 | opt_operator | ||
| 426 | : /* Empty */ | ||
| 427 | | operator | ||
| 428 | |||
| 429 | operator | ||
| 430 | : var | ||
| 431 | | EXCEPTION_VAR | ||
| 432 | | CONSTANT | ||
| 433 | | UNDEF | ||
| 434 | | type_cast | ||
| 435 | | new | ||
| 436 | | var_decl | ||
| 437 | | EVAL_ERROR_ID | ||
| 438 | | EVAL_ERROR_NAME | ||
| 439 | | ARGS_WIDTH | ||
| 440 | | TRUE | ||
| 441 | | FALSE | ||
| 442 | | OUTMOST_CLASS_NAME | ||
| 443 | | unary_operator | ||
| 444 | | binary_operator | ||
| 445 | | ternary_operator | ||
| 446 | | assign | ||
| 447 | | inc | ||
| 448 | | dec | ||
| 449 | | type_check | ||
| 450 | | BASIC_TYPE_ID type | ||
| 451 | | can | ||
| 452 | | array_init | ||
| 453 | | array_element_access | ||
| 454 | | field_access | ||
| 455 | | hash_value_access | ||
| 456 | | isweak_field | ||
| 457 | | call_method | ||
| 458 | | sequential | ||
| 459 | | exists | ||
| 460 | | caller | ||
| 461 | |||
| 462 | sequential | ||
| 463 | : '(' operators ')' | ||
| 464 | | '(' operators_without_last_comma ',' if_statement ',' operator ')' | ||
| 465 | |||
| 466 | operators | ||
| 467 | : operators_without_last_comma | ||
| 468 | | operators_without_last_comma ',' | ||
| 469 | |||
| 470 | operators_without_last_comma | ||
| 471 | : operators_without_last_comma ',' operator | ||
| 472 | | operator | ||
| 473 | |||
| 474 | unary_operator | ||
| 475 | : '+' operator %prec PLUS | ||
| 476 | | '-' operator %prec MINUS | ||
| 477 | | BIT_NOT operator | ||
| 478 | | TYPE_NAME operator | ||
| 479 | | COMPILE_TYPE_NAME operator | ||
| 480 | | STRING_LENGTH operator | ||
| 481 | | DUMP operator | ||
| 482 | | DEREFERENCE var | ||
| 483 | | REFERENCE operator | ||
| 484 | | NEW_STRING_LEN operator | ||
| 485 | | COPY operator | ||
| 486 | | IS_READ_ONLY operator | ||
| 487 | | IS_FIXED_LENGTH operator | ||
| 488 | | array_length | ||
| 489 | | ADDRESS operator | ||
| 490 | | IS_OPTIONS operator | ||
| 491 | | CAPACITY operator | ||
| 492 | |||
| 493 | array_length | ||
| 494 | : '@' operator | ||
| 495 | | '@' '{' operator '}' | ||
| 496 | | SCALAR '@' operator | ||
| 497 | | SCALAR '@' '{' operator '}' | ||
| 498 | |||
| 499 | inc | ||
| 500 | : INC operator | ||
| 501 | | operator INC | ||
| 502 | |||
| 503 | dec | ||
| 504 | : DEC operator | ||
| 505 | | operator DEC | ||
| 506 | |||
| 507 | binary_operator | ||
| 508 | : arithmetic_operator | ||
| 509 | | bit_operator | ||
| 510 | | comparison_operator | ||
| 511 | | string_concatenation | ||
| 512 | | logical_operator | ||
| 513 | | defined_or | ||
| 514 | |||
| 515 | arithmetic_operator | ||
| 516 | : operator '+' operator | ||
| 517 | | operator '-' operator | ||
| 518 | | operator '*' operator | ||
| 519 | | operator DIVIDE operator | ||
| 520 | | operator DIVIDE_UNSIGNED_INT operator | ||
| 521 | | operator DIVIDE_UNSIGNED_LONG operator | ||
| 522 | | operator MODULO operator | ||
| 523 | | operator MODULO_UNSIGNED_INT operator | ||
| 524 | | operator MODULO_UNSIGNED_LONG operator | ||
| 525 | |||
| 526 | ternary_operator | ||
| 527 | : operator '?' operator ':' operator | ||
| 528 | |||
| 529 | bit_operator | ||
| 530 | : operator BIT_XOR operator | ||
| 531 | | operator BIT_AND operator | ||
| 532 | | operator BIT_OR operator | ||
| 533 | | operator SHIFT operator | ||
| 534 | |||
| 535 | comparison_operator | ||
| 536 | : operator NUMEQ operator | ||
| 537 | | operator NUMNE operator | ||
| 538 | | operator NUMGT operator | ||
| 539 | | operator NUMGE operator | ||
| 540 | | operator NUMLT operator | ||
| 541 | | operator NUMLE operator | ||
| 542 | | operator NUMERIC_CMP operator | ||
| 543 | | operator STREQ operator | ||
| 544 | | operator STRNE operator | ||
| 545 | | operator STRGT operator | ||
| 546 | | operator STRGE operator | ||
| 547 | | operator STRLT operator | ||
| 548 | | operator STRLE operator | ||
| 549 | | operator STRING_CMP operator | ||
| 550 | |||
| 551 | string_concatenation | ||
| 552 | : operator '.' operator | ||
| 553 | |||
| 554 | logical_operator | ||
| 555 | : operator LOGICAL_OR operator | ||
| 556 | | operator LOGICAL_AND operator | ||
| 557 | | LOGICAL_NOT operator | ||
| 558 | |||
| 559 | defined_or | ||
| 560 | : operator DEFINED_OR operator | ||
| 561 | |||
| 562 | type_check | ||
| 563 | : operator ISA runtime_type | ||
| 564 | | operator ISA_ERROR runtime_type | ||
| 565 | | operator IS_TYPE runtime_type | ||
| 566 | | operator IS_ERROR runtime_type | ||
| 567 | | operator IS_COMPILE_TYPE type | ||
| 568 | |||
| 569 | type_cast | ||
| 570 | : '(' type ')' operator %prec CONVERT | ||
| 571 | | operator ARROW '(' type ')' %prec CONVERT | ||
| 572 | |||
| 573 | can | ||
| 574 | : operator CAN method_name | ||
| 575 | | operator CAN CONSTANT | ||
| 576 | |||
| 577 | assign | ||
| 578 | : operator ASSIGN operator | ||
| 579 | | operator SPECIAL_ASSIGN operator | ||
| 580 | |||
| 581 | new | ||
| 582 | : NEW basic_type | ||
| 583 | | NEW array_type_with_length | ||
| 584 | | anon_method | ||
| 585 | |||
| 586 | array_init | ||
| 587 | : '[' opt_operators ']' | ||
| 588 | | '{' operators '}' | ||
| 589 | | '{' '}' | ||
| 590 | |||
| 591 | call_method | ||
| 592 | : OUTMOST_CLASS SYMBOL_NAME '(' opt_operators ')' | ||
| 593 | | OUTMOST_CLASS SYMBOL_NAME | ||
| 594 | | basic_type ARROW method_name '(' opt_operators ')' | ||
| 595 | | basic_type ARROW method_name | ||
| 596 | | operator ARROW method_name '(' opt_operators ')' | ||
| 597 | | operator ARROW method_name | ||
| 598 | | operator ARROW '(' opt_operators ')' | ||
| 599 | |||
| 600 | array_element_access | ||
| 601 | : operator ARROW '[' operator ']' | ||
| 602 | | array_element_access '[' operator ']' | ||
| 603 | | field_access '[' operator ']' | ||
| 604 | | hash_value_access '[' operator ']' | ||
| 605 | |||
| 606 | field_access | ||
| 607 | : operator ARROW '{' field_name '}' | ||
| 608 | | array_element_access '{' field_name '}' | ||
| 609 | | field_access '{' field_name '}' | ||
| 610 | | hash_value_access '{' field_name '}' | ||
| 611 | |||
| 612 | hash_value_access | ||
| 613 | : operator ARROW '{' operator '}' | ||
| 614 | | array_element_access '{' operator '}' | ||
| 615 | | field_access '{' operator '}' | ||
| 616 | | hash_value_access '{' operator '}' | ||
| 617 | |||
| 618 | weaken_field | ||
| 619 | : WEAKEN var ARROW '{' field_name '}' | ||
| 620 | |||
| 621 | unweaken_field | ||
| 622 | : UNWEAKEN var ARROW '{' field_name '}' | ||
| 623 | |||
| 624 | isweak_field | ||
| 625 | : ISWEAK var ARROW '{' field_name '}' | ||
| 626 | |||
| 627 | warn | ||
| 628 | : WARN operator | ||
| 629 | | WARN | ||
| 630 | |||
| 631 | warn_level | ||
| 632 | : WARN_LEVEL operator ',' operator | ||
| 633 | |||
| 634 | copy_fields | ||
| 635 | : COPY_FIELDS operator ',' operator ',' type | ||
| 636 | |||
| 637 | exists | ||
| 638 | : EXISTS var ARROW '{' field_name '}' | ||
| 639 | |||
| 640 | delete | ||
| 641 | : DELETE var ARROW '{' field_name '}' | ||
| 642 | |||
| 643 | caller | ||
| 644 | : CALLER | ||
| 645 | | CALLER operator | ||
| 646 | |||
| 647 | break_point | ||
| 648 | : BREAK_POINT | ||
| 649 | |||
| 650 | =head2 Grammer Token | ||
| 651 | |||
| 652 | These are tokens for L<grammer/"Grammer">. | ||
| 653 | |||
| 654 | =begin html | ||
| 655 | |||
| 656 | <table> | ||
| 657 | <tr> | ||
| 658 | <th>Tokens</td><th>Token Values</th> | ||
| 659 | </tr> | ||
| 660 | <tr> | ||
| 661 | <td>ADDRESS</td><td>address</td> | ||
| 662 | </tr> | ||
| 663 | <tr> | ||
| 664 | <td>ALIAS</td><td>alias</td> | ||
| 665 | </tr> | ||
| 666 | <tr> | ||
| 667 | <td>ALLOW</td><td>allow</td> | ||
| 668 | </tr> | ||
| 669 | <tr> | ||
| 670 | <td>ARROW</td><td>-></td> | ||
| 671 | </tr> | ||
| 672 | <tr> | ||
| 673 | <td>AS</td><td>as</td> | ||
| 674 | </tr> | ||
| 675 | <tr> | ||
| 676 | <td>ASSIGN</td><td>=</td> | ||
| 677 | </tr> | ||
| 678 | <tr> | ||
| 679 | <td>ATTRIBUTE</td><td>An attribute name</td> | ||
| 680 | </tr> | ||
| 681 | <tr> | ||
| 682 | <td>BIT_AND</td><td>&</td> | ||
| 683 | </tr> | ||
| 684 | <tr> | ||
| 685 | <td>BASIC_TYPE_ID</td><td>basic_type_id</td> | ||
| 686 | </tr> | ||
| 687 | <tr> | ||
| 688 | <td>BREAK_POINT</td><td>break_point</td> | ||
| 689 | </tr> | ||
| 690 | <tr> | ||
| 691 | <td>BIT_NOT</td><td>~</td> | ||
| 692 | </tr> | ||
| 693 | <tr> | ||
| 694 | <td>BIT_OR</td><td>|</td> | ||
| 695 | </tr> | ||
| 696 | <tr> | ||
| 697 | <td>BIT_XOR</td><td>^</td> | ||
| 698 | </tr> | ||
| 699 | <tr> | ||
| 700 | <td>BREAK</td><td>break</td> | ||
| 701 | </tr> | ||
| 702 | <tr> | ||
| 703 | <td>BYTE</td><td>byte</td> | ||
| 704 | </tr> | ||
| 705 | <tr> | ||
| 706 | <td>CAPACITY</td><td>capacity</td> | ||
| 707 | </tr> | ||
| 708 | <tr> | ||
| 709 | <td>CALLER</td><td>caller</td> | ||
| 710 | </tr> | ||
| 711 | <tr> | ||
| 712 | <td>CASE</td><td>case</td> | ||
| 713 | </tr> | ||
| 714 | <tr> | ||
| 715 | <td>CLASS</td><td>class</td> | ||
| 716 | </tr> | ||
| 717 | <tr> | ||
| 718 | <td>VAR_NAME</td><td>A variable name</td> | ||
| 719 | </tr> | ||
| 720 | <tr> | ||
| 721 | <td>COMPILE_TYPE_NAME</td><td>compile_type_name</td> | ||
| 722 | </tr> | ||
| 723 | <tr> | ||
| 724 | <td>CONSTANT</td><td>A literal</td> | ||
| 725 | </tr> | ||
| 726 | <tr> | ||
| 727 | <td>CONVERT</td><td>(TYPE_NAME)</td> | ||
| 728 | </tr> | ||
| 729 | <tr> | ||
| 730 | <td>COPY</td><td>copy</td> | ||
| 731 | </tr> | ||
| 732 | <tr> | ||
| 733 | <td>COPY_FIELDS</td><td>copy_fields</td> | ||
| 734 | </tr> | ||
| 735 | <tr> | ||
| 736 | <td>OUTMOST_CLASS</td><td>&</td> | ||
| 737 | </tr> | ||
| 738 | <tr> | ||
| 739 | <td>OUTMOST_CLASS_NAME</td><td>__PACKAGE__</td> | ||
| 740 | </tr> | ||
| 741 | <tr> | ||
| 742 | <td>DEC</td><td>--</td> | ||
| 743 | </tr> | ||
| 744 | <tr> | ||
| 745 | <td>DEFAULT</td><td>default</td> | ||
| 746 | </tr> | ||
| 747 | <tr> | ||
| 748 | <td>DELETE</td><td>delete</td> | ||
| 749 | </tr> | ||
| 750 | <tr> | ||
| 751 | <td>DEREFERENCE</td><td>$</td> | ||
| 752 | </tr> | ||
| 753 | <tr> | ||
| 754 | <td>DIAG</td><td>diag</td> | ||
| 755 | </tr> | ||
| 756 | <tr> | ||
| 757 | <td>DIE</td><td>die</td> | ||
| 758 | </tr> | ||
| 759 | <tr> | ||
| 760 | <td>DISABLE_OPTIONS</td><td>disable_options</td> | ||
| 761 | </tr> | ||
| 762 | <tr> | ||
| 763 | <td>DIVIDE</td><td>/</td> | ||
| 764 | </tr> | ||
| 765 | <tr> | ||
| 766 | <td>DIVIDE_UNSIGNED_INT</td><td>div_uint</td> | ||
| 767 | </tr> | ||
| 768 | <tr> | ||
| 769 | <td>DIVIDE_UNSIGNED_LONG</td><td>div_ulong</td> | ||
| 770 | </tr> | ||
| 771 | <tr> | ||
| 772 | <td>DOUBLE</td><td>double</td> | ||
| 773 | </tr> | ||
| 774 | <tr> | ||
| 775 | <td>DUMP</td><td>dump</td> | ||
| 776 | </tr> | ||
| 777 | <tr> | ||
| 778 | <td>ELEMENT</td><td>element</td> | ||
| 779 | </tr> | ||
| 780 | <tr> | ||
| 781 | <td>ELSE</td><td>else</td> | ||
| 782 | </tr> | ||
| 783 | <tr> | ||
| 784 | <td>ELSIF</td><td>elsif</td> | ||
| 785 | </tr> | ||
| 786 | <tr> | ||
| 787 | <td>ENABLE_OPTIONS</td><td>enable_options</td> | ||
| 788 | </tr> | ||
| 789 | <tr> | ||
| 790 | <td>END_OF_FILE</td><td>The end of the file</td> | ||
| 791 | </tr> | ||
| 792 | <tr> | ||
| 793 | <td>ENUM</td><td>enum</td> | ||
| 794 | </tr> | ||
| 795 | <tr> | ||
| 796 | <td>EVAL_ERROR_ID</td><td>eval_error_id</td> | ||
| 797 | </tr> | ||
| 798 | <tr> | ||
| 799 | <td>EVAL_ERROR_NAME</td><td>eval_error_name</td> | ||
| 800 | </tr> | ||
| 801 | <tr> | ||
| 802 | <td>EXTENDS</td><td>extends</td> | ||
| 803 | </tr> | ||
| 804 | <tr> | ||
| 805 | <td>EVAL</td><td>eval</td> | ||
| 806 | </tr> | ||
| 807 | <tr> | ||
| 808 | <td>EXCEPTION_VAR</td><td>$@</td> | ||
| 809 | </tr> | ||
| 810 | <tr> | ||
| 811 | <td>EXISTS</td><td>exists</td> | ||
| 812 | </tr> | ||
| 813 | <tr> | ||
| 814 | <td>FATCAMMA</td><td>=></td> | ||
| 815 | </tr> | ||
| 816 | <tr> | ||
| 817 | <td>FLOAT</td><td>float</td> | ||
| 818 | </tr> | ||
| 819 | <tr> | ||
| 820 | <td>FOR</td><td>for</td> | ||
| 821 | </tr> | ||
| 822 | <tr> | ||
| 823 | <td>GET</td><td>get</td> | ||
| 824 | </tr> | ||
| 825 | <tr> | ||
| 826 | <td>HAS</td><td>has</td> | ||
| 827 | </tr> | ||
| 828 | <tr> | ||
| 829 | <td>CAN</td><td>can</td> | ||
| 830 | </tr> | ||
| 831 | <tr> | ||
| 832 | <td>IF</td><td>if</td> | ||
| 833 | </tr> | ||
| 834 | <tr> | ||
| 835 | <td>INTERFACE</td><td>interface</td> | ||
| 836 | </tr> | ||
| 837 | <tr> | ||
| 838 | <td>INC</td><td>++</td> | ||
| 839 | </tr> | ||
| 840 | <tr> | ||
| 841 | <td>INIT</td><td>INIT</td> | ||
| 842 | </tr> | ||
| 843 | <tr> | ||
| 844 | <td>INT</td><td>int</td> | ||
| 845 | </tr> | ||
| 846 | <tr> | ||
| 847 | <td>ISA</td><td>isa</td> | ||
| 848 | </tr> | ||
| 849 | <tr> | ||
| 850 | <td>ISWEAK</td><td>isweak</td> | ||
| 851 | </tr> | ||
| 852 | <tr> | ||
| 853 | <td>IS_TYPE</td><td>is_type</td> | ||
| 854 | </tr> | ||
| 855 | <tr> | ||
| 856 | <td>IS_OPTIONS</td><td>is_options</td> | ||
| 857 | </tr> | ||
| 858 | <tr> | ||
| 859 | <td>IS_FIXED_LENGTH</td><td>is_fixed_length</td> | ||
| 860 | </tr> | ||
| 861 | <tr> | ||
| 862 | <td>IS_READ_ONLY</td><td>is_read_only</td> | ||
| 863 | </tr> | ||
| 864 | <tr> | ||
| 865 | <td>LAST</td><td>last</td> | ||
| 866 | </tr> | ||
| 867 | <tr> | ||
| 868 | <td>LENGTH</td><td>length</td> | ||
| 869 | </tr> | ||
| 870 | <tr> | ||
| 871 | <td>LOGICAL_AND</td><td>&&</td> | ||
| 872 | </tr> | ||
| 873 | <tr> | ||
| 874 | <td>LOGICAL_NOT</td><td>!</td> | ||
| 875 | </tr> | ||
| 876 | <tr> | ||
| 877 | <td>LOGICAL_OR</td><td>||</td> | ||
| 878 | </tr> | ||
| 879 | <tr> | ||
| 880 | <td>DEFINED_OR</td><td>//</td> | ||
| 881 | </tr> | ||
| 882 | <tr> | ||
| 883 | <td>LONG</td><td>long</td> | ||
| 884 | </tr> | ||
| 885 | <tr> | ||
| 886 | <td>MAKE_FIXED_LENGTH</td><td>make_fixed_length</td> | ||
| 887 | </tr> | ||
| 888 | <tr> | ||
| 889 | <td>MAKE_READ_ONLY</td><td>make_read_only</td> | ||
| 890 | </tr> | ||
| 891 | <tr> | ||
| 892 | <td>METHOD</td><td>method</td> | ||
| 893 | </tr> | ||
| 894 | <tr> | ||
| 895 | <td>MINUS</td><td>-</td> | ||
| 896 | </tr> | ||
| 897 | <tr> | ||
| 898 | <td>MUTABLE</td><td>mutable</td> | ||
| 899 | </tr> | ||
| 900 | <tr> | ||
| 901 | <td>MY</td><td>my</td> | ||
| 902 | </tr> | ||
| 903 | <tr> | ||
| 904 | <td>NEW</td><td>new</td> | ||
| 905 | </tr> | ||
| 906 | <tr> | ||
| 907 | <td>NEW_STRING_LEN</td><td>new_string_len</td> | ||
| 908 | </tr> | ||
| 909 | <tr> | ||
| 910 | <td>OF</td><td>of</td> | ||
| 911 | </tr> | ||
| 912 | <tr> | ||
| 913 | <td>NEXT</td><td>next</td> | ||
| 914 | </tr> | ||
| 915 | <tr> | ||
| 916 | <td>NUMEQ</td><td>==</td> | ||
| 917 | </tr> | ||
| 918 | <tr> | ||
| 919 | <td>NUMERIC_CMP</td><td><=></td> | ||
| 920 | </tr> | ||
| 921 | <tr> | ||
| 922 | <td>NUMGE</td><td>>=</td> | ||
| 923 | </tr> | ||
| 924 | <tr> | ||
| 925 | <td>NUMGT</td><td>></td> | ||
| 926 | </tr> | ||
| 927 | <tr> | ||
| 928 | <td>NUMLE</td><td><=</td> | ||
| 929 | </tr> | ||
| 930 | <tr> | ||
| 931 | <td>NUMLT</td><td><</td> | ||
| 932 | </tr> | ||
| 933 | <tr> | ||
| 934 | <td>NUMNE</td><td>!=</td> | ||
| 935 | </tr> | ||
| 936 | <tr> | ||
| 937 | <td>OBJECT</td><td>object</td> | ||
| 938 | </tr> | ||
| 939 | <tr> | ||
| 940 | <td>OUR</td><td>our</td> | ||
| 941 | </tr> | ||
| 942 | <tr> | ||
| 943 | <td>PLUS</td><td>+</td> | ||
| 944 | </tr> | ||
| 945 | <tr> | ||
| 946 | <td>PRINT</td><td>print</td> | ||
| 947 | </tr> | ||
| 948 | <tr> | ||
| 949 | <td>REF</td><td>\</td> | ||
| 950 | </tr> | ||
| 951 | <tr> | ||
| 952 | <td>TYPE_NAME</td><td>type_name</td> | ||
| 953 | </tr> | ||
| 954 | <tr> | ||
| 955 | <td>MODULO</td><td>%</td> | ||
| 956 | </tr> | ||
| 957 | <tr> | ||
| 958 | <td>MODULO_UNSIGNED_INT</td><td>mod_uint</td> | ||
| 959 | </tr> | ||
| 960 | <tr> | ||
| 961 | <td>MODULO_UNSIGNED_LONG</td><td>mod_ulong</td> | ||
| 962 | </tr> | ||
| 963 | <tr> | ||
| 964 | <td>REQUIRE</td><td>require</td> | ||
| 965 | </tr> | ||
| 966 | <tr> | ||
| 967 | <td>RETURN</td><td>return</td> | ||
| 968 | </tr> | ||
| 969 | <tr> | ||
| 970 | <td>RO</td><td>ro</td> | ||
| 971 | </tr> | ||
| 972 | <tr> | ||
| 973 | <td>RW</td><td>rw</td> | ||
| 974 | </tr> | ||
| 975 | <tr> | ||
| 976 | <td>SAY</td><td>say</td> | ||
| 977 | </tr> | ||
| 978 | <tr> | ||
| 979 | <td>SCALAR</td><td>scalar</td> | ||
| 980 | </tr> | ||
| 981 | <tr> | ||
| 982 | <td>SET</td><td>set</td> | ||
| 983 | </tr> | ||
| 984 | <tr> | ||
| 985 | <td>SET_CAPACITY</td><td>set_capacity</td> | ||
| 986 | </tr> | ||
| 987 | <tr> | ||
| 988 | <td>SET_LENGTH</td><td>set_length</td> | ||
| 989 | </tr> | ||
| 990 | <tr> | ||
| 991 | <td>SHIFT</td><td><<<br>>><br>>>></td> | ||
| 992 | </tr> | ||
| 993 | <tr> | ||
| 994 | <td>SHORT</td><td>short</td> | ||
| 995 | </tr> | ||
| 996 | <tr> | ||
| 997 | <td>SPECIAL_ASSIGN</td><td>+=<br>-=<br>*=<br>/=<br>&=<br>|=<br>^=<br>%=<br><<=<br>>>=<br>>>>=<br>.=</td> | ||
| 998 | </tr> | ||
| 999 | <tr> | ||
| 1000 | <td>SRING_CMP</td><td>cmp</td> | ||
| 1001 | </tr> | ||
| 1002 | <tr> | ||
| 1003 | <td>STDERR</td><td>STDERR</td> | ||
| 1004 | </tr> | ||
| 1005 | <tr> | ||
| 1006 | <td>STREQ</td><td>eq</td> | ||
| 1007 | </tr> | ||
| 1008 | <tr> | ||
| 1009 | <td>STRGE</td><td>ge</td> | ||
| 1010 | </tr> | ||
| 1011 | <tr> | ||
| 1012 | <td>STRGT</td><td>gt</td> | ||
| 1013 | </tr> | ||
| 1014 | <tr> | ||
| 1015 | <td>STRING</td><td>string</td> | ||
| 1016 | </tr> | ||
| 1017 | <tr> | ||
| 1018 | <td>STRLE</td><td>le</td> | ||
| 1019 | </tr> | ||
| 1020 | <tr> | ||
| 1021 | <td>STRLT</td><td>lt</td> | ||
| 1022 | </tr> | ||
| 1023 | <tr> | ||
| 1024 | <td>STRNE</td><td>ne</td> | ||
| 1025 | </tr> | ||
| 1026 | <tr> | ||
| 1027 | <td>SYMBOL_NAME</td><td>A symbol name</td> | ||
| 1028 | </tr> | ||
| 1029 | <tr> | ||
| 1030 | <td>SWITCH</td><td>switch</td> | ||
| 1031 | </tr> | ||
| 1032 | <tr> | ||
| 1033 | <td>UNDEF</td><td>undef</td> | ||
| 1034 | </tr> | ||
| 1035 | <tr> | ||
| 1036 | <td>UNLESS</td><td>unless</td> | ||
| 1037 | </tr> | ||
| 1038 | <tr> | ||
| 1039 | <td>UNWEAKEN</td><td>unweaken</td> | ||
| 1040 | </tr> | ||
| 1041 | <tr> | ||
| 1042 | <td>USE</td><td>use</td> | ||
| 1043 | </tr> | ||
| 1044 | <tr> | ||
| 1045 | <td>VAR</td><td>var</td> | ||
| 1046 | </tr> | ||
| 1047 | <tr> | ||
| 1048 | <td>VERSION</td><td>version</td> | ||
| 1049 | </tr> | ||
| 1050 | <tr> | ||
| 1051 | <td>VERSION_FROM</td><td>version_from</td> | ||
| 1052 | </tr> | ||
| 1053 | <tr> | ||
| 1054 | <td>VOID</td><td>void</td> | ||
| 1055 | </tr> | ||
| 1056 | <tr> | ||
| 1057 | <td>WARN</td><td>warn</td> | ||
| 1058 | </tr> | ||
| 1059 | <tr> | ||
| 1060 | <td>WARN_LEVEL</td><td>warn_level</td> | ||
| 1061 | </tr> | ||
| 1062 | <tr> | ||
| 1063 | <td>WEAKEN</td><td>weaken</td> | ||
| 1064 | </tr> | ||
| 1065 | <tr> | ||
| 1066 | <td>WHILE</td><td>while</td> | ||
| 1067 | </tr> | ||
| 1068 | <tr> | ||
| 1069 | <td>WO</td><td>wo</td> | ||
| 1070 | </tr> | ||
| 1071 | </table> | ||
| 1072 | |||
| 1073 | =end html | ||
| 1074 | |||
| 1075 | =head2 Operator Precidence | ||
| 1076 | |||
| 1077 | The operator precidence in the SPVM language is described using L<GNU Bison|https://en.wikipedia.org/wiki/GNU_Bison> syntax. | ||
| 1078 | |||
| 1079 | The bottom is the highest precidence and the top is the lowest precidence. | ||
| 1080 | |||
| 1081 | %left <opval> ',' FATCAMMA | ||
| 1082 | %right <opval> ASSIGN SPECIAL_ASSIGN | ||
| 1083 | %right <oval> '?' ':' | ||
| 1084 | %left <opval> LOGICAL_OR DEFINED_OR | ||
| 1085 | %left <opval> LOGICAL_AND | ||
| 1086 | %left <opval> BIT_OR BIT_XOR | ||
| 1087 | %left <opval> BIT_AND | ||
| 1088 | %nonassoc <opval> NUMEQ NUMNE STREQ STRNE | ||
| 1089 | %nonassoc <opval> NUMGT NUMGE NUMLT NUMLE STRGT STRGE STRLT STRLE ISA ISA_ERROR IS_TYPE IS_ERROR IS_COMPILE_TYPE NUMERIC_CMP STRING_CMP CAN | ||
| 1090 | %left <opval> SHIFT | ||
| 1091 | %left <opval> '+' '-' '.' | ||
| 1092 | %left <opval> '*' DIVIDE DIVIDE_UNSIGNED_INT DIVIDE_UNSIGNED_LONG MODULO MODULO_UNSIGNED_INT MODULO_UNSIGNED_LONG | ||
| 1093 | %right <opval> LOGICAL_NOT BIT_NOT '@' REFERENCE DEREFERENCE PLUS MINUS CONVERT SCALAR STRING_LENGTH ISWEAK TYPE_NAME COMPILE_TYPE_NAME DUMP NEW_STRING_LEN IS_READ_ONLY COPY | ||
| 1094 | %nonassoc <opval> INC DEC | ||
| 1095 | %left <opval> ARROW | ||
| 1096 | %nonassoc <opval> ')' | ||
| 1097 | %left <opval> '(' | ||
| 1098 | %left <opval> '[' '{' | ||
| 1099 | |||
| 1100 | The operator precidence can be increased using C<()>. | ||
| 1101 | |||
| 1102 | # a * b is calculated at first | ||
| 1103 | a * b + c | ||
| 1104 | |||
| 1105 | # b + c is calculated at first | ||
| 1106 | a * (b + c) | ||
| 1107 | |||
| 1108 | =head1 See Also | ||
| 1109 | |||
| 1110 | =over 2 | ||
| 1111 | |||
| 1112 | =item * L<SPVM::Document::Language::Tokenization> | ||
| 1113 | |||
| 1114 | =item * L<SPVM::Document::Language> | ||
| 1115 | |||
| 1116 | =item * L<SPVM::Document> | ||
| 1117 | |||
| 1118 | =back | ||
| 1119 | |||
| 1120 | =head1 Copyright & License | ||
| 1121 | |||
| 1122 | Copyright (c) 2023 Yuki Kimoto | ||
| 1123 | |||
| 1124 | MIT License |