Browse Source

Sol Part 42: Now With MORE Logic!

Michael Hrcek 5 years ago
parent
commit
cdb282f445
4 changed files with 219 additions and 147 deletions
  1. 198
    142
      lex.yy.c
  2. 3
    3
      parser.tab.c
  3. 2
    2
      parser.tab.h
  4. 16
    0
      tokenizer.lex

+ 198
- 142
lex.yy.c View File

@@ -369,8 +369,8 @@ static void yy_fatal_error (yyconst char msg[]  );
369 369
 	*yy_cp = '\0'; \
370 370
 	(yy_c_buf_p) = yy_cp;
371 371
 
372
-#define YY_NUM_RULES 63
373
-#define YY_END_OF_BUFFER 64
372
+#define YY_NUM_RULES 71
373
+#define YY_END_OF_BUFFER 72
374 374
 /* This struct is not used in this scanner,
375 375
    but its presence is necessary. */
376 376
 struct yy_trans_info
@@ -378,21 +378,24 @@ struct yy_trans_info
378 378
 	flex_int32_t yy_verify;
379 379
 	flex_int32_t yy_nxt;
380 380
 	};
381
-static yyconst flex_int16_t yy_accept[119] =
381
+static yyconst flex_int16_t yy_accept[146] =
382 382
     {   0,
383
-        0,    0,   64,   63,   62,   31,   63,   59,   23,   25,
384
-       63,   53,   54,   21,   19,   58,   20,   55,   22,    2,
385
-       56,   57,   43,   32,   44,   60,   60,   51,   52,   27,
386
-       60,   60,   60,   60,   60,   60,   60,   60,   60,   60,
387
-       49,   26,   50,   28,   62,   42,    0,    3,   29,   38,
388
-        0,    4,   24,   35,   33,    0,   34,   36,    1,    2,
389
-       48,   45,   41,   46,   47,   60,   60,   40,   60,   60,
390
-       11,   60,   60,   60,   60,    5,   10,   60,   60,   60,
391
-       60,   39,   30,   37,    0,   61,    1,   60,   60,   60,
392
-       60,   17,    9,   60,   60,   60,   60,   60,   18,   60,
393
-
394
-       60,    7,   12,   60,   60,    6,   60,   15,   60,   60,
395
-       60,    8,   60,   13,   14,   60,   16,    0
383
+        0,    0,   72,   71,   70,   34,   71,   67,   23,   26,
384
+       71,   61,   62,   21,   19,   66,   20,   63,   22,    2,
385
+       64,   65,   51,   40,   52,   68,   68,   68,   68,   59,
386
+       60,   28,   68,   68,   68,   68,   68,   68,   68,   68,
387
+       68,   68,   68,   68,   68,   68,   57,   27,   58,   29,
388
+       70,   50,    0,    3,   30,   46,    0,    4,   25,   43,
389
+       41,    0,   42,   44,    1,    2,   56,   53,   49,   54,
390
+       55,   68,   68,   68,   68,   48,   68,   68,   68,   11,
391
+       68,   68,   68,   68,   68,    5,   10,   68,   68,   68,
392
+       33,   68,   68,   68,   68,   47,   32,   45,    0,   69,
393
+
394
+        1,   68,   68,   68,   31,   68,   68,   68,   17,   68,
395
+        9,   68,   68,   24,   35,   68,   68,   68,   68,   68,
396
+       18,   37,   68,   68,    7,   68,   12,   68,   68,    6,
397
+       36,   68,   39,   15,   68,   38,   68,   68,    8,   68,
398
+       13,   14,   68,   16,    0
396 399
     } ;
397 400
 
398 401
 static yyconst flex_int32_t yy_ec[256] =
@@ -403,14 +406,14 @@ static yyconst flex_int32_t yy_ec[256] =
403 406
         1,    2,    4,    5,    6,    1,    7,    8,    9,   10,
404 407
        11,   12,   13,   14,   15,   16,   17,   18,   18,   18,
405 408
        18,   18,   18,   18,   18,   18,   18,   19,   20,   21,
406
-       22,   23,    1,    1,   24,   24,   24,   24,   24,   24,
407
-       24,   24,   24,   24,   24,   24,   24,   25,   24,   24,
408
-       24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
409
-       26,    1,   27,   28,   24,    1,   29,   30,   31,   32,
410
-
411
-       33,   34,   24,   35,   36,   24,   37,   38,   39,   40,
412
-       41,   24,   24,   42,   43,   44,   45,   24,   46,   24,
413
-       24,   24,   47,   48,   49,   50,    1,    1,    1,    1,
409
+       22,   23,    1,    1,   24,   24,   24,   24,   24,   25,
410
+       24,   24,   24,   24,   24,   24,   24,   26,   24,   24,
411
+       24,   24,   24,   27,   24,   24,   24,   24,   24,   24,
412
+       28,    1,   29,   30,   24,    1,   31,   32,   33,   34,
413
+
414
+       35,   36,   24,   37,   38,   24,   39,   40,   41,   42,
415
+       43,   24,   24,   44,   45,   46,   47,   24,   48,   24,
416
+       24,   24,   49,   50,   51,   52,    1,    1,    1,    1,
414 417
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
415 418
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
416 419
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -427,97 +430,110 @@ static yyconst flex_int32_t yy_ec[256] =
427 430
         1,    1,    1,    1,    1
428 431
     } ;
429 432
 
430
-static yyconst flex_int32_t yy_meta[51] =
433
+static yyconst flex_int32_t yy_meta[53] =
431 434
     {   0,
432 435
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
433 436
         1,    1,    1,    1,    1,    1,    1,    2,    1,    1,
434
-        1,    1,    1,    2,    2,    1,    1,    1,    2,    2,
437
+        1,    1,    1,    2,    2,    2,    2,    1,    1,    1,
435 438
         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
436
-        2,    2,    2,    2,    2,    2,    1,    1,    1,    1
439
+        2,    2,    2,    2,    2,    2,    2,    2,    1,    1,
440
+        1,    1
437 441
     } ;
438 442
 
439
-static yyconst flex_int16_t yy_base[123] =
443
+static yyconst flex_int16_t yy_base[150] =
440 444
     {   0,
441
-        0,    0,  136,  137,   49,  113,  129,  137,  137,   45,
442
-      124,  137,  137,   42,  110,  137,   40,  137,  109,   40,
443
-      137,  137,   38,  108,   43,    0,   88,  137,  137,  106,
444
-       85,   85,   84,   23,   27,   35,   95,   90,   87,   86,
445
-      137,   35,  137,  137,   68,  137,  115,  137,  137,  137,
446
-      110,  137,   96,  137,  137,  114,  137,  137,   98,   58,
447
-      137,  137,  137,  137,  137,    0,   75,  137,   81,   73,
448
-        0,   69,   79,   68,   69,    0,    0,   69,   63,   73,
449
-       69,  137,  137,  137,  101,  137,   85,   69,   72,   56,
450
-       66,    0,    0,   67,   67,   51,   55,   56,    0,   56,
451
-
452
-       56,    0,    0,   59,   48,    0,   49,    0,   41,   51,
453
-       39,    0,   33,    0,    0,   44,    0,  137,   83,   85,
454
-       71,   87
445
+        0,    0,  159,  160,   51,  136,  152,  160,  160,   47,
446
+      147,  160,  160,   44,  133,  160,   42,  160,  132,   42,
447
+      160,  160,   40,  131,   45,    0,  121,  108,  106,  160,
448
+      160,  127,  106,  103,  103,  102,   23,   28,   34,  113,
449
+      100,   99,   97,  105,   35,  102,  160,   51,  160,  160,
450
+       75,  160,  133,  160,  160,  160,  128,  160,  114,  160,
451
+      160,  132,  160,  160,  116,   64,  160,  160,  160,  160,
452
+      160,    0,   93,   90,   84,  160,   96,   94,   86,    0,
453
+       82,   92,   85,   80,   81,    0,    0,   81,   87,   74,
454
+        0,   73,   83,   70,   78,  160,  160,  160,  112,  160,
455
+
456
+       96,   68,   77,   76,    0,   79,   63,   73,    0,   55,
457
+        0,   66,   66,    0,    0,   50,   54,   60,   54,   58,
458
+        0,    0,   53,   53,    0,   55,    0,   55,   44,    0,
459
+        0,   52,    0,    0,   44,    0,   54,   42,    0,   36,
460
+        0,    0,   46,    0,  160,  101,  103,   72,  105
455 461
     } ;
456 462
 
457
-static yyconst flex_int16_t yy_def[123] =
463
+static yyconst flex_int16_t yy_def[150] =
458 464
     {   0,
459
-      118,    1,  118,  118,  118,  118,  119,  118,  118,  118,
460
-      120,  118,  118,  118,  118,  118,  118,  118,  118,  118,
461
-      118,  118,  118,  118,  118,  121,  121,  118,  118,  118,
462
-      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
463
-      118,  118,  118,  118,  118,  118,  119,  118,  118,  118,
464
-      120,  118,  118,  118,  118,  122,  118,  118,  118,  118,
465
-      118,  118,  118,  118,  118,  121,  121,  118,  121,  121,
466
-      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
467
-      121,  118,  118,  118,  122,  118,  118,  121,  121,  121,
468
-      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
469
-
470
-      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
471
-      121,  121,  121,  121,  121,  121,  121,    0,  118,  118,
472
-      118,  118
465
+      145,    1,  145,  145,  145,  145,  146,  145,  145,  145,
466
+      147,  145,  145,  145,  145,  145,  145,  145,  145,  145,
467
+      145,  145,  145,  145,  145,  148,  148,  148,  148,  145,
468
+      145,  145,  148,  148,  148,  148,  148,  148,  148,  148,
469
+      148,  148,  148,  148,  148,  148,  145,  145,  145,  145,
470
+      145,  145,  146,  145,  145,  145,  147,  145,  145,  145,
471
+      145,  149,  145,  145,  145,  145,  145,  145,  145,  145,
472
+      145,  148,  148,  148,  148,  145,  148,  148,  148,  148,
473
+      148,  148,  148,  148,  148,  148,  148,  148,  148,  148,
474
+      148,  148,  148,  148,  148,  145,  145,  145,  149,  145,
475
+
476
+      145,  148,  148,  148,  148,  148,  148,  148,  148,  148,
477
+      148,  148,  148,  148,  148,  148,  148,  148,  148,  148,
478
+      148,  148,  148,  148,  148,  148,  148,  148,  148,  148,
479
+      148,  148,  148,  148,  148,  148,  148,  148,  148,  148,
480
+      148,  148,  148,  148,    0,  145,  145,  145,  145
473 481
     } ;
474 482
 
475
-static yyconst flex_int16_t yy_nxt[188] =
483
+static yyconst flex_int16_t yy_nxt[213] =
476 484
     {   0,
477 485
         4,    5,    5,    6,    7,    8,    9,   10,   11,   12,
478 486
        13,   14,   15,   16,   17,   18,   19,   20,   21,   22,
479
-       23,   24,   25,   26,   27,   28,   29,   30,   26,   31,
480
-       32,   33,   34,   35,   26,   36,   26,   37,   26,   26,
481
-       26,   38,   26,   39,   26,   40,   41,   42,   43,   44,
482
-       45,   45,   49,   53,   56,   59,   82,   60,   61,   62,
483
-       72,   57,   73,   54,   64,   65,   50,   74,   76,   45,
484
-       45,   75,   66,   59,   77,   60,  117,  116,  115,  114,
485
-      113,  112,   83,   47,   47,   51,   51,   85,   85,  111,
486
-      110,  109,  108,  107,  106,  105,  104,  103,  102,  101,
487
-
488
-      100,   99,   87,   86,   98,   97,   96,   95,   94,   93,
489
-       92,   91,   90,   89,   88,   87,   86,   84,   52,   48,
490
-       81,   80,   79,   78,   71,   70,   69,   68,   67,   63,
491
-       58,   55,   52,   48,   46,  118,    3,  118,  118,  118,
492
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
493
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
494
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
495
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
496
-      118,  118,  118,  118,  118,  118,  118
487
+       23,   24,   25,   26,   27,   28,   29,   30,   31,   32,
488
+       33,   34,   35,   36,   37,   38,   26,   39,   26,   40,
489
+       41,   42,   43,   44,   26,   45,   26,   46,   47,   48,
490
+       49,   50,   51,   51,   55,   59,   62,   65,   83,   66,
491
+       67,   68,   81,   63,   82,   60,   70,   71,   56,   86,
492
+       84,   93,   96,   72,   85,   87,   51,   51,   94,   65,
493
+      144,   66,  143,  142,  141,  140,  139,  138,  137,  136,
494
+      135,  134,  133,  132,  131,  130,  129,  128,  127,  126,
495
+
496
+       97,   53,   53,   57,   57,   99,   99,  125,  124,  123,
497
+      122,  121,  120,  101,  100,  119,  118,  117,  116,  115,
498
+      114,  113,  112,  111,  110,  109,  108,  107,  106,  105,
499
+      104,  103,  102,  101,  100,   98,   58,   54,   95,   92,
500
+       91,   90,   89,   88,   80,   79,   78,   77,   76,   75,
501
+       74,   73,   69,   64,   61,   58,   54,   52,  145,    3,
502
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
503
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
504
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
505
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
506
+
507
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
508
+      145,  145
497 509
     } ;
498 510
 
499
-static yyconst flex_int16_t yy_chk[188] =
511
+static yyconst flex_int16_t yy_chk[213] =
500 512
     {   0,
501 513
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
502 514
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
503 515
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
504 516
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
505 517
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
506
-        5,    5,   10,   14,   17,   20,   42,   20,   23,   23,
507
-       34,   17,   34,   14,   25,   25,   10,   35,   36,   45,
508
-       45,   35,  121,   60,   36,   60,  116,  113,  111,  110,
509
-      109,  107,   42,  119,  119,  120,  120,  122,  122,  105,
510
-      104,  101,  100,   98,   97,   96,   95,   94,   91,   90,
511
-
512
-       89,   88,   87,   85,   81,   80,   79,   78,   75,   74,
513
-       73,   72,   70,   69,   67,   59,   56,   53,   51,   47,
514
-       40,   39,   38,   37,   33,   32,   31,   30,   27,   24,
515
-       19,   15,   11,    7,    6,    3,  118,  118,  118,  118,
516
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
517
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
518
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
519
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
520
-      118,  118,  118,  118,  118,  118,  118
518
+        1,    1,    5,    5,   10,   14,   17,   20,   38,   20,
519
+       23,   23,   37,   17,   37,   14,   25,   25,   10,   39,
520
+       38,   45,   48,  148,   38,   39,   51,   51,   45,   66,
521
+      143,   66,  140,  138,  137,  135,  132,  129,  128,  126,
522
+      124,  123,  120,  119,  118,  117,  116,  113,  112,  110,
523
+
524
+       48,  146,  146,  147,  147,  149,  149,  108,  107,  106,
525
+      104,  103,  102,  101,   99,   95,   94,   93,   92,   90,
526
+       89,   88,   85,   84,   83,   82,   81,   79,   78,   77,
527
+       75,   74,   73,   65,   62,   59,   57,   53,   46,   44,
528
+       43,   42,   41,   40,   36,   35,   34,   33,   32,   29,
529
+       28,   27,   24,   19,   15,   11,    7,    6,    3,  145,
530
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
531
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
532
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
533
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
534
+
535
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
536
+      145,  145
521 537
     } ;
522 538
 
523 539
 static yy_state_type yy_last_accepting_state;
@@ -609,7 +625,7 @@ static void update_loc(YYLTYPE *yylloc, char *yytext){
609 625
 <STRING>. { str_putc(*yytext); }
610 626
 
611 627
 */
612
-#line 613 "lex.yy.c"
628
+#line 629 "lex.yy.c"
613 629
 
614 630
 #define INITIAL 0
615 631
 
@@ -844,7 +860,7 @@ YY_DECL
844 860
 #line 85 "tokenizer.lex"
845 861
 
846 862
 
847
-#line 848 "lex.yy.c"
863
+#line 864 "lex.yy.c"
848 864
 
849 865
 	while ( 1 )		/* loops until end-of-file is reached */
850 866
 		{
@@ -871,13 +887,13 @@ yy_match:
871 887
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
872 888
 				{
873 889
 				yy_current_state = (int) yy_def[yy_current_state];
874
-				if ( yy_current_state >= 119 )
890
+				if ( yy_current_state >= 146 )
875 891
 					yy_c = yy_meta[(unsigned int) yy_c];
876 892
 				}
877 893
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
878 894
 			++yy_cp;
879 895
 			}
880
-		while ( yy_base[yy_current_state] != 137 );
896
+		while ( yy_base[yy_current_state] != 160 );
881 897
 
882 898
 yy_find_action:
883 899
 		yy_act = yy_accept[yy_current_state];
@@ -1021,206 +1037,246 @@ YY_RULE_SETUP
1021 1037
 case 24:
1022 1038
 YY_RULE_SETUP
1023 1039
 #line 133 "tokenizer.lex"
1024
-{ return DSTAR; }
1040
+{ return PERCENT; }
1025 1041
 	YY_BREAK
1026 1042
 case 25:
1027 1043
 YY_RULE_SETUP
1028 1044
 #line 135 "tokenizer.lex"
1029
-{ return BAND; }
1045
+{ return DSTAR; }
1030 1046
 	YY_BREAK
1031 1047
 case 26:
1032 1048
 YY_RULE_SETUP
1033 1049
 #line 137 "tokenizer.lex"
1034
-{ return BOR; }
1050
+{ return BAND; }
1035 1051
 	YY_BREAK
1036 1052
 case 27:
1037 1053
 YY_RULE_SETUP
1038 1054
 #line 139 "tokenizer.lex"
1039
-{ return BXOR; }
1055
+{ return BOR; }
1040 1056
 	YY_BREAK
1041 1057
 case 28:
1042 1058
 YY_RULE_SETUP
1043 1059
 #line 141 "tokenizer.lex"
1044
-{ return BNOT; }
1060
+{ return BXOR; }
1045 1061
 	YY_BREAK
1046 1062
 case 29:
1047 1063
 YY_RULE_SETUP
1048 1064
 #line 143 "tokenizer.lex"
1049
-{ return LAND; }
1065
+{ return BNOT; }
1050 1066
 	YY_BREAK
1051 1067
 case 30:
1052 1068
 YY_RULE_SETUP
1053 1069
 #line 145 "tokenizer.lex"
1054
-{ return LOR; }
1070
+{ return LAND; }
1055 1071
 	YY_BREAK
1056 1072
 case 31:
1057 1073
 YY_RULE_SETUP
1058 1074
 #line 147 "tokenizer.lex"
1059
-{ return LNOT; }
1075
+{ return LAND; }
1060 1076
 	YY_BREAK
1061 1077
 case 32:
1062 1078
 YY_RULE_SETUP
1063 1079
 #line 149 "tokenizer.lex"
1064
-{ return ASSIGN; }
1080
+{ return LOR; }
1065 1081
 	YY_BREAK
1066 1082
 case 33:
1067 1083
 YY_RULE_SETUP
1068 1084
 #line 151 "tokenizer.lex"
1069
-{ return ASSIGNPLUS; }
1085
+{ return LOR; }
1070 1086
 	YY_BREAK
1071 1087
 case 34:
1072 1088
 YY_RULE_SETUP
1073 1089
 #line 153 "tokenizer.lex"
1074
-{ return ASSIGNMINUS; }
1090
+{ return LNOT; }
1075 1091
 	YY_BREAK
1076 1092
 case 35:
1077 1093
 YY_RULE_SETUP
1078 1094
 #line 155 "tokenizer.lex"
1079
-{ return ASSIGNSTAR; }
1095
+{ return LNOT; }
1080 1096
 	YY_BREAK
1081 1097
 case 36:
1082 1098
 YY_RULE_SETUP
1083 1099
 #line 157 "tokenizer.lex"
1084
-{ return ASSIGNSLASH; }
1100
+{ *yylval = malloc(sizeof(long)); *((long *) *yylval) = 1; return INT;  }
1085 1101
 	YY_BREAK
1086 1102
 case 37:
1087 1103
 YY_RULE_SETUP
1088 1104
 #line 159 "tokenizer.lex"
1089
-{ return ASSIGNDSTAR; }
1105
+{ *yylval = malloc(sizeof(long)); *((long *) *yylval) = 1; return INT;  }
1090 1106
 	YY_BREAK
1091 1107
 case 38:
1092 1108
 YY_RULE_SETUP
1093 1109
 #line 161 "tokenizer.lex"
1094
-{ return ASSIGNBAND; }
1110
+{ *yylval = malloc(sizeof(long)); *((long *) *yylval) = 0; return INT;  }
1095 1111
 	YY_BREAK
1096 1112
 case 39:
1097 1113
 YY_RULE_SETUP
1098 1114
 #line 163 "tokenizer.lex"
1099
-{ return ASSIGNBOR; }
1115
+{ *yylval = malloc(sizeof(long)); *((long *) *yylval) = 0; return INT;  }
1100 1116
 	YY_BREAK
1101 1117
 case 40:
1102 1118
 YY_RULE_SETUP
1103 1119
 #line 165 "tokenizer.lex"
1104
-{ return ASSIGNBXOR; }
1120
+{ return ASSIGN; }
1105 1121
 	YY_BREAK
1106 1122
 case 41:
1107 1123
 YY_RULE_SETUP
1108 1124
 #line 167 "tokenizer.lex"
1109
-{ return EQUAL; }
1125
+{ return ASSIGNPLUS; }
1110 1126
 	YY_BREAK
1111 1127
 case 42:
1112 1128
 YY_RULE_SETUP
1113 1129
 #line 169 "tokenizer.lex"
1114
-{ return NEQUAL; }
1130
+{ return ASSIGNMINUS; }
1115 1131
 	YY_BREAK
1116 1132
 case 43:
1117 1133
 YY_RULE_SETUP
1118 1134
 #line 171 "tokenizer.lex"
1119
-{ return LESS; }
1135
+{ return ASSIGNSTAR; }
1120 1136
 	YY_BREAK
1121 1137
 case 44:
1122 1138
 YY_RULE_SETUP
1123 1139
 #line 173 "tokenizer.lex"
1124
-{ return GREATER; }
1140
+{ return ASSIGNSLASH; }
1125 1141
 	YY_BREAK
1126 1142
 case 45:
1127 1143
 YY_RULE_SETUP
1128 1144
 #line 175 "tokenizer.lex"
1129
-{ return LESSEQ; }
1145
+{ return ASSIGNDSTAR; }
1130 1146
 	YY_BREAK
1131 1147
 case 46:
1132 1148
 YY_RULE_SETUP
1133 1149
 #line 177 "tokenizer.lex"
1134
-{ return GREATEREQ; }
1150
+{ return ASSIGNBAND; }
1135 1151
 	YY_BREAK
1136 1152
 case 47:
1137 1153
 YY_RULE_SETUP
1138 1154
 #line 179 "tokenizer.lex"
1139
-{ return RSHIFT; }
1155
+{ return ASSIGNBOR; }
1140 1156
 	YY_BREAK
1141 1157
 case 48:
1142 1158
 YY_RULE_SETUP
1143 1159
 #line 181 "tokenizer.lex"
1144
-{ return LSHIFT; }
1160
+{ return ASSIGNBXOR; }
1145 1161
 	YY_BREAK
1146 1162
 case 49:
1147 1163
 YY_RULE_SETUP
1148 1164
 #line 183 "tokenizer.lex"
1149
-{ return LBRACE; }
1165
+{ return EQUAL; }
1150 1166
 	YY_BREAK
1151 1167
 case 50:
1152 1168
 YY_RULE_SETUP
1153 1169
 #line 185 "tokenizer.lex"
1154
-{ return RBRACE; }
1170
+{ return NEQUAL; }
1155 1171
 	YY_BREAK
1156 1172
 case 51:
1157 1173
 YY_RULE_SETUP
1158 1174
 #line 187 "tokenizer.lex"
1159
-{ return LBRACKET; }
1175
+{ return LESS; }
1160 1176
 	YY_BREAK
1161 1177
 case 52:
1162 1178
 YY_RULE_SETUP
1163 1179
 #line 189 "tokenizer.lex"
1164
-{ return RBRACKET; }
1180
+{ return GREATER; }
1165 1181
 	YY_BREAK
1166 1182
 case 53:
1167 1183
 YY_RULE_SETUP
1168 1184
 #line 191 "tokenizer.lex"
1169
-{ return LPAREN; }
1185
+{ return LESSEQ; }
1170 1186
 	YY_BREAK
1171 1187
 case 54:
1172 1188
 YY_RULE_SETUP
1173 1189
 #line 193 "tokenizer.lex"
1174
-{ return RPAREN; }
1190
+{ return GREATEREQ; }
1175 1191
 	YY_BREAK
1176 1192
 case 55:
1177 1193
 YY_RULE_SETUP
1178 1194
 #line 195 "tokenizer.lex"
1179
-{ return DOT; }
1195
+{ return RSHIFT; }
1180 1196
 	YY_BREAK
1181 1197
 case 56:
1182 1198
 YY_RULE_SETUP
1183 1199
 #line 197 "tokenizer.lex"
1184
-{ return COLON; }
1200
+{ return LSHIFT; }
1185 1201
 	YY_BREAK
1186 1202
 case 57:
1187 1203
 YY_RULE_SETUP
1188 1204
 #line 199 "tokenizer.lex"
1189
-{ return SEMICOLON; }
1205
+{ return LBRACE; }
1190 1206
 	YY_BREAK
1191 1207
 case 58:
1192 1208
 YY_RULE_SETUP
1193 1209
 #line 201 "tokenizer.lex"
1194
-{ return COMMA; }
1210
+{ return RBRACE; }
1195 1211
 	YY_BREAK
1196 1212
 case 59:
1197 1213
 YY_RULE_SETUP
1198 1214
 #line 203 "tokenizer.lex"
1199
-{ return POUND; }
1215
+{ return LBRACKET; }
1200 1216
 	YY_BREAK
1201 1217
 case 60:
1202 1218
 YY_RULE_SETUP
1203 1219
 #line 205 "tokenizer.lex"
1204
-{ *yylval = (void *) strdup(yytext); return IDENT; }
1220
+{ return RBRACKET; }
1205 1221
 	YY_BREAK
1206 1222
 case 61:
1207
-/* rule 61 can match eol */
1208 1223
 YY_RULE_SETUP
1209 1224
 #line 207 "tokenizer.lex"
1210
-/* Skip comments */
1225
+{ return LPAREN; }
1211 1226
 	YY_BREAK
1212 1227
 case 62:
1213
-/* rule 62 can match eol */
1214 1228
 YY_RULE_SETUP
1215 1229
 #line 209 "tokenizer.lex"
1216
-/* Skip whitespace */
1230
+{ return RPAREN; }
1217 1231
 	YY_BREAK
1218 1232
 case 63:
1219 1233
 YY_RULE_SETUP
1220 1234
 #line 211 "tokenizer.lex"
1235
+{ return DOT; }
1236
+	YY_BREAK
1237
+case 64:
1238
+YY_RULE_SETUP
1239
+#line 213 "tokenizer.lex"
1240
+{ return COLON; }
1241
+	YY_BREAK
1242
+case 65:
1243
+YY_RULE_SETUP
1244
+#line 215 "tokenizer.lex"
1245
+{ return SEMICOLON; }
1246
+	YY_BREAK
1247
+case 66:
1248
+YY_RULE_SETUP
1249
+#line 217 "tokenizer.lex"
1250
+{ return COMMA; }
1251
+	YY_BREAK
1252
+case 67:
1253
+YY_RULE_SETUP
1254
+#line 219 "tokenizer.lex"
1255
+{ return POUND; }
1256
+	YY_BREAK
1257
+case 68:
1258
+YY_RULE_SETUP
1259
+#line 221 "tokenizer.lex"
1260
+{ *yylval = (void *) strdup(yytext); return IDENT; }
1261
+	YY_BREAK
1262
+case 69:
1263
+/* rule 69 can match eol */
1264
+YY_RULE_SETUP
1265
+#line 223 "tokenizer.lex"
1266
+/* Skip comments */
1267
+	YY_BREAK
1268
+case 70:
1269
+/* rule 70 can match eol */
1270
+YY_RULE_SETUP
1271
+#line 225 "tokenizer.lex"
1272
+/* Skip whitespace */
1273
+	YY_BREAK
1274
+case 71:
1275
+YY_RULE_SETUP
1276
+#line 227 "tokenizer.lex"
1221 1277
 ECHO;
1222 1278
 	YY_BREAK
1223
-#line 1224 "lex.yy.c"
1279
+#line 1280 "lex.yy.c"
1224 1280
 case YY_STATE_EOF(INITIAL):
1225 1281
 	yyterminate();
1226 1282
 
@@ -1513,7 +1569,7 @@ static int yy_get_next_buffer (void)
1513 1569
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1514 1570
 			{
1515 1571
 			yy_current_state = (int) yy_def[yy_current_state];
1516
-			if ( yy_current_state >= 119 )
1572
+			if ( yy_current_state >= 146 )
1517 1573
 				yy_c = yy_meta[(unsigned int) yy_c];
1518 1574
 			}
1519 1575
 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1541,11 +1597,11 @@ static int yy_get_next_buffer (void)
1541 1597
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1542 1598
 		{
1543 1599
 		yy_current_state = (int) yy_def[yy_current_state];
1544
-		if ( yy_current_state >= 119 )
1600
+		if ( yy_current_state >= 146 )
1545 1601
 			yy_c = yy_meta[(unsigned int) yy_c];
1546 1602
 		}
1547 1603
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1548
-	yy_is_jam = (yy_current_state == 118);
1604
+	yy_is_jam = (yy_current_state == 145);
1549 1605
 
1550 1606
 		return yy_is_jam ? 0 : yy_current_state;
1551 1607
 }
@@ -2215,7 +2271,7 @@ void yyfree (void * ptr )
2215 2271
 
2216 2272
 #define YYTABLES_NAME "yytables"
2217 2273
 
2218
-#line 210 "tokenizer.lex"
2274
+#line 226 "tokenizer.lex"
2219 2275
 
2220 2276
 
2221 2277
 

+ 3
- 3
parser.tab.c View File

@@ -1,8 +1,8 @@
1
-/* A Bison parser, made by GNU Bison 3.0.2.  */
1
+/* A Bison parser, made by GNU Bison 3.0.4.  */
2 2
 
3 3
 /* Bison implementation for Yacc-like parsers in C
4 4
 
5
-   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
5
+   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6 6
 
7 7
    This program is free software: you can redistribute it and/or modify
8 8
    it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@
44 44
 #define YYBISON 1
45 45
 
46 46
 /* Bison version.  */
47
-#define YYBISON_VERSION "3.0.2"
47
+#define YYBISON_VERSION "3.0.4"
48 48
 
49 49
 /* Skeleton name.  */
50 50
 #define YYSKELETON_NAME "yacc.c"

+ 2
- 2
parser.tab.h View File

@@ -1,8 +1,8 @@
1
-/* A Bison parser, made by GNU Bison 3.0.2.  */
1
+/* A Bison parser, made by GNU Bison 3.0.4.  */
2 2
 
3 3
 /* Bison interface for Yacc-like parsers in C
4 4
 
5
-   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
5
+   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6 6
 
7 7
    This program is free software: you can redistribute it and/or modify
8 8
    it under the terms of the GNU General Public License as published by

+ 16
- 0
tokenizer.lex View File

@@ -130,6 +130,8 @@ None { return NONE; }
130 130
 
131 131
 "%" { return PERCENT; }
132 132
 
133
+"mod" { return PERCENT; }
134
+
133 135
 "**" { return DSTAR; }
134 136
 
135 137
 "&" { return BAND; }
@@ -142,10 +144,24 @@ None { return NONE; }
142 144
 
143 145
 "&&" { return LAND; }
144 146
 
147
+"and" { return LAND; }
148
+
145 149
 "||" { return LOR; }
146 150
 
151
+"or" { return LOR; }
152
+
147 153
 "!" { return LNOT; }
148 154
 
155
+"not" { return LNOT; }
156
+
157
+"true" { *yylval = malloc(sizeof(long)); *((long *) *yylval) = 1; return INT;  }
158
+
159
+"True" { *yylval = malloc(sizeof(long)); *((long *) *yylval) = 1; return INT;  }
160
+
161
+"false" { *yylval = malloc(sizeof(long)); *((long *) *yylval) = 0; return INT;  }
162
+
163
+"False" { *yylval = malloc(sizeof(long)); *((long *) *yylval) = 0; return INT;  }
164
+
149 165
 "=" { return ASSIGN; }
150 166
 
151 167
 "+=" { return ASSIGNPLUS; }

Loading…
Cancel
Save