programming language
Revisión | dd4ff343c7694c2609b6b77a07764f029cb26ef4 (tree) |
---|---|
Tiempo | 2021-11-18 22:41:46 |
Autor | dhrname <dhrname@joes...> |
Commiter | dhrname |
Modify a namespace in the Parser class
@@ -450,6 +450,31 @@ namespace jstr | ||
450 | 450 | { |
451 | 451 | }; |
452 | 452 | |
453 | + /**/ | |
454 | + class ContinueStatement: public MetaPhrase | |
455 | + { | |
456 | + }; | |
457 | + | |
458 | + /**/ | |
459 | + class BreakStatement: public MetaPhrase | |
460 | + { | |
461 | + }; | |
462 | + | |
463 | + /**/ | |
464 | + class ExpectStatement: public MetaPhrase | |
465 | + { | |
466 | + }; | |
467 | + | |
468 | + /**/ | |
469 | + class ErrorStatement: public MetaPhrase | |
470 | + { | |
471 | + }; | |
472 | + | |
473 | + /**/ | |
474 | + class ExceptionStatement: public MetaPhrase | |
475 | + { | |
476 | + }; | |
477 | + | |
453 | 478 | /*ExpressionSimpleStatement クラス |
454 | 479 | * 式の中間コードを生成する文を示す |
455 | 480 | * このクラスは関手である*/ |
@@ -690,62 +715,63 @@ namespace jstr | ||
690 | 715 | std::cout << "indent" << lexer->YYLeng() << lexer->YYText() << std::endl; |
691 | 716 | break; |
692 | 717 | case CHARACTER8: |
693 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::StringTypeValue(8)) ); | |
718 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new StringTypeValue(8)) ); | |
694 | 719 | std::cout << lexer->YYText() << std::endl; |
695 | 720 | break; |
696 | 721 | case CHARACTER16: |
697 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::StringTypeValue(16)) ); | |
722 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new StringTypeValue(16)) ); | |
698 | 723 | std::cout << lexer->YYText() << std::endl; |
699 | 724 | break; |
700 | 725 | case CHARACTER32: |
701 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::StringTypeValue(32)) ); | |
726 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new StringTypeValue(32)) ); | |
702 | 727 | std::cout << lexer->YYText() << std::endl; |
703 | 728 | break; |
704 | 729 | case CHARACTER64: |
705 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::StringTypeValue(64)) ); | |
730 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new StringTypeValue(64)) ); | |
706 | 731 | std::cout << lexer->YYText() << std::endl; |
707 | 732 | break; |
708 | 733 | case INTEGER8: |
709 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::IntegerTypeValue(8)) ); | |
734 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new IntegerTypeValue(8)) ); | |
710 | 735 | std::cout << lexer->YYText() << std::endl; |
711 | 736 | break; |
712 | 737 | case INTEGER16: |
713 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::IntegerTypeValue(16)) ); | |
738 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new IntegerTypeValue(16)) ); | |
714 | 739 | std::cout << lexer->YYText() << std::endl; |
715 | 740 | break; |
716 | 741 | case INTEGER32: |
717 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::IntegerTypeValue(32)) ); | |
742 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new IntegerTypeValue(32)) ); | |
718 | 743 | std::cout << lexer->YYText() << std::endl; |
719 | 744 | break; |
720 | 745 | case INTEGER64: |
721 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::IntegerTypeValue(64)) ); | |
746 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new IntegerTypeValue(64)) ); | |
722 | 747 | std::cout << lexer->YYText() << std::endl; |
723 | 748 | break; |
724 | 749 | case UINTEGER8: |
725 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::IntegerTypeValue(8, false)) ); | |
750 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new IntegerTypeValue(8, false)) ); | |
726 | 751 | std::cout << lexer->YYText() << std::endl; |
727 | 752 | break; |
728 | 753 | case UINTEGER16: |
729 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::IntegerTypeValue(16, false)) ); | |
754 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new IntegerTypeValue(16, false)) ); | |
730 | 755 | std::cout << lexer->YYText() << std::endl; |
731 | 756 | break; |
732 | 757 | case UINTEGER32: |
733 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::IntegerTypeValue(32, false)) ); | |
758 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new IntegerTypeValue(32, false)) ); | |
734 | 759 | std::cout << lexer->YYText() << std::endl; |
735 | 760 | break; |
736 | 761 | case UINTEGER64: |
737 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::IntegerTypeValue(64, false)) ); | |
762 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new IntegerTypeValue(64, false)) ); | |
738 | 763 | std::cout << lexer->YYText() << std::endl; |
739 | 764 | break; |
740 | 765 | case FLOAT: |
741 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::RealNumberTypeValue(64)) ); | |
766 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new RealNumberTypeValue(64)) ); | |
742 | 767 | std::cout << lexer->YYText() << std::endl; |
743 | 768 | break; |
744 | 769 | case DOUBLE: |
745 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::RealNumberTypeValue(128)) ); | |
770 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new RealNumberTypeValue(128)) ); | |
746 | 771 | std::cout << lexer->YYText() << std::endl; |
747 | 772 | break; |
748 | 773 | case BOOLEAN: |
774 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new BooleanTypeValue()) ); | |
749 | 775 | std::cout << lexer->YYText() << std::endl; |
750 | 776 | break; |
751 | 777 | case OBJECT: |
@@ -758,7 +784,7 @@ namespace jstr | ||
758 | 784 | std::cout << lexer->YYText() << std::endl; |
759 | 785 | break; |
760 | 786 | case CLASS: |
761 | - ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::ClassModule()) ); | |
787 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new ClassModule()) ); | |
762 | 788 | std::cout << lexer->YYText() << std::endl; |
763 | 789 | break; |
764 | 790 | case CONST: |
@@ -803,6 +829,7 @@ namespace jstr | ||
803 | 829 | std::cout << lexer->YYText() << std::endl; |
804 | 830 | break; |
805 | 831 | case RETURN: |
832 | + /*return文を処理する。改行を示すJRETURNとは異なる*/ | |
806 | 833 | std::cout << lexer->YYText() << std::endl; |
807 | 834 | break; |
808 | 835 | case JERROR: |