• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

programming language


Commit MetaInfo

Revisióneabbfd5f6f361ff1e0cbe14435ddbf4bf2964603 (tree)
Tiempo2023-04-17 22:52:04
Autordhrname <dhrname@joes...>
Commiterdhrname

Log Message

New the SyntaxRule class

Cambiar Resumen

Diferencia incremental

Binary files a/bin/obj/lex.o and b/bin/obj/lex.o differ
Binary files a/bin/obj/main.o and b/bin/obj/main.o differ
--- a/include/phrase.hpp
+++ b/include/phrase.hpp
@@ -1121,8 +1121,47 @@ namespace jstr
11211121 }
11221122 };
11231123
1124+ /*Syntax クラス
1125+ * BNF配列を安全に扱うためのクラス*/
1126+ class SyntaxRule
1127+ {
1128+ private:
1129+ root* tree;
1130+
1131+ public:
1132+ SyntaxRule(){
1133+ tree = new root();
1134+ }
1135+ virtual ~SyntaxRule(){
1136+ delete tree;
1137+ tree = nullptr;
1138+ }
1139+
1140+ /*isRangeBNF メンバ関数
1141+ * xとyとzがBNF三次元配列の範囲内であることをチェックする関数*/
1142+ virtual bool isRangeBNF(int32_t x, int32_t y, int32_t z)
1143+ {
1144+ if ( ( (0 < y) && (BNF_SELECTION_LENGTH > (y+1)) )
1145+ && ( (0 < x) && (BNF_NONTERMINAL_LENGTH > x) )
1146+ && ( (0 < z) && (BNF_CONCATNATION_LENGTH > z) ) )
1147+ {
1148+ return true;
1149+ }
1150+ else
1151+ {
1152+ return false;
1153+ }
1154+ }
1155+
1156+ virtual Node* getBNFTree()
1157+ {
1158+ return tree;
1159+ }
1160+ };
1161+
11241162 }
1125-
1163+
1164+
11261165 class SemanticNetwork: public BaseNode
11271166 {
11281167 private:
--- a/lex.l
+++ b/lex.l
@@ -206,7 +206,7 @@ DIGIT [1-9][0-9]*
206206 "cla" return jstr::parser::terminal::CLASS ;
207207 "new" return jstr::parser::terminal::NEW ;
208208 "this" return jstr::parser::terminal::THIS ;
209-"delete" return jstr::parser::terminal::DELETE ;
209+"del" return jstr::parser::terminal::DELETE ;
210210
211211 "case" return jstr::parser::terminal::CASE ;
212212 "type" return jstr::parser::terminal::TYPE ;
--- a/lex.yy.cc
+++ b/lex.yy.cc
@@ -394,7 +394,7 @@ struct yy_trans_info
394394 flex_int32_t yy_verify;
395395 flex_int32_t yy_nxt;
396396 };
397-static const flex_int16_t yy_accept[219] =
397+static const flex_int16_t yy_accept[216] =
398398 { 0,
399399 0, 0, 96, 95, 93, 93, 79, 95, 95, 78,
400400 95, 83, 84, 76, 74, 35, 75, 82, 77, 95,
@@ -410,16 +410,16 @@ static const flex_int16_t yy_accept[219] =
410410 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
411411 88, 88, 88, 88, 88, 64, 94, 94, 91, 34,
412412 0, 62, 63, 15, 88, 9, 10, 11, 12, 88,
413- 88, 22, 29, 88, 88, 88, 33, 28, 14, 88,
413+ 88, 22, 29, 88, 25, 88, 33, 28, 14, 88,
414414 88, 88, 88, 88, 13, 42, 1, 2, 3, 4,
415415 88, 17, 88, 88, 23, 16, 88, 88, 88, 88,
416416 5, 6, 7, 8, 18, 88, 88, 0, 88, 31,
417- 26, 88, 88, 88, 88, 45, 44, 88, 88, 88,
418- 88, 55, 88, 88, 88, 24, 27, 88, 88, 90,
419- 47, 20, 88, 88, 88, 49, 88, 88, 88, 48,
417+ 26, 88, 88, 88, 45, 44, 88, 88, 88, 88,
418+ 55, 88, 88, 88, 24, 27, 88, 88, 90, 47,
419+ 20, 88, 88, 49, 88, 88, 88, 48, 50, 88,
420420
421- 50, 88, 88, 40, 90, 88, 25, 32, 87, 86,
422- 54, 30, 88, 88, 88, 46, 21, 0
421+ 88, 40, 90, 88, 32, 87, 86, 54, 30, 88,
422+ 88, 88, 46, 21, 0
423423 } ;
424424
425425 static const YY_CHAR yy_ec[256] =
@@ -464,65 +464,65 @@ static const YY_CHAR yy_meta[60] =
464464 5, 5, 5, 5, 5, 5, 1, 1, 1
465465 } ;
466466
467-static const flex_int16_t yy_base[225] =
467+static const flex_int16_t yy_base[222] =
468468 { 0,
469- 0, 58, 286, 287, 287, 282, 255, 277, 279, 252,
470- 271, 287, 287, 45, 49, 287, 48, 263, 249, 261,
471- 260, 287, 287, 37, 246, 38, 287, 0, 22, 62,
472- 32, 38, 28, 71, 240, 50, 235, 237, 222, 232,
473- 48, 81, 222, 228, 287, 209, 287, 92, 101, 287,
474- 287, 287, 260, 259, 261, 287, 287, 287, 287, 287,
475- 287, 287, 287, 287, 247, 75, 287, 101, 246, 245,
476- 231, 287, 287, 287, 230, 0, 214, 219, 231, 231,
477- 234, 231, 67, 218, 90, 84, 209, 85, 88, 201,
478- 95, 202, 199, 222, 222, 225, 222, 0, 195, 0,
479-
480- 197, 200, 194, 185, 196, 196, 186, 194, 186, 208,
481- 208, 211, 208, 71, 188, 287, 138, 139, 140, 287,
482- 119, 287, 287, 0, 194, 0, 0, 0, 0, 183,
483- 188, 0, 0, 97, 187, 190, 0, 0, 0, 184,
484- 184, 174, 182, 181, 0, 0, 0, 0, 0, 0,
485- 171, 0, 171, 182, 0, 0, 169, 162, 163, 174,
486- 0, 0, 0, 0, 0, 177, 166, 130, 166, 0,
487- 0, 157, 166, 155, 169, 0, 0, 155, 155, 166,
488- 152, 0, 163, 148, 153, 0, 0, 146, 158, 138,
489- 0, 0, 149, 156, 153, 0, 141, 140, 139, 0,
490-
491- 0, 135, 98, 0, 146, 81, 0, 0, 0, 0,
492- 0, 0, 70, 63, 38, 0, 0, 287, 171, 176,
493- 179, 181, 183, 184
469+ 0, 58, 283, 284, 284, 279, 252, 274, 276, 249,
470+ 268, 284, 284, 45, 49, 284, 48, 260, 246, 258,
471+ 257, 284, 284, 37, 243, 38, 284, 0, 22, 62,
472+ 32, 38, 28, 71, 237, 50, 232, 234, 219, 229,
473+ 48, 81, 219, 225, 284, 206, 284, 92, 101, 284,
474+ 284, 284, 257, 256, 258, 284, 284, 284, 284, 284,
475+ 284, 284, 284, 284, 244, 75, 284, 101, 243, 242,
476+ 228, 284, 284, 284, 227, 0, 211, 216, 228, 228,
477+ 231, 228, 67, 215, 90, 84, 206, 85, 88, 198,
478+ 95, 199, 196, 219, 219, 222, 219, 0, 192, 0,
479+
480+ 194, 197, 191, 182, 193, 193, 183, 191, 183, 205,
481+ 205, 208, 205, 71, 185, 284, 138, 139, 140, 284,
482+ 119, 284, 284, 0, 191, 0, 0, 0, 0, 180,
483+ 185, 0, 0, 97, 0, 188, 0, 0, 0, 182,
484+ 182, 172, 180, 179, 0, 0, 0, 0, 0, 0,
485+ 169, 0, 169, 180, 0, 0, 167, 160, 161, 172,
486+ 0, 0, 0, 0, 0, 175, 164, 130, 164, 0,
487+ 0, 155, 164, 168, 0, 0, 154, 154, 165, 151,
488+ 0, 162, 147, 152, 0, 0, 145, 157, 138, 0,
489+ 0, 148, 153, 0, 141, 140, 139, 0, 0, 135,
490+
491+ 98, 0, 146, 81, 0, 0, 0, 0, 0, 70,
492+ 63, 38, 0, 0, 284, 171, 176, 179, 181, 183,
493+ 184
494494 } ;
495495
496-static const flex_int16_t yy_def[225] =
496+static const flex_int16_t yy_def[222] =
497497 { 0,
498- 218, 1, 218, 218, 218, 218, 218, 219, 220, 218,
499- 218, 218, 218, 218, 218, 218, 218, 221, 218, 222,
500- 223, 218, 218, 218, 218, 218, 218, 224, 224, 224,
501- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
502- 224, 224, 224, 224, 218, 218, 218, 218, 219, 218,
503- 218, 218, 219, 219, 220, 218, 218, 218, 218, 218,
504- 218, 218, 218, 218, 218, 221, 218, 218, 222, 223,
505- 218, 218, 218, 218, 218, 224, 224, 224, 224, 224,
506- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
507- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
508-
509- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
510- 224, 224, 224, 224, 224, 218, 218, 219, 219, 218,
511- 218, 218, 218, 224, 224, 224, 224, 224, 224, 224,
512- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
513- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
514- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
515- 224, 224, 224, 224, 224, 224, 224, 218, 224, 224,
516- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
517- 224, 224, 224, 224, 224, 224, 224, 224, 224, 218,
518- 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
519-
520- 224, 224, 224, 224, 218, 224, 224, 224, 224, 224,
521- 224, 224, 224, 224, 224, 224, 224, 0, 218, 218,
522- 218, 218, 218, 218
498+ 215, 1, 215, 215, 215, 215, 215, 216, 217, 215,
499+ 215, 215, 215, 215, 215, 215, 215, 218, 215, 219,
500+ 220, 215, 215, 215, 215, 215, 215, 221, 221, 221,
501+ 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
502+ 221, 221, 221, 221, 215, 215, 215, 215, 216, 215,
503+ 215, 215, 216, 216, 217, 215, 215, 215, 215, 215,
504+ 215, 215, 215, 215, 215, 218, 215, 215, 219, 220,
505+ 215, 215, 215, 215, 215, 221, 221, 221, 221, 221,
506+ 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
507+ 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
508+
509+ 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
510+ 221, 221, 221, 221, 221, 215, 215, 216, 216, 215,
511+ 215, 215, 215, 221, 221, 221, 221, 221, 221, 221,
512+ 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
513+ 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
514+ 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
515+ 221, 221, 221, 221, 221, 221, 221, 215, 221, 221,
516+ 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
517+ 221, 221, 221, 221, 221, 221, 221, 221, 215, 221,
518+ 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
519+
520+ 221, 221, 215, 221, 221, 221, 221, 221, 221, 221,
521+ 221, 221, 221, 221, 0, 215, 215, 215, 215, 215,
522+ 215
523523 } ;
524524
525-static const flex_int16_t yy_nxt[347] =
525+static const flex_int16_t yy_nxt[344] =
526526 { 0,
527527 4, 4, 5, 6, 7, 8, 9, 10, 11, 12,
528528 13, 14, 15, 16, 17, 18, 19, 20, 21, 21,
@@ -531,40 +531,40 @@ static const flex_int16_t yy_nxt[347] =
531531 34, 28, 28, 35, 36, 37, 38, 39, 40, 28,
532532 41, 42, 43, 44, 28, 28, 45, 46, 47, 48,
533533 59, 61, 63, 49, 71, 72, 74, 75, 77, 86,
534- 78, 92, 87, 60, 93, 217, 64, 62, 88, 79,
534+ 78, 92, 87, 60, 93, 214, 64, 62, 88, 79,
535535 80, 89, 81, 102, 50, 82, 90, 108, 94, 95,
536- 218, 96, 91, 117, 97, 83, 103, 117, 110, 111,
536+ 215, 96, 91, 117, 97, 83, 103, 117, 110, 111,
537537
538- 216, 112, 118, 109, 113, 84, 119, 121, 85, 98,
539- 130, 165, 121, 215, 166, 99, 131, 100, 66, 66,
538+ 213, 112, 118, 109, 113, 84, 119, 121, 85, 98,
539+ 130, 165, 121, 212, 166, 99, 131, 100, 66, 66,
540540 66, 66, 66, 66, 66, 66, 133, 135, 140, 138,
541- 143, 168, 214, 168, 136, 134, 139, 141, 213, 117,
542- 118, 118, 144, 117, 119, 119, 172, 173, 190, 190,
543- 190, 190, 190, 190, 190, 205, 205, 205, 205, 205,
544- 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
545- 205, 53, 212, 53, 53, 53, 55, 55, 55, 55,
546- 55, 66, 66, 69, 69, 70, 70, 76, 76, 211,
547- 210, 209, 208, 207, 206, 204, 203, 202, 201, 200,
548-
549- 199, 198, 197, 196, 195, 194, 193, 192, 191, 189,
550- 188, 187, 186, 185, 184, 183, 182, 181, 180, 179,
551- 178, 177, 176, 175, 174, 171, 170, 169, 167, 164,
552- 163, 162, 161, 160, 159, 158, 157, 156, 155, 154,
553- 153, 152, 151, 150, 149, 148, 147, 146, 145, 142,
554- 137, 132, 129, 128, 127, 126, 125, 124, 123, 122,
555- 68, 68, 120, 56, 54, 54, 116, 115, 114, 107,
556- 106, 105, 104, 101, 73, 68, 68, 67, 65, 58,
557- 57, 56, 54, 52, 51, 218, 3, 218, 218, 218,
558- 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
559-
560- 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
561- 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
562- 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
563- 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
564- 218, 218, 218, 218, 218, 218
541+ 143, 168, 211, 168, 136, 134, 139, 141, 210, 117,
542+ 118, 118, 144, 117, 119, 119, 172, 173, 189, 189,
543+ 189, 189, 189, 189, 189, 203, 203, 203, 203, 203,
544+ 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
545+ 203, 53, 209, 53, 53, 53, 55, 55, 55, 55,
546+ 55, 66, 66, 69, 69, 70, 70, 76, 76, 208,
547+ 207, 206, 205, 204, 202, 201, 200, 199, 198, 197,
548+
549+ 196, 195, 194, 193, 192, 191, 190, 188, 187, 186,
550+ 185, 184, 183, 182, 181, 180, 179, 178, 177, 176,
551+ 175, 174, 171, 170, 169, 167, 164, 163, 162, 161,
552+ 160, 159, 158, 157, 156, 155, 154, 153, 152, 151,
553+ 150, 149, 148, 147, 146, 145, 142, 137, 132, 129,
554+ 128, 127, 126, 125, 124, 123, 122, 68, 68, 120,
555+ 56, 54, 54, 116, 115, 114, 107, 106, 105, 104,
556+ 101, 73, 68, 68, 67, 65, 58, 57, 56, 54,
557+ 52, 51, 215, 3, 215, 215, 215, 215, 215, 215,
558+ 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
559+
560+ 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
561+ 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
562+ 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
563+ 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
564+ 215, 215, 215
565565 } ;
566566
567-static const flex_int16_t yy_chk[347] =
567+static const flex_int16_t yy_chk[344] =
568568 { 0,
569569 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
570570 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -573,37 +573,37 @@ static const flex_int16_t yy_chk[347] =
573573 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
574574 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
575575 14, 15, 17, 2, 24, 24, 26, 26, 29, 31,
576- 29, 33, 31, 14, 33, 215, 17, 15, 31, 30,
576+ 29, 33, 31, 14, 33, 212, 17, 15, 31, 30,
577577 30, 32, 30, 36, 2, 30, 32, 41, 34, 34,
578578 66, 34, 32, 48, 34, 30, 36, 48, 42, 42,
579579
580- 214, 42, 49, 41, 42, 30, 49, 66, 30, 34,
581- 83, 114, 66, 213, 114, 34, 83, 34, 68, 68,
580+ 211, 42, 49, 41, 42, 30, 49, 66, 30, 34,
581+ 83, 114, 66, 210, 114, 34, 83, 34, 68, 68,
582582 68, 68, 68, 68, 68, 68, 85, 86, 89, 88,
583- 91, 121, 206, 121, 86, 85, 88, 89, 203, 117,
583+ 91, 121, 204, 121, 86, 85, 88, 89, 201, 117,
584584 118, 119, 91, 117, 118, 119, 134, 134, 168, 168,
585- 168, 168, 168, 168, 168, 190, 190, 190, 190, 190,
586- 190, 190, 190, 205, 205, 205, 205, 205, 205, 205,
587- 205, 219, 202, 219, 219, 219, 220, 220, 220, 220,
588- 220, 221, 221, 222, 222, 223, 223, 224, 224, 199,
589- 198, 197, 195, 194, 193, 189, 188, 185, 184, 183,
590-
591- 181, 180, 179, 178, 175, 174, 173, 172, 169, 167,
592- 166, 160, 159, 158, 157, 154, 153, 151, 144, 143,
593- 142, 141, 140, 136, 135, 131, 130, 125, 115, 113,
594- 112, 111, 110, 109, 108, 107, 106, 105, 104, 103,
595- 102, 101, 99, 97, 96, 95, 94, 93, 92, 90,
596- 87, 84, 82, 81, 80, 79, 78, 77, 75, 71,
597- 70, 69, 65, 55, 54, 53, 46, 44, 43, 40,
598- 39, 38, 37, 35, 25, 21, 20, 19, 18, 11,
599- 10, 9, 8, 7, 6, 3, 218, 218, 218, 218,
600- 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
601-
602- 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
603- 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
604- 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
605- 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
606- 218, 218, 218, 218, 218, 218
585+ 168, 168, 168, 168, 168, 189, 189, 189, 189, 189,
586+ 189, 189, 189, 203, 203, 203, 203, 203, 203, 203,
587+ 203, 216, 200, 216, 216, 216, 217, 217, 217, 217,
588+ 217, 218, 218, 219, 219, 220, 220, 221, 221, 197,
589+ 196, 195, 193, 192, 188, 187, 184, 183, 182, 180,
590+
591+ 179, 178, 177, 174, 173, 172, 169, 167, 166, 160,
592+ 159, 158, 157, 154, 153, 151, 144, 143, 142, 141,
593+ 140, 136, 131, 130, 125, 115, 113, 112, 111, 110,
594+ 109, 108, 107, 106, 105, 104, 103, 102, 101, 99,
595+ 97, 96, 95, 94, 93, 92, 90, 87, 84, 82,
596+ 81, 80, 79, 78, 77, 75, 71, 70, 69, 65,
597+ 55, 54, 53, 46, 44, 43, 40, 39, 38, 37,
598+ 35, 25, 21, 20, 19, 18, 11, 10, 9, 8,
599+ 7, 6, 3, 215, 215, 215, 215, 215, 215, 215,
600+ 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
601+
602+ 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
603+ 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
604+ 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
605+ 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
606+ 215, 215, 215
607607 } ;
608608
609609 static const flex_int16_t yy_rule_linenum[95] =
@@ -1031,13 +1031,13 @@ yy_match:
10311031 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
10321032 {
10331033 yy_current_state = (int) yy_def[yy_current_state];
1034- if ( yy_current_state >= 219 )
1034+ if ( yy_current_state >= 216 )
10351035 yy_c = yy_meta[yy_c];
10361036 }
10371037 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
10381038 ++yy_cp;
10391039 }
1040- while ( yy_current_state != 218 );
1040+ while ( yy_current_state != 215 );
10411041 yy_cp = (yy_last_accepting_cpos);
10421042 yy_current_state = (yy_last_accepting_state);
10431043
@@ -1995,7 +1995,7 @@ int yyFlexLexer::yy_get_next_buffer()
19951995 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
19961996 {
19971997 yy_current_state = (int) yy_def[yy_current_state];
1998- if ( yy_current_state >= 219 )
1998+ if ( yy_current_state >= 216 )
19991999 yy_c = yy_meta[yy_c];
20002000 }
20012001 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@@ -2028,11 +2028,11 @@ int yyFlexLexer::yy_get_next_buffer()
20282028 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
20292029 {
20302030 yy_current_state = (int) yy_def[yy_current_state];
2031- if ( yy_current_state >= 219 )
2031+ if ( yy_current_state >= 216 )
20322032 yy_c = yy_meta[yy_c];
20332033 }
20342034 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2035- yy_is_jam = (yy_current_state == 218);
2035+ yy_is_jam = (yy_current_state == 215);
20362036
20372037 return yy_is_jam ? 0 : yy_current_state;
20382038 }
--- a/main.cpp
+++ b/main.cpp
@@ -396,6 +396,19 @@ int main(int argc, char **argv)
396396 EXPECT(snet->getReference(), snet2);
397397 delete snet;
398398 delete snet2;
399+ snet = nullptr;
400+ snet2 = nullptr;
401+
402+ jstr::parser::SyntaxRule* sru = new jstr::parser::SyntaxRule();
403+ EXPECT(sru->isRangeBNF(0, 0, 0), false);
404+ EXPECT(sru->isRangeBNF(1, 1, 1), true);
405+ EXPECT(sru->isRangeBNF(1, 0, 0), false);
406+ EXPECT(sru->isRangeBNF(1, BNF_SELECTION_LENGTH-1, 1), false);
407+ EXPECT(sru->isRangeBNF(BNF_NONTERMINAL_LENGTH, 1, 1), false);
408+ EXPECT(sru->isRangeBNF(1, 1, BNF_CONCATNATION_LENGTH), false);
409+ delete sru;
410+ sru = nullptr;
411+
399412 jstr::Phrase* phr = new jstr::Phrase(1);
400413 EXPECT(phr->nameSpace, "");
401414 phr->setSemanticValue("wpe");
@@ -561,8 +574,6 @@ int main(int argc, char **argv)
561574 jstr::RealNumberTypeValue* real64val = new jstr::RealNumberTypeValue(64);
562575 EXPECT(real64val->timeIndex, 64);
563576 delete real64val;
564- snet = nullptr;
565- snet2 = nullptr;
566577 phr = nullptr;
567578 metaphr = nullptr;
568579 arrowphr = nullptr;
--- a/parser.cpp
+++ b/parser.cpp
@@ -82,21 +82,6 @@ bool Tester::isSuccess()
8282 return success;
8383 }
8484
85-/*getAbstractSyntaxTree メンバ関数
86-* 抽象構文木の根を返す*/
87-root* AbstractSyntaxTree::getAbstractSyntaxTree()
88-{
89- return abstractSyntaxTreeRoot;
90-}
91-
92-/*getCurrentNode 関数
93-* 抽象構文木の現在ノードを返す
94-* nestメンバ関数により現在ノードは更新される*/
95-Node* AbstractSyntaxTree::getCurrentNode()
96-{
97- return ast;
98-}
99-
10085 int IndentInterpreter::getCurrentIndent()
10186 {
10287 return indentLength;
@@ -192,6 +177,22 @@ int64_t IndentInterpreter::nest(Node* nod)
192177 using namespace jstr::parser::terminal;
193178 using namespace jstr::parser::nonterminal;
194179
180+
181+/*getAbstractSyntaxTree メンバ関数
182+* 抽象構文木の根を返す*/
183+root* AbstractSyntaxTree::getAbstractSyntaxTree()
184+{
185+ return abstractSyntaxTreeRoot;
186+}
187+
188+/*getCurrentNode 関数
189+* 抽象構文木の現在ノードを返す
190+* nestメンバ関数により現在ノードは更新される*/
191+Node* AbstractSyntaxTree::getCurrentNode()
192+{
193+ return ast;
194+}
195+
195196 /*createPhrase メンバ関数
196197 * SymbolIdが引数であるようなPhrase*型のオブジェクトを返す*/
197198 Phrase* AbstractSyntaxTree::createPhrase(int32_t ret)
--- a/test/classtest.j
+++ b/test/classtest.j
@@ -1,8 +1,8 @@
11 main:
22 obj xw = new wp();
33 obj xww = new w();
4- delete xw;
5- delete xww;
4+ del xw;
5+ del xww;
66 obj o = new hoge();
77 o.f(); #ダイクストラ選択(選出)
88 obj oa = new hogehoge(i:12);
@@ -10,7 +10,7 @@ main:
1010 expect o:
1111 f();
1212 o.f();
13- delete o;
13+ del o;
1414
1515 expect oa:
1616 f();
@@ -22,7 +22,7 @@ main:
2222 i:12
2323 );
2424 i = 12;
25- delete oa;
25+ del oa;
2626
2727 obj oh = new Hg();
2828 expect oh:
@@ -87,8 +87,8 @@ main:
8787 case oh:
8888 type Hf:
8989 i = 1;
90- delete oh;
91- delete ob;
90+ del oh;
91+ del ob;
9292 ;
9393
9494 cla wp:
--- a/test/commenttest.j
+++ b/test/commenttest.j
@@ -3,7 +3,7 @@ main:
33 #TEST
44 obj o = new hoge();
55 o.f();
6- delete o;
6+ del o;
77 #
88 ##
99 #
--- a/test/coroutine.j
+++ b/test/coroutine.j
@@ -2,8 +2,8 @@ main:
22 obj o = new hoge();
33 obj oa = new hogehoge(i:12);
44 o.f();
5- delete o;
6- delete oa;
5+ del o;
6+ del oa;
77 ;
88
99 class hoge:
--- a/test/datatypetest.j
+++ b/test/datatypetest.j
@@ -27,7 +27,7 @@ main:
2727 c= 200;
2828 dd= 15.1;
2929 ;
30- delete o;
30+ del o;
3131 obj oo = new Hg();
3232 except oo:
3333 oo.g();
--- a/test/excepttest.j
+++ b/test/excepttest.j
@@ -3,11 +3,11 @@ main:
33 o.f();
44 except o:
55 g();
6- delete o;
6+ del o;
77 obj oo = new hogehoge();
88 except oo:
99 f();
10- delete oo;
10+ del oo;
1111 except:
1212 oo = 10; #error
1313 error; #error
--- a/test/expecttest.j
+++ b/test/expecttest.j
@@ -10,14 +10,14 @@ main:
1010 expect o:
1111 i = 0; #error
1212 f(); #error
13- delete o;
13+ del o;
1414 obj ob = new hogehoge();
1515 expect ob:
1616 i = 0; #no error
1717 f(); #no error
1818 ff(); #no error
1919 i = 12;
20- delete ob;
20+ del ob;
2121 ;
2222
2323 cla wp:
--- a/test/functor.j
+++ b/test/functor.j
@@ -6,7 +6,7 @@ main:
66 i= 0;
77 x() = 100;
88 i= 12;
9- delete o;
9+ del o;
1010
1111 #virtual quantitiy (仮想量子化) = override oa.hoge::f() -> oa.f() -> ...
1212 # = oa.hoge::f(oa.f()); 最左評価戦略なので、関手oa.hoge::fがまず評価されて、その次に、関手oa.fが評価される
@@ -28,7 +28,7 @@ main:
2828 i=12;
2929 x() = 100;
3030 i= 12;
31- delete oa;
31+ del oa;
3232
3333 obj oh = new Hg();
3434 expect oh:
@@ -56,7 +56,7 @@ main:
5656 fg();
5757 i=12;
5858 j=100;
59- delete oh;
59+ del oh;
6060 obj ob = new Hh(i:12);
6161 expect ob:
6262 f();
@@ -70,7 +70,7 @@ main:
7070 i=17;
7171 p();
7272 i=15;
73- delete ob;
73+ del ob;
7474 ;
7575
7676 cla wp:
--- a/test/statementtest.j
+++ b/test/statementtest.j
@@ -2,7 +2,7 @@ main:
22 obj o = new hoge();
33 obj oa = new hogehoge(i:12);
44 o.f();
5- delete o;
5+ del o;
66 i32 i = 12;
77 if i < 12:
88 ;
@@ -13,9 +13,9 @@ main:
1313 if i > 11:
1414 ;
1515 elif i < 12:
16- delete oa;
16+ del oa;
1717 else:
18- delete oa;
18+ del oa;
1919 print oa.f(i:15);
2020 print oa.f(
2121 i:12
@@ -24,7 +24,7 @@ main:
2424 ;
2525 for i32 i = 0; i<10; ++i:
2626 ;
27- delete oa;
27+ del oa;
2828 obj oh = new Hg();
2929 case oh:
3030 type hoge:
@@ -49,10 +49,10 @@ main:
4949 type pe:
5050 print 12;
5151 print 125;
52- delete oh;
52+ del oh;
5353 type wp:
5454 print 125;
55- delete oh;
55+ del oh;
5656 print oh.f();
5757 print oh.f(i:18);
5858 print oh.f(i:12);
@@ -79,7 +79,7 @@ main:
7979 i = 4;
8080 except:
8181 error;
82- delete ob;
82+ del ob;
8383 ;
8484
8585 cla hoge:
--- a/test/whilestatementtest.j
+++ b/test/whilestatementtest.j
@@ -5,13 +5,13 @@ main:
55 o.f();
66 except o:
77 g();
8- delete o;
8+ del o;
99 o = new Hh();
1010 expect o:
1111 f();
1212 f();
1313 f(i:12);
14- delete o;
14+ del o;
1515 ;
1616
1717 #class hoge