programming language
Revisión | 084f84ce1945b2d9396b6d03a7692073d0727487 (tree) |
---|---|
Tiempo | 2021-11-14 23:07:04 |
Autor | dhrname <dhrname@joes...> |
Commiter | dhrname |
Support an Unsigned Number
@@ -387,9 +387,12 @@ namespace jstr | ||
387 | 387 | * 整数の値を表すクラス*/ |
388 | 388 | class IntegerTypeValue: public Phrase |
389 | 389 | { |
390 | + private: | |
391 | + bool isSigned; | |
390 | 392 | public: |
391 | - explicit IntegerTypeValue(const uint64_t t) | |
392 | - : Phrase::Phrase{t} | |
393 | + explicit IntegerTypeValue(const uint64_t t, const bool b = true) | |
394 | + : Phrase::Phrase{t}, | |
395 | + isSigned{b} | |
393 | 396 | { |
394 | 397 | } |
395 | 398 | }; |
@@ -689,15 +692,19 @@ namespace jstr | ||
689 | 692 | std::cout << lexer->YYText() << std::endl; |
690 | 693 | break; |
691 | 694 | case UINTEGER8: |
695 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::IntegerTypeValue(8, false)) ); | |
692 | 696 | std::cout << lexer->YYText() << std::endl; |
693 | 697 | break; |
694 | 698 | case UINTEGER16: |
699 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::IntegerTypeValue(16, false)) ); | |
695 | 700 | std::cout << lexer->YYText() << std::endl; |
696 | 701 | break; |
697 | 702 | case UINTEGER32: |
703 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::IntegerTypeValue(32, false)) ); | |
698 | 704 | std::cout << lexer->YYText() << std::endl; |
699 | 705 | break; |
700 | 706 | case UINTEGER64: |
707 | + ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::IntegerTypeValue(64, false)) ); | |
701 | 708 | std::cout << lexer->YYText() << std::endl; |
702 | 709 | break; |
703 | 710 | case FLOAT: |