From 7f19818414c1fbb175a6b29e44ebcaa4a4c10fed Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 14 Feb 2023 00:52:07 +0000 Subject: [PATCH] Support method privilege feature After this patch is applied, the developer can set the method privilege for each methods as below: +------------------------------------------------------------------------------+ | interface alarmmgr { | | [privilege = "http://tizen.org/privilege/alarm.set"] | | int alarm_set(int alarm_id, alarmtime time); | | ... | | } | +------------------------------------------------------------------------------+ Change-Id: I6d407b991cb2c32025a20fab6c343d7ca7287d35 Signed-off-by: Hwankyu Jhun --- idlc/ast/declaration.cc | 10 +- idlc/ast/declaration.h | 6 +- idlc/ast/tidlc.yy | 32 ++ idlc/ast/tidlc_y.cpp | 767 ++++++++++++++------------ idlc/gen/version2/c_stub_body_generator.cc | 78 ++- idlc/gen/version2/c_stub_body_generator.hh | 7 + idlc/gen/version2/c_stub_body_generator_cb.hh | 193 ++++++- 7 files changed, 727 insertions(+), 366 deletions(-) diff --git a/idlc/ast/declaration.cc b/idlc/ast/declaration.cc index 192b88b..b3c1b47 100644 --- a/idlc/ast/declaration.cc +++ b/idlc/ast/declaration.cc @@ -24,13 +24,15 @@ namespace tidl { Declaration::Declaration(std::string id, std::unique_ptr ret_type, std::unique_ptr params, std::string comments, - unsigned int line, MethodType mtype) + unsigned int line, MethodType mtype, Attributes* attrs) : id_(std::move(id)), ret_type_(std::move(ret_type)), params_(std::move(params)), comments_(std::move(comments)), line_(line), - mtype_(mtype) {} + mtype_(mtype), + attrs_(attrs) { +} const std::string& Declaration::GetID() const { return id_; @@ -52,6 +54,10 @@ const std::string& Declaration::GetComments() const { return comments_; } +const Attributes& Declaration::GetAttributes() const { + return *attrs_; +} + void Declarations::Add(std::unique_ptr decl) { decls_.push_back(std::move(decl)); } diff --git a/idlc/ast/declaration.h b/idlc/ast/declaration.h index 985cdb9..1f95d85 100644 --- a/idlc/ast/declaration.h +++ b/idlc/ast/declaration.h @@ -21,6 +21,7 @@ #include #include +#include "idlc/ast/attribute.h" #include "idlc/ast/type.h" #include "idlc/ast/parameter.h" @@ -36,7 +37,8 @@ class Declaration { Declaration(std::string id, std::unique_ptr ret_type, std::unique_ptr params, std::string comments, - unsigned int line, MethodType mtype = MethodType::SYNC); + unsigned int line, MethodType mtype = MethodType::SYNC, + Attributes* attr = new Attributes()); const std::string& GetID() const; const BaseType& GetType() const; @@ -44,11 +46,13 @@ class Declaration { MethodType GetMethodType() const { return mtype_; } const unsigned int GetLine() const; const std::string& GetComments() const; + const Attributes& GetAttributes() const; private: std::string id_; std::unique_ptr ret_type_; std::unique_ptr params_; + std::unique_ptr attrs_; std::string comments_; unsigned int line_; MethodType mtype_; diff --git a/idlc/ast/tidlc.yy b/idlc/ast/tidlc.yy index 7b9aa82..4069761 100644 --- a/idlc/ast/tidlc.yy +++ b/idlc/ast/tidlc.yy @@ -456,6 +456,25 @@ declaration: base_type T_ID T_LEFT parameter_list T_RIGHT T_SEMICOLON { delete $2; } } + | T_SB_OPEN attributes T_SB_CLOSE base_type T_ID T_LEFT parameter_list T_RIGHT T_SEMICOLON { + if (ps->GetVersion() < 2) { + ps->ReportError("syntax error. \"method attributes is supported from protocol version 2\".", @1.begin.line); + ps->ReportError("try to use protocol version 2.", @1.begin.line); + } + + if (ps->IsGroupEnabled()) { + ps->ReportError("Group does not support 'sync' method type", @1.begin.line); + $$ = NULL; + delete $5; + } else { + $$ = new tidl::Declaration($5->ToString(), + std::unique_ptr($4), + std::unique_ptr($7), $1->GetComments(), + @1.begin.line, tidl::Declaration::MethodType::SYNC, + $2); + delete $5; + } + } | T_VOID T_ID T_LEFT parameter_list T_RIGHT T_ASYNC T_SEMICOLON { $$ = new tidl::Declaration($2->ToString(), std::unique_ptr(new tidl::BaseType("void", $1->GetComments())), @@ -464,6 +483,19 @@ declaration: base_type T_ID T_LEFT parameter_list T_RIGHT T_SEMICOLON { delete $1; delete $2; } + | T_SB_OPEN attributes T_SB_CLOSE T_VOID T_ID T_LEFT parameter_list T_RIGHT T_ASYNC T_SEMICOLON { + if (ps->GetVersion() < 2) { + ps->ReportError("syntax error. \"method attributes is supported from protocol version 2\".", @1.begin.line); + ps->ReportError("try to use protocol version 2.", @1.begin.line); + } + + $$ = new tidl::Declaration($5->ToString(), + std::unique_ptr(new tidl::BaseType("void", $1->GetComments())), + std::unique_ptr($7), $1->GetComments(), + @1.begin.line, tidl::Declaration::MethodType::ASYNC, $2); + delete $4; + delete $5; + } | T_VOID T_ID T_LEFT parameter_list T_RIGHT T_DELEGATE T_SEMICOLON { if (ps->IsGroupEnabled()) { ps->ReportError("Group does not support 'delegate' method type", @1.begin.line); diff --git a/idlc/ast/tidlc_y.cpp b/idlc/ast/tidlc_y.cpp index 3bc3911..fa15c1f 100644 --- a/idlc/ast/tidlc_y.cpp +++ b/idlc/ast/tidlc_y.cpp @@ -238,18 +238,18 @@ static void yyerror (const yy::parser::location_type *yylocationp, yy::parser& y /* YYFINAL -- State number of the termination state. */ #define YYFINAL 23 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 649 +#define YYLAST 681 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 43 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 25 /* YYNRULES -- Number of rules. */ -#define YYNRULES 92 +#define YYNRULES 94 /* YYNRULES -- Number of states. */ -#define YYNSTATES 172 +#define YYNSTATES 188 /* YYMAXRHS -- Maximum number of symbols on right-hand side of rule. */ -#define YYMAXRHS 9 +#define YYMAXRHS 10 /* YYMAXLEFT -- Maximum number of symbols to the left of a handle accessed by $0, $-1, etc., in any rule. */ #define YYMAXLEFT 0 @@ -305,11 +305,11 @@ static const unsigned short int yyrline[] = 249, 262, 266, 270, 274, 278, 282, 288, 296, 307, 313, 318, 322, 326, 332, 340, 351, 357, 362, 368, 375, 381, 389, 395, 403, 408, 413, 420, 429, 440, - 446, 459, 467, 482, 487, 492, 497, 501, 505, 509, - 513, 519, 527, 538, 544, 547, 550, 555, 558, 562, - 568, 571, 577, 580, 597, 600, 604, 608, 612, 616, - 620, 624, 628, 638, 642, 646, 690, 717, 727, 740, - 744, 748, 756 + 446, 459, 478, 486, 499, 514, 519, 524, 529, 533, + 537, 541, 545, 551, 559, 570, 576, 579, 582, 587, + 590, 594, 600, 603, 609, 612, 629, 632, 636, 640, + 644, 648, 652, 656, 660, 670, 674, 678, 722, 749, + 759, 772, 776, 780, 788 }; #endif @@ -334,31 +334,32 @@ static const char *const yytname[] = }; #endif -#define YYPACT_NINF -76 -#define YYTABLE_NINF -76 +#define YYPACT_NINF -80 +#define YYTABLE_NINF -78 // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing // STATE-NUM. static const short int yypact[] = { - 4, 13, 14, 48, 51, 11, 4, -76, -76, -76, - -76, 82, 523, 41, 89, 590, 43, -76, 23, 7, - -76, -76, -76, -76, -76, 523, -76, -76, 60, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, 396, -76, 17, -76, 68, 108, 590, - -76, 53, -76, 180, -76, 57, -76, 570, -7, 6, - 73, 63, 432, 75, 121, -76, -76, 122, -76, 124, - 609, 128, 87, -76, 468, 216, 141, 144, 148, 146, - -76, -76, 150, 144, 154, 570, 252, -76, -76, -76, - -76, 140, -76, -76, -76, -76, -76, 22, 152, -76, - -76, 504, -76, -76, -76, -76, -76, -76, -76, 142, - 95, 609, -76, 143, -76, 144, -76, -76, 97, 144, - 288, -76, 156, 609, -76, 147, -76, 45, 551, -76, - -76, 99, 158, 102, -76, 570, 168, 69, 54, -76, - 160, 177, -76, 67, -76, 70, 570, 324, -76, -76, - 105, -76, -76, -76, -76, -76, 179, 181, -76, 183, - 184, 360, -76, 186, 187, -76, -76, -76, -76, -76, - -76, -76 + 37, 14, 19, 29, 80, 54, 37, -80, -80, -80, + -80, 95, 535, 0, 99, 603, 20, -80, 27, 7, + -80, -80, -80, -80, -80, 535, -80, -80, 12, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, 408, -80, 18, -80, 50, 120, 603, + -80, 63, 29, -80, 192, -80, 71, -80, 582, 31, + 4, 53, 55, 444, 70, 76, -80, -80, 87, -80, + 98, 622, 97, 100, -80, 480, 228, 111, 156, 119, + 13, 131, -80, -80, 133, 156, 165, 582, 264, -80, + -80, -80, -80, 151, -80, -80, -80, -80, -80, 9, + 163, -80, -80, 516, -80, -80, -80, -80, -80, -80, + -80, 153, 105, 622, -80, 155, -80, 156, 641, -80, + -80, 107, 156, 300, -80, 168, 622, -80, 158, -80, + 67, 563, -80, -80, 109, 160, 176, 166, 115, -80, + 582, 181, 45, 43, -80, 171, 191, -80, 64, 195, + 196, -80, 78, 582, 336, -80, -80, 121, -80, -80, + -80, -80, -80, 197, 198, 156, 156, -80, 199, 200, + 372, -80, 202, 203, -80, -80, 154, 159, -80, -80, + -80, -80, -80, 189, 205, 206, -80, -80 }; // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -368,38 +369,39 @@ static const unsigned char yydefact[] = { 0, 0, 0, 0, 0, 0, 2, 3, 7, 6, 5, 0, 0, 0, 0, 0, 0, 36, 0, 0, - 34, 9, 8, 1, 4, 0, 15, 33, 85, 76, - 77, 78, 79, 80, 81, 75, 82, 83, 84, 89, - 90, 91, 92, 0, 27, 0, 74, 0, 0, 0, - 46, 0, 73, 0, 47, 0, 72, 0, 0, 0, - 0, 0, 0, 0, 33, 13, 28, 0, 31, 0, - 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, - 44, 48, 0, 0, 0, 0, 0, 38, 39, 37, - 35, 0, 14, 86, 29, 32, 30, 0, 0, 12, - 17, 0, 10, 45, 60, 63, 64, 65, 66, 68, - 0, 0, 61, 0, 70, 0, 49, 59, 0, 0, - 0, 40, 0, 0, 87, 0, 11, 0, 67, 71, - 69, 0, 0, 0, 42, 0, 0, 24, 0, 19, - 0, 0, 62, 0, 56, 0, 0, 0, 88, 21, - 0, 18, 20, 57, 58, 55, 0, 0, 50, 0, - 0, 0, 41, 25, 26, 51, 52, 53, 54, 43, - 22, 23 + 34, 9, 8, 1, 4, 0, 15, 33, 87, 78, + 79, 80, 81, 82, 83, 77, 84, 85, 86, 91, + 92, 93, 94, 0, 27, 0, 76, 0, 0, 0, + 46, 0, 0, 75, 0, 47, 0, 74, 0, 0, + 0, 0, 0, 0, 0, 33, 13, 28, 0, 31, + 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, + 0, 0, 44, 48, 0, 0, 0, 0, 0, 38, + 39, 37, 35, 0, 14, 88, 29, 32, 30, 0, + 0, 12, 17, 0, 10, 45, 62, 65, 66, 67, + 68, 70, 0, 0, 63, 0, 72, 0, 0, 49, + 61, 0, 0, 0, 40, 0, 0, 89, 0, 11, + 0, 69, 73, 71, 0, 0, 0, 0, 0, 42, + 0, 0, 24, 0, 19, 0, 0, 64, 0, 0, + 0, 58, 0, 0, 0, 90, 21, 0, 18, 20, + 59, 60, 57, 0, 0, 0, 0, 50, 0, 0, + 0, 41, 25, 26, 52, 54, 0, 0, 55, 56, + 43, 22, 23, 0, 0, 0, 51, 53 }; // YYPGOTO[NTERM-NUM]. static const short int yypgoto[] = { - -76, -76, -76, 188, -76, -76, -55, -68, -76, 55, - -20, -33, -76, 126, -76, -48, -53, -75, -76, 71, - -76, -64, -9, -76, -76 + -80, -80, -80, 207, -80, -80, -55, -62, -80, 59, + -17, -30, 157, 170, -80, -48, -54, -79, -80, 83, + -80, -69, -8, -80, -80 }; // YYDEFGOTO[NTERM-NUM]. static const short int yydefgoto[] = { - -1, 5, 6, 7, 8, 9, 72, 73, 138, 139, - 43, 44, 19, 20, 10, 53, 54, 110, 111, 112, - 113, 55, 56, 46, 47 + -1, 5, 6, 7, 8, 9, 73, 74, 143, 144, + 43, 44, 19, 20, 10, 54, 55, 112, 113, 114, + 115, 56, 57, 46, 47 }; // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -407,140 +409,148 @@ static const short int yydefgoto[] = // number is the opposite. If YYTABLE_NINF, syntax error. static const short int yytable[] = { - 81, 75, 85, 45, 100, 62, 97, 88, 118, 86, - 66, 23, 60, 114, 11, 14, 45, 100, 67, 114, - 12, 15, 81, 68, 58, 1, 2, 123, 74, 66, - 87, 13, 16, 81, 45, 69, 124, 120, 59, 45, - 131, 66, 3, 89, 133, 4, 61, 129, 48, 17, - 57, 114, 101, 45, 76, 114, 77, 140, 82, 136, - 83, 141, 151, 45, 114, 45, 18, 81, 66, 21, - 22, 78, 137, 155, 149, 84, 158, 63, 100, 156, - 146, 70, 159, 157, 150, 91, 160, 147, 27, 25, - 26, 18, 45, 93, 81, 99, 49, 50, 161, 127, - 128, 132, 128, 143, 128, 28, 145, 128, 81, 27, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 163, 164, 28, 94, 95, 71, - 96, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 105, 98, 104, -67, -67, - 71, 115, 116, 106, 107, 108, 117, 119, 122, 125, - -75, 130, 28, 135, 144, 137, 153, 29, 30, 31, - 32, 33, 34, 109, 36, 37, 38, 39, 40, 41, - 42, 79, 148, 154, 52, 165, 90, 166, 80, 167, - 168, 170, 171, 152, 24, 0, 0, 0, 28, 142, - 0, 0, 0, 29, 30, 31, 32, 33, 34, 51, - 36, 37, 38, 39, 40, 41, 42, 79, 0, 0, - 52, 0, 0, 0, 103, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 28, 0, 0, 0, 0, 29, - 30, 31, 32, 33, 34, 51, 36, 37, 38, 39, - 40, 41, 42, 79, 0, 0, 52, 0, 0, 0, - 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 28, 0, 0, 0, 0, 29, 30, 31, 32, 33, - 34, 51, 36, 37, 38, 39, 40, 41, 42, 79, - 0, 0, 52, 0, 0, 0, 134, 0, 0, 0, + 83, 76, 99, 87, 45, 90, 121, 48, 63, 116, + 88, 102, 61, 67, 126, 11, 116, 45, 61, 68, + 14, 12, 83, 127, 69, 102, 15, 58, 59, 64, + 17, 75, 13, 67, 83, 45, 70, 16, 134, 123, + 45, 91, 60, 138, 132, 67, 62, 18, 116, 136, + 156, 158, 118, 116, 23, 45, 103, 141, 1, 2, + 157, 142, 116, 71, 77, 45, 78, 45, 89, 83, + 162, 18, 84, 67, 85, 3, 163, 93, 4, 145, + 164, 79, 96, 146, 167, 153, 176, 177, 95, 86, + 168, 102, 154, 97, 169, 45, 116, 116, 21, 22, + 83, 27, 25, 26, 98, 170, 49, 50, 101, 130, + 131, 137, 131, 148, 131, 100, 83, 106, 28, 152, + 131, 27, 117, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 119, 28, 120, + 172, 173, 72, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 107, 183, 131, + -69, -69, 72, 184, 131, 108, 109, 110, 122, 125, + 128, -77, 151, 133, 28, 140, 142, 160, 149, 29, + 30, 31, 32, 33, 34, 111, 36, 37, 38, 39, + 40, 41, 42, 81, 150, 155, 53, 161, 165, 166, + 82, 185, 159, 174, 175, 178, 179, 181, 182, 80, + 28, 186, 187, 24, 147, 29, 30, 31, 32, 33, + 34, 51, 36, 37, 38, 39, 40, 41, 42, 81, + 52, 92, 53, 0, 0, 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 29, 30, 31, 32, 33, 34, 51, 36, 37, - 38, 39, 40, 41, 42, 79, 0, 0, 52, 0, - 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, + 38, 39, 40, 41, 42, 81, 52, 0, 53, 0, + 0, 0, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 29, 30, 31, 32, 33, 34, 51, 36, 37, 38, 39, 40, 41, - 42, 79, 0, 0, 52, 0, 0, 0, 169, 0, + 42, 81, 52, 0, 53, 0, 0, 0, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 29, 30, 31, 32, 33, 34, 51, - 36, 37, 38, 39, 40, 41, 42, 64, 0, 0, - 52, 0, 0, 0, 65, 0, 0, 0, 0, 0, + 36, 37, 38, 39, 40, 41, 42, 81, 52, 0, + 53, 0, 0, 0, 171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 64, 0, 0, 0, 0, 0, 0, - 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 30, 31, 32, 33, 34, 51, 36, 37, 38, 39, + 40, 41, 42, 81, 52, 0, 53, 0, 0, 0, + 180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 64, - 0, 0, 0, 0, 0, 0, 102, 0, 0, 0, + 34, 51, 36, 37, 38, 39, 40, 41, 42, 65, + 52, 0, 53, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 64, 0, 0, 0, 0, - 0, 0, 126, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 28, 0, 27, 0, 0, 29, 30, 31, + 38, 39, 40, 41, 42, 65, 0, 0, 0, 0, + 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 0, 0, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 28, 0, 0, 0, 0, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 106, 107, 108, 0, 0, 0, 0, 0, 0, 28, - 0, 0, 0, 0, 29, 30, 31, 32, 33, 34, - 109, 36, 37, 38, 39, 40, 41, 42, 28, 0, - 0, 52, 0, 29, 30, 31, 32, 33, 34, 51, - 36, 37, 38, 39, 40, 41, 42, 0, 28, 0, - 52, 0, 71, 29, 30, 31, 32, 33, 34, 51, - 36, 37, 38, 39, 40, 41, 42, 28, 0, 0, - 52, 0, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 0, 0, 0, 52 + 42, 65, 0, 0, 0, 0, 0, 0, 104, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, + 0, 0, 0, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 65, 0, 0, + 0, 0, 0, 0, 129, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 28, 0, 27, 0, 0, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 28, 0, 0, 0, 0, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 108, 109, 110, 0, 0, 0, 0, 0, + 0, 28, 0, 0, 0, 0, 29, 30, 31, 32, + 33, 34, 111, 36, 37, 38, 39, 40, 41, 42, + 28, 0, 0, 53, 0, 29, 30, 31, 32, 33, + 34, 51, 36, 37, 38, 39, 40, 41, 42, 0, + 52, 28, 53, 0, 72, 0, 29, 30, 31, 32, + 33, 34, 51, 36, 37, 38, 39, 40, 41, 42, + 28, 52, 0, 53, 0, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 28, + 0, 0, 53, 0, 29, 30, 31, 32, 33, 34, + 135, 36, 37, 38, 39, 40, 41, 42, 0, 0, + 0, 53 }; static const short int yycheck[] = { - 53, 49, 57, 12, 72, 25, 70, 1, 83, 57, - 43, 0, 5, 77, 1, 1, 25, 85, 1, 83, - 7, 7, 75, 6, 1, 21, 22, 5, 48, 62, - 37, 18, 18, 86, 43, 18, 14, 85, 15, 48, - 115, 74, 38, 37, 119, 41, 39, 111, 7, 1, - 7, 115, 72, 62, 1, 119, 3, 12, 1, 123, - 3, 16, 8, 72, 128, 74, 18, 120, 101, 18, - 19, 18, 18, 6, 5, 18, 6, 17, 146, 12, - 135, 13, 12, 16, 15, 22, 16, 135, 1, 7, - 8, 18, 101, 18, 147, 8, 7, 8, 146, 4, - 5, 4, 5, 4, 5, 18, 4, 5, 161, 1, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 19, 20, 18, 6, 6, 42, - 6, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 1, 18, 6, 4, 5, - 42, 3, 6, 9, 10, 11, 6, 3, 18, 7, - 18, 18, 18, 7, 6, 18, 6, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 1, 14, 6, 40, 6, 60, 6, 8, 6, - 6, 5, 5, 138, 6, -1, -1, -1, 18, 128, - -1, -1, -1, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 1, -1, -1, - 40, -1, -1, -1, 8, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 18, -1, -1, -1, -1, 23, + 54, 49, 71, 58, 12, 1, 85, 7, 25, 78, + 58, 73, 5, 43, 5, 1, 85, 25, 5, 1, + 1, 7, 76, 14, 6, 87, 7, 7, 1, 17, + 1, 48, 18, 63, 88, 43, 18, 18, 117, 87, + 48, 37, 15, 122, 113, 75, 39, 18, 117, 118, + 5, 8, 39, 122, 0, 63, 73, 126, 21, 22, + 15, 18, 131, 13, 1, 73, 3, 75, 37, 123, + 6, 18, 1, 103, 3, 38, 12, 22, 41, 12, + 16, 18, 6, 16, 6, 140, 165, 166, 18, 18, + 12, 153, 140, 6, 16, 103, 165, 166, 18, 19, + 154, 1, 7, 8, 6, 153, 7, 8, 8, 4, + 5, 4, 5, 4, 5, 18, 170, 6, 18, 4, + 5, 1, 3, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 6, 18, 6, + 19, 20, 42, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 1, 4, 5, + 4, 5, 42, 4, 5, 9, 10, 11, 3, 18, + 7, 18, 6, 18, 18, 7, 18, 6, 18, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 1, -1, -1, 40, -1, -1, -1, - 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 18, -1, -1, -1, -1, 23, 24, 25, 26, 27, + 34, 35, 36, 1, 18, 14, 40, 6, 3, 3, + 8, 12, 143, 6, 6, 6, 6, 5, 5, 52, + 18, 6, 6, 6, 131, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 1, - -1, -1, 40, -1, -1, -1, 8, -1, -1, -1, + 38, 61, 40, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 1, -1, -1, 40, -1, + 32, 33, 34, 35, 36, 1, 38, -1, 40, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 1, -1, -1, 40, -1, -1, -1, 8, -1, + 36, 1, 38, -1, 40, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 1, -1, -1, + 30, 31, 32, 33, 34, 35, 36, 1, 38, -1, 40, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 1, -1, -1, -1, -1, -1, -1, + 34, 35, 36, 1, 38, -1, 40, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 1, - -1, -1, -1, -1, -1, -1, 8, -1, -1, -1, + 38, -1, 40, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 1, -1, -1, -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 18, -1, 1, -1, -1, 23, 24, 25, + -1, -1, 18, -1, -1, -1, -1, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 18, -1, -1, -1, -1, 23, 24, 25, 26, + 36, 1, -1, -1, -1, -1, -1, -1, 8, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, + -1, -1, -1, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 1, -1, -1, + -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 18, -1, 1, -1, -1, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 18, -1, -1, -1, -1, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 9, 10, 11, -1, -1, -1, -1, -1, + -1, 18, -1, -1, -1, -1, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 9, 10, 11, -1, -1, -1, -1, -1, -1, 18, - -1, -1, -1, -1, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 18, -1, - -1, 40, -1, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, -1, 18, -1, - 40, -1, 42, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 18, -1, -1, - 40, -1, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, -1, -1, -1, 40 + 18, -1, -1, 40, -1, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, -1, + 38, 18, 40, -1, 42, -1, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 18, 38, -1, 40, -1, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 18, + -1, -1, 40, -1, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, -1, -1, + -1, 40 }; // YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -552,19 +562,20 @@ static const unsigned char yystos[] = 56, 18, 19, 0, 46, 7, 8, 1, 18, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 53, 54, 65, 66, 67, 7, 7, - 8, 29, 40, 58, 59, 64, 65, 7, 1, 15, - 5, 39, 53, 17, 1, 8, 54, 1, 6, 18, - 13, 42, 49, 50, 53, 58, 1, 3, 18, 1, - 8, 59, 1, 3, 18, 49, 58, 37, 1, 37, - 56, 22, 8, 18, 6, 6, 6, 64, 18, 8, - 50, 53, 8, 8, 6, 1, 9, 10, 11, 29, - 60, 61, 62, 63, 64, 3, 6, 6, 60, 3, - 58, 8, 18, 5, 14, 7, 8, 4, 5, 64, - 18, 60, 4, 60, 8, 7, 64, 18, 51, 52, - 12, 16, 62, 4, 6, 4, 49, 58, 14, 5, - 15, 8, 52, 6, 6, 6, 12, 16, 6, 12, - 16, 58, 8, 19, 20, 6, 6, 6, 6, 8, - 5, 5 + 8, 29, 38, 40, 58, 59, 64, 65, 7, 1, + 15, 5, 39, 53, 17, 1, 8, 54, 1, 6, + 18, 13, 42, 49, 50, 53, 58, 1, 3, 18, + 55, 1, 8, 59, 1, 3, 18, 49, 58, 37, + 1, 37, 56, 22, 8, 18, 6, 6, 6, 64, + 18, 8, 50, 53, 8, 8, 6, 1, 9, 10, + 11, 29, 60, 61, 62, 63, 64, 3, 39, 6, + 6, 60, 3, 58, 8, 18, 5, 14, 7, 8, + 4, 5, 64, 18, 60, 29, 64, 4, 60, 8, + 7, 64, 18, 51, 52, 12, 16, 62, 4, 18, + 18, 6, 4, 49, 58, 14, 5, 15, 8, 52, + 6, 6, 6, 12, 16, 3, 3, 6, 12, 16, + 58, 8, 19, 20, 6, 6, 60, 60, 6, 6, + 8, 5, 5, 4, 4, 12, 6, 6 }; // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. @@ -576,10 +587,10 @@ static const unsigned char yyr1[] = 54, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 57, 57, 57, 57, 58, 58, 58, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, - 63, 63, 64, 64, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 66, 66, 67, - 67, 67, 67 + 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, + 62, 62, 63, 63, 64, 64, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 66, + 66, 67, 67, 67, 67 }; // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. @@ -590,11 +601,11 @@ static const unsigned char yyr2[] = 2, 2, 4, 4, 1, 3, 3, 1, 2, 3, 3, 2, 3, 1, 1, 3, 1, 3, 3, 3, 5, 8, 6, 9, 4, 5, 3, 1, 2, 3, - 6, 7, 7, 7, 7, 6, 5, 6, 6, 3, - 3, 1, 3, 1, 1, 1, 1, 0, 1, 2, - 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 4, 6, 1, - 1, 1, 1 + 6, 9, 7, 10, 7, 7, 7, 6, 5, 6, + 6, 3, 3, 1, 3, 1, 1, 1, 1, 0, + 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, + 6, 1, 1, 1, 1 }; @@ -610,7 +621,7 @@ static const unsigned char yydprec[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0 + 0, 0, 0, 0, 0 }; /* YYMERGER[RULE-NUM] -- Index of merging function for rule #RULE-NUM. */ @@ -625,7 +636,7 @@ static const unsigned char yymerger[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0 + 0, 0, 0, 0, 0 }; /* YYIMMEDIATE[RULE-NUM] -- True iff rule #RULE-NUM is not to be deferred, as @@ -641,7 +652,7 @@ static const yybool yyimmediate[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0 + 0, 0, 0, 0, 0 }; /* YYCONFLP[YYPACT[STATE-NUM]] -- Pointer into YYCONFL of start of @@ -714,7 +725,11 @@ static const unsigned char yyconflp[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0 }; /* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by @@ -1202,7 +1217,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, { ps->SetDoc((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.doc)); } -#line 1206 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1221 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 3: @@ -1213,7 +1228,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, if ((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk) != NULL) ((*yyvalp).doc)->AddBlock((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk)); } -#line 1217 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1232 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 4: @@ -1230,7 +1245,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } } } -#line 1234 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1249 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 5: @@ -1239,7 +1254,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).blk) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.interf); currentInterfaceEnums = nullptr; } -#line 1243 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1258 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 6: @@ -1248,7 +1263,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).blk) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.structure); currentInterfaceEnums = nullptr; } -#line 1252 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1267 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 7: @@ -1256,7 +1271,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, { ((*yyvalp).blk) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk); } -#line 1260 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1275 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 8: @@ -1274,7 +1289,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.token); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 1278 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1293 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 9: @@ -1286,7 +1301,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.token); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 1290 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1305 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 10: @@ -1297,7 +1312,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token); } -#line 1301 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1316 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 11: @@ -1308,7 +1323,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token); } -#line 1312 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1327 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 12: @@ -1319,7 +1334,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token); } -#line 1323 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1338 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 13: @@ -1329,7 +1344,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).structure) = NULL; delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token); } -#line 1333 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1348 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 14: @@ -1340,7 +1355,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).structure) = NULL; delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token); } -#line 1344 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1359 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 15: @@ -1350,7 +1365,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).structure) = NULL; delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token); } -#line 1354 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1369 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 16: @@ -1364,7 +1379,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } } } -#line 1368 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1383 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 17: @@ -1380,7 +1395,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } } } -#line 1384 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1399 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 18: @@ -1390,7 +1405,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yyloc).begin.line); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token); } -#line 1394 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1409 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 19: @@ -1403,7 +1418,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } } } -#line 1407 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1422 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 20: @@ -1419,7 +1434,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } } } -#line 1423 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1438 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 21: @@ -1428,7 +1443,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).enum_field) = new (std::nothrow) tidl::Field((((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.token)->ToString(), "", (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.token)->GetComments(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line); } -#line 1432 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1447 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 22: @@ -1437,7 +1452,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).enum_field) = new (std::nothrow) tidl::Field((((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->GetComments(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line); } -#line 1441 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1456 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 23: @@ -1446,7 +1461,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).enum_field) = new (std::nothrow) tidl::Field((((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->GetComments(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line); } -#line 1450 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1465 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 24: @@ -1455,7 +1470,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).enum_field) = new (std::nothrow) tidl::Field((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->ToString(), "", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments(), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line); } -#line 1459 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1474 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 25: @@ -1464,7 +1479,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).enum_field) = new (std::nothrow) tidl::Field((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token)->GetComments(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yyloc).begin.line); } -#line 1468 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1483 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 26: @@ -1473,7 +1488,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).enum_field) = new (std::nothrow) tidl::Field((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token)->GetComments(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yyloc).begin.line); } -#line 1477 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1492 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 27: @@ -1486,7 +1501,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } } } -#line 1490 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1505 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 28: @@ -1502,7 +1517,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } } } -#line 1506 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1521 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 29: @@ -1511,7 +1526,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ps->ReportError("syntax error in elements declarations.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yyloc).begin.line); ((*yyvalp).elms) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.elms); } -#line 1515 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1530 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 30: @@ -1521,7 +1536,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yyloc).begin.line); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.token); } -#line 1525 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1540 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 31: @@ -1530,7 +1545,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ps->ReportError("syntax error. \"No identifier\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line); ((*yyvalp).elm) = NULL; } -#line 1534 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1549 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 32: @@ -1539,7 +1554,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ps->ReportError("syntax error in element declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line); ((*yyvalp).elm) = NULL; } -#line 1543 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1558 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 33: @@ -1548,7 +1563,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ps->ReportError("syntax error in element declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line); ((*yyvalp).elm) = NULL; } -#line 1552 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1567 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 34: @@ -1561,7 +1576,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } } } -#line 1565 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1580 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 35: @@ -1577,7 +1592,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } } } -#line 1581 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1596 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 36: @@ -1586,7 +1601,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ps->ReportError("syntax error in attributes", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line); ((*yyvalp).attrs) = new tidl::Attributes(); } -#line 1590 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1605 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 37: @@ -1596,7 +1611,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 1600 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1615 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 38: @@ -1607,7 +1622,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 1611 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1626 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 39: @@ -1617,7 +1632,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).attr) = NULL; delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token); } -#line 1621 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1636 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 40: @@ -1628,7 +1643,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token); } -#line 1632 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1647 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 41: @@ -1641,7 +1656,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token); } -#line 1645 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1660 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 42: @@ -1652,7 +1667,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token); } -#line 1656 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1671 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 43: @@ -1665,7 +1680,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token); } -#line 1669 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1684 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 44: @@ -1675,7 +1690,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).interf) = NULL; delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token); } -#line 1679 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1694 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 45: @@ -1685,7 +1700,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).interf) = NULL; delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token); } -#line 1689 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1704 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 46: @@ -1695,7 +1710,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).interf) = NULL; delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token); } -#line 1699 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1714 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 47: @@ -1709,7 +1724,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } } } -#line 1713 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1728 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 48: @@ -1725,7 +1740,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } } } -#line 1729 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1744 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 49: @@ -1734,7 +1749,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ps->ReportError("syntax error in methods declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line); ((*yyvalp).decls) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.decls); } -#line 1738 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1753 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 50: @@ -1752,12 +1767,36 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token); } } -#line 1756 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1771 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; case 51: #line 459 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { + if (ps->GetVersion() < 2) { + ps->ReportError("syntax error. \"method attributes is supported from protocol version 2\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (-8)].yystate.yyloc).begin.line); + ps->ReportError("try to use protocol version 2.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-8)].yystate.yyloc).begin.line); + } + + if (ps->IsGroupEnabled()) { + ps->ReportError("Group does not support 'sync' method type", (((yyGLRStackItem const *)yyvsp)[YYFILL (-8)].yystate.yyloc).begin.line); + ((*yyvalp).decl) = NULL; + delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token); + } else { + ((*yyvalp).decl) = new tidl::Declaration((((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token)->ToString(), + std::unique_ptr((((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.b_type)), + std::unique_ptr((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.params)), (((yyGLRStackItem const *)yyvsp)[YYFILL (-8)].yystate.yysemantics.yysval.token)->GetComments(), + (((yyGLRStackItem const *)yyvsp)[YYFILL (-8)].yystate.yyloc).begin.line, tidl::Declaration::MethodType::SYNC, + (((yyGLRStackItem const *)yyvsp)[YYFILL (-7)].yystate.yysemantics.yysval.attrs)); + delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token); + } + } +#line 1795 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 + break; + + case 52: +#line 478 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + { ((*yyvalp).decl) = new tidl::Declaration((((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token)->ToString(), std::unique_ptr(new tidl::BaseType("void", (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token)->GetComments())), std::unique_ptr((((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.params)), (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token)->GetComments(), @@ -1765,11 +1804,29 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token); } -#line 1769 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1808 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 52: -#line 467 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 53: +#line 486 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + { + if (ps->GetVersion() < 2) { + ps->ReportError("syntax error. \"method attributes is supported from protocol version 2\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (-9)].yystate.yyloc).begin.line); + ps->ReportError("try to use protocol version 2.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-9)].yystate.yyloc).begin.line); + } + + ((*yyvalp).decl) = new tidl::Declaration((((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token)->ToString(), + std::unique_ptr(new tidl::BaseType("void", (((yyGLRStackItem const *)yyvsp)[YYFILL (-9)].yystate.yysemantics.yysval.token)->GetComments())), + std::unique_ptr((((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.params)), (((yyGLRStackItem const *)yyvsp)[YYFILL (-9)].yystate.yysemantics.yysval.token)->GetComments(), + (((yyGLRStackItem const *)yyvsp)[YYFILL (-9)].yystate.yyloc).begin.line, tidl::Declaration::MethodType::ASYNC, (((yyGLRStackItem const *)yyvsp)[YYFILL (-8)].yystate.yysemantics.yysval.attrs)); + delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token); + delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token); + } +#line 1826 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 + break; + + case 54: +#line 499 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { if (ps->IsGroupEnabled()) { ps->ReportError("Group does not support 'delegate' method type", (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yyloc).begin.line); @@ -1785,86 +1842,86 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token); } } -#line 1789 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1846 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 53: -#line 482 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 55: +#line 514 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ps->ReportError("syntax error in method declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yyloc).begin.line); ((*yyvalp).decl) = NULL; delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token); } -#line 1799 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1856 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 54: -#line 487 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 56: +#line 519 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ps->ReportError("syntax error in method declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yyloc).begin.line); ((*yyvalp).decl) = NULL; delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token); } -#line 1809 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1866 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 55: -#line 492 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 57: +#line 524 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ps->ReportError("syntax error. \"No async\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line); ((*yyvalp).decl) = NULL; delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token); } -#line 1819 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1876 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 56: -#line 497 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 58: +#line 529 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ps->ReportError("syntax error. \"No identifier\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line); ((*yyvalp).decl) = NULL; } -#line 1828 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1885 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 57: -#line 501 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 59: +#line 533 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ps->ReportError("syntax error. \"No identifier\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yyloc).begin.line); ((*yyvalp).decl) = NULL; } -#line 1837 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1894 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 58: -#line 505 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 60: +#line 537 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ps->ReportError("syntax error. \"No identifier\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yyloc).begin.line); ((*yyvalp).decl) = NULL; } -#line 1846 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1903 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 59: -#line 509 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 61: +#line 541 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ps->ReportError("syntax error in method declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line); ((*yyvalp).decl) = NULL; } -#line 1855 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1912 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 60: -#line 513 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 62: +#line 545 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ps->ReportError("syntax error in method declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line); ((*yyvalp).decl) = NULL; } -#line 1864 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1921 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 61: -#line 519 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 63: +#line 551 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).params) = new tidl::Parameters(); if (((*yyvalp).params) != nullptr) { @@ -1873,11 +1930,11 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } } } -#line 1877 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1934 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 62: -#line 527 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 64: +#line 559 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).params) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.params); if ((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param) != nullptr) { @@ -1889,95 +1946,95 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } } } -#line 1893 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1950 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 63: -#line 538 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 65: +#line 570 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ps->ReportError("syntax error in parameter list", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line); ((*yyvalp).params) = new tidl::Parameters(); } -#line 1902 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1959 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 64: -#line 544 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 66: +#line 576 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).direction) = new tidl::Token("in", ""); } -#line 1910 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1967 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 65: -#line 547 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 67: +#line 579 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).direction) = new tidl::Token("out", ""); } -#line 1918 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1975 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 66: -#line 550 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 68: +#line 582 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).direction) = new tidl::Token("ref", ""); } -#line 1926 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1983 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 67: -#line 555 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 69: +#line 587 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).param) = nullptr; } -#line 1934 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 1991 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 68: -#line 558 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 70: +#line 590 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).param) = nullptr; delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 1943 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2000 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 69: -#line 562 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 71: +#line 594 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).param) = new tidl::Parameter((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.p_type), (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 1952 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2009 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 70: -#line 568 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 72: +#line 600 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).p_type) = new tidl::ParameterType((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.b_type)); } -#line 1960 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2017 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 71: -#line 571 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 73: +#line 603 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).p_type) = new tidl::ParameterType((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.b_type), (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.direction)->ToString()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.direction); } -#line 1969 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2026 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 72: -#line 577 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 74: +#line 609 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).b_type) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.b_type); } -#line 1977 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2034 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 73: -#line 580 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 75: +#line 612 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { if (ps->IsGroupEnabled()) { ps->ReportError("Group does not support 'file' type", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line); @@ -1993,82 +2050,82 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } } -#line 1997 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2054 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 74: -#line 597 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 76: +#line 629 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).b_type) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.b_type); } -#line 2005 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2062 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 75: -#line 600 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 77: +#line 632 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).b_type) = new tidl::BaseType("void", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2014 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2071 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 76: -#line 604 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 78: +#line 636 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).b_type) = new tidl::BaseType("char", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2023 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2080 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 77: -#line 608 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 79: +#line 640 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).b_type) = new tidl::BaseType("short", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2032 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2089 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 78: -#line 612 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 80: +#line 644 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).b_type) = new tidl::BaseType("int", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2041 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2098 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 79: -#line 616 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 81: +#line 648 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).b_type) = new tidl::BaseType("long", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2050 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2107 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 80: -#line 620 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 82: +#line 652 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).b_type) = new tidl::BaseType("float", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2059 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2116 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 81: -#line 624 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 83: +#line 656 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).b_type) = new tidl::BaseType("double", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2068 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2125 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 82: -#line 628 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 84: +#line 660 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { if (ps->IsCionEnabled()) { ps->ReportError("Cion does not support 'bundle' type", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line); @@ -2079,29 +2136,29 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } } -#line 2083 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2140 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 83: -#line 638 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 85: +#line 670 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).b_type) = new tidl::BaseType("string", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2092 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2149 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 84: -#line 642 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 86: +#line 674 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).b_type) = new tidl::BaseType("bool", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2101 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2158 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 85: -#line 646 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 87: +#line 678 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { bool found = false; tidl::BaseType::UserType type; @@ -2146,11 +2203,11 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2150 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2207 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 86: -#line 690 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 88: +#line 722 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { bool found = false; if (document) { @@ -2176,11 +2233,11 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, } delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token); } -#line 2180 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2237 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 87: -#line 717 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 89: +#line 749 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { if ((((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->ToString() == "map") { ps->ReportError("syntax error. The value must be existed.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line); @@ -2191,11 +2248,11 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token); } } -#line 2195 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2252 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 88: -#line 727 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 90: +#line 759 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { if ((((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token)->ToString() != "map") { ps->ReportError("syntax error. The container type must be \"map\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yyloc).begin.line); @@ -2207,29 +2264,29 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token); } } -#line 2211 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2268 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 89: -#line 740 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 91: +#line 772 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).token) = new tidl::Token("list", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2220 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2277 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 90: -#line 744 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 92: +#line 776 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { ((*yyvalp).token) = new tidl::Token("array", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2229 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2286 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 91: -#line 748 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 93: +#line 780 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { if (ps->GetVersion() < 2) { ps->ReportError("syntax error. \"No identifier\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line); @@ -2238,11 +2295,11 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).token) = new tidl::Token("map", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2242 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2299 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; - case 92: -#line 756 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 + case 94: +#line 788 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816 { if (ps->GetVersion() < 2) { ps->ReportError("syntax error. \"No identifier\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line); @@ -2251,11 +2308,11 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, ((*yyvalp).token) = new tidl::Token("set", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments()); delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token); } -#line 2255 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2312 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 break; -#line 2259 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 +#line 2316 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816 default: break; } @@ -2352,7 +2409,7 @@ yylhsNonterm (yyRuleNum yyrule) } #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-76))) + (!!((Yystate) == (-80))) /** True iff LR state YYSTATE has only a default reduction (regardless * of token). */ @@ -3730,7 +3787,7 @@ yyparse (yy::parser& yyparser, tidl::Parser* ps) /* User initialization code. */ yylloc.initialize (); -#line 3734 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:2270 +#line 3791 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:2270 if (! yyinitGLRStack (yystackp, YYINITDEPTH)) goto yyexhaustedlab; @@ -4031,7 +4088,7 @@ yypdumpstack (yyGLRStack* yystackp) -#line 766 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:2584 +#line 798 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:2584 #include @@ -4043,7 +4100,7 @@ void yy::parser::error(const yy::parser::location_type& l, } -#line 4047 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:2584 +#line 4104 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:2584 /*------------------. | Report an error. | @@ -4060,7 +4117,7 @@ yyerror (const yy::parser::location_type *yylocationp, yy::parser& yyparser, tid namespace yy { -#line 4064 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:2584 +#line 4121 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:2584 /// Build a parser object. parser::parser (tidl::Parser* ps_yyarg) : @@ -4141,4 +4198,4 @@ namespace yy { #endif } // yy -#line 4145 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:2584 +#line 4202 "/opt/data/tizen/public/platform/core/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:2584 diff --git a/idlc/gen/version2/c_stub_body_generator.cc b/idlc/gen/version2/c_stub_body_generator.cc index adb29f8..3479ae0 100644 --- a/idlc/gen/version2/c_stub_body_generator.cc +++ b/idlc/gen/version2/c_stub_body_generator.cc @@ -31,6 +31,7 @@ void CStubBodyGenerator::OnInitGen(std::ofstream& stream) { GenVersion(stream); GenGNUSourceDefinition(stream); GenIncludeDefaultHeaders(stream); + GenIncludePrivateHeaders(stream); GenIncludeHeader(stream); GenLogTag(stream, std::string("RPC_PORT_STUB")); GenLogDefinition(stream); @@ -53,6 +54,10 @@ void CStubBodyGenerator::OnInitGen(std::ofstream& stream) { void CStubBodyGenerator::OnFiniGen(std::ofstream& stream) { } +void CStubBodyGenerator::GenIncludePrivateHeaders(std::ofstream& stream) { + stream << CB_PRIVATE_HEADERS; +} + void CStubBodyGenerator::GenDelegateDefinition(std::ofstream& stream) { stream << SmartIndent(CB_DELEGATE_DEFS); } @@ -285,9 +290,11 @@ void CStubBodyGenerator::GenInterface(std::ofstream& stream, const Interface& if if (d->GetMethodType() == Declaration::MethodType::DELEGATE) continue; + GenInterfaceMethodPrivilegeCheckerBase(stream, iface, *d); GenInterfaceMethodHandlerBase(stream, iface, *d); } + GenInterfaceMethodPrivilegeCheckerTable(stream, iface); GenInterfaceMethodTable(stream, iface); GenInterfaceContextBase(stream, iface); GenInterfaceRemoteExceptionBase(stream, iface); @@ -301,12 +308,13 @@ void CStubBodyGenerator::GenInterface(std::ofstream& stream, const Interface& if // @see #CB_INTERFACE_CONTEXT_BASE void CStubBodyGenerator::GenInterfaceContextBase(std::ofstream& stream, const Interface& iface) { - std::string code(ReplaceAll(CB_INTERFACE_CONTEXT_BASE, { - { "", GetHandlePrefix() }, - { "", iface.GetID() } - })); - - stream << SmartIndent(code); + ReplaceAll(CB_INTERFACE_CONTEXT_BASE) + .Change("", GetHandlePrefix()) + .Change("", iface.GetID()) + .ChangeToUpper("", GetHandlePrefix()) + .ChangeToUpper("", iface.GetID()) + .Transform([&](std::string code) { return SmartIndent(code); }) + .Out(stream); } // @see #CB_INTERFACE_REMOTE_EXCEPTION_BASE @@ -636,6 +644,33 @@ std::string CStubBodyGenerator::GenMethodHandlerArgsFree(const Interface& iface, return RemoveLine(code); } +std::string CStubBodyGenerator::GenPrivileges(const Declaration& decl) { + std::string code; + for (const auto& attr : decl.GetAttributes()) { + if (attr->GetKey() != "privilege") + continue; + + code += "\"" + attr->GetValue() + "\"," + NLine(1); + } + + return code; +} + +// @see #CB_INTERFACE_METHOD_PRIVILEGE_CHECKER_BASE +void CStubBodyGenerator::GenInterfaceMethodPrivilegeCheckerBase( + std::ofstream& stream, const Interface& iface, const Declaration& decl) { + std::string sync = + (decl.GetMethodType() == Declaration::MethodType::SYNC) ? "true" : "false"; + ReplaceAll(CB_INTERFACE_METHOD_PRIVILEGE_CHECKER_BASE) + .Change("", GetHandlePrefix()) + .Change("", iface.GetID()) + .Change("", decl.GetID()) + .Change("", GenPrivileges(decl)) + .Change("", sync) + .Transform([&](std::string code) { return SmartIndent(code); }) + .Out(stream); +} + // @see #CB_INTERFACE_METHOD_HANDLER_BASE void CStubBodyGenerator::GenInterfaceMethodHandlerBase(std::ofstream& stream, const Interface& iface, const Declaration& decl) { @@ -656,6 +691,37 @@ void CStubBodyGenerator::GenInterfaceMethodHandlerBase(std::ofstream& stream, stream << SmartIndent(code); } +// @ see #CB_INTERFACE_PRIVILEGE_CHECKER +std::string CStubBodyGenerator::GenPrivilegeCheckers(const Interface& iface) { + std::string code; + for (const auto& decl : iface.GetDeclarations()) { + if (decl->GetMethodType() == Declaration::MethodType::DELEGATE) + continue; + + std::string enum_value = GetHandlePrefix() + "_" + iface.GetID() + + "_METHOD_" + decl->GetID(); + code += ReplaceAll(CB_INTERFACE_PRIVILEGE_CHECKER) + .Change("", GetHandlePrefix()) + .Change("", iface.GetID()) + .Change("", decl->GetID()) + .ChangeToUpper("", enum_value) + .Transform([&](std::string str) { return RemoveLine(str); }); + } + + return code; +} + +// @see #CB_INTERFACE_METHOD_PRIVIELGE_CHECKER_TABLE +void CStubBodyGenerator::GenInterfaceMethodPrivilegeCheckerTable( + std::ofstream& stream, const Interface& iface) { + ReplaceAll(CB_INTERFACE_METHOD_PRIVIELGE_CHECKER_TABLE) + .Change("", GetHandlePrefix()) + .Change("", iface.GetID()) + .Change("", GenPrivilegeCheckers(iface)) + .Transform([&](std::string code) { return SmartIndent(code); }) + .Out(stream); +} + // @see #CB_INTERFACE_METHOD_HANDLER std::string CStubBodyGenerator::GenMethodHandlers(const Interface& iface) { std::string code; diff --git a/idlc/gen/version2/c_stub_body_generator.hh b/idlc/gen/version2/c_stub_body_generator.hh index 90b73ba..c96d727 100644 --- a/idlc/gen/version2/c_stub_body_generator.hh +++ b/idlc/gen/version2/c_stub_body_generator.hh @@ -36,6 +36,7 @@ class CStubBodyGenerator : public CBodyGeneratorBase { void OnFiniGen(std::ofstream& stream) override; private: + void GenIncludePrivateHeaders(std::ofstream& stream); void GenThreadEnableDefinition(std::ofstream& stream); void GenInterfaceMethodHandlerType(std::ofstream& stream); void GenInterfaceEnums(std::ofstream& stream); @@ -63,6 +64,10 @@ class CStubBodyGenerator : public CBodyGeneratorBase { const Interface& iface); void GenInterfaceDelegateBase(std::ofstream& stream, const Interface& iface, const Declaration& decl); + void GenInterfaceMethodPrivilegeCheckerBase(std::ofstream& stream, + const Interface& iface, const Declaration& decl); + void GenInterfaceMethodPrivilegeCheckerTable(std::ofstream& stream, + const Interface& iface); void GenInterfaceMethodHandlerBase(std::ofstream& stream, const Interface& iface, const Declaration& decl); void GenInterfaceMethodTable(std::ofstream& stream, const Interface& iface); @@ -77,6 +82,8 @@ class CStubBodyGenerator : public CBodyGeneratorBase { const Declaration& decl); std::string GenDelegateParamsCheck(const Interface& iface, const Declaration& decl); + std::string GenPrivileges(const Declaration& decl); + std::string GenPrivilegeCheckers(const Interface& iface); std::string GenMethodHandlerArgsDecl(const Interface& iface, const Declaration& decl); std::string GenMethodUnitMapRead(const Interface& iface, diff --git a/idlc/gen/version2/c_stub_body_generator_cb.hh b/idlc/gen/version2/c_stub_body_generator_cb.hh index 0fb434b..573045c 100644 --- a/idlc/gen/version2/c_stub_body_generator_cb.hh +++ b/idlc/gen/version2/c_stub_body_generator_cb.hh @@ -17,6 +17,12 @@ #ifndef IDLC_C_GEN_C_STUB_BODY_GENERATOR_CB_H_ #define IDLC_C_GEN_C_STUB_BODY_GENERATOR_CB_H_ +constexpr const char CB_PRIVATE_HEADERS[] = +R"__c_cb( +#include +#include +)__c_cb"; + constexpr const char CB_DELEGATE_DEFS[] = R"__c_cb( typedef struct rpc_port_delegate_s { @@ -49,7 +55,6 @@ static void __rpc_port_delegate_to(rpc_port_parcel_h parcel, void *user_data) rpc_port_unit_map_write_int(map, "id", delegate->id); rpc_port_unit_map_write_int(map, "seq_id", delegate->seq_id); rpc_port_unit_map_write_bool(map, "once", delegate->once); - rpc_port_unit_map_write_bool(map, "valid", delegate->valid); rpc_port_parcel_write(parcel, &map->parcelable, map); rpc_port_unit_map_destroy(map); set_last_result(RPC_PORT_ERROR_NONE); @@ -70,7 +75,6 @@ static void __rpc_port_delegate_from(rpc_port_parcel_h parcel, void *user_data) rpc_port_unit_map_read_int(map, "id", &delegate->id); rpc_port_unit_map_read_int(map, "seq_id", &delegate->seq_id); rpc_port_unit_map_read_bool(map, "once", &delegate->once); - rpc_port_unit_map_read_bool(map, "valid", &delegate->valid); rpc_port_unit_map_destroy(map); set_last_result(RPC_PORT_ERROR_NONE); } @@ -179,6 +183,8 @@ typedef struct __context_s { void *tag; __callback_s callback; void *user_data; + app_info_h app_info; + GHashTable *privileges; #ifdef TIDL_THREAD_ENABLE GThread *thread; GQueue *queue; @@ -187,6 +193,8 @@ typedef struct __context_s { bool done; #endif /* TIDL_THREAD_ENABLE */ } __context_t; + +typedef int (*__privilege_checker)(__context_h h, bool *sync); )__c_cb"; /** @@ -217,14 +225,62 @@ typedef struct ___s { /** * The prefix of the interface. * The name of the interface. + * The uppercase prefix of the interface. + * The uppercase name of the interface. */ constexpr const char CB_INTERFACE_CONTEXT_BASE[] = R"__c_cb( +static void ____throw_remote_exception(rpc_port_h port, rpc_port_parcel_h parcel, int cause, const char *message) +{ + __remote_exception_h remote_exception = nullptr; + rpc_port_parcel_h result_parcel = nullptr; + rpc_port_parcel_header_h header = nullptr; + rpc_port_unit_map_h map; + int seq_num = 0; + + map = rpc_port_unit_map_create(); + if (map == nullptr) { + _E("Failed to create unit map"); + return; + } + + rpc_port_unit_map_write_int(map, "[METHOD]", __METHOD_RESULT_); + + __remote_exception_create(&remote_exception); + __remote_exception_set_cause(remote_exception, cause); + __remote_exception_set_message(remote_exception, message); + rpc_port_unit_map_write__remote_exception(map, "[REMOTE_EXCEPTION]", remote_exception); + __remote_exception_destroy(remote_exception); + + if (rpc_port_parcel_create(&result_parcel) != RPC_PORT_ERROR_NONE) { + _E("Failed to create parcel handle"); + rpc_port_unit_map_destroy(map); + return; + } + + rpc_port_parcel_get_header(parcel, &header); + rpc_port_parcel_header_get_seq_num(header, &seq_num); + + header = nullptr; + rpc_port_parcel_get_header(result_parcel, &header); + rpc_port_parcel_header_set_tag(header, TIDL_VERSION); + rpc_port_parcel_header_set_seq_num(header, seq_num); + + rpc_port_parcel_write(result_parcel, &map->parcelable, map); + rpc_port_unit_map_destroy(map); + + if (rpc_port_parcel_send(result_parcel, port) != RPC_PORT_ERROR_NONE) + _E("Failed to send result"); + + rpc_port_parcel_destroy(result_parcel); +} + static int ____context_handle_request(__context_h h, rpc_port_parcel_h parcel) { int ret = RPC_PORT_ERROR_NONE; int cmd = -1; rpc_port_unit_map_h map; + bool sync = false; map = rpc_port_unit_map_create(); if (map == nullptr) { @@ -237,6 +293,17 @@ static int ____context_handle_request(__context_h h, rpc_port_unit_map_read_int(map, "[METHOD]", &cmd); if (cmd > 1 && cmd < ARRAY_SIZE(___method_table)) { + if (h->app_info && ___privilege_checkers[cmd]) { + ret = ___privilege_checkers[cmd](h, &sync); + if (ret != RPC_PORT_ERROR_NONE) { + rpc_port_unit_map_destroy(map); + if (sync) + ____throw_remote_exception(h->port, parcel, ret, "Permission denied"); + + return RPC_PORT_ERROR_NONE; + } + } + if (___method_table[cmd]) ret = ___method_table[cmd](h->port, parcel, map, h); } else { @@ -326,6 +393,12 @@ static void ____context_destroy(gpointer data) } #endif /* TIDL_THREAD_ENABLE */ + if (h->app_info) + app_info_destroy(h->app_info); + + if (h->privileges) + g_hash_table_destroy(h->privileges); + if (h->instance) free(h->instance); @@ -335,6 +408,60 @@ static void ____context_destroy(gpointer data) free(h); } +static bool ____context_privilege_info_cb(const char *privilege_name, void *user_data) +{ + __context_h h = user_data; + char *privilege; + + privilege = strdup(privilege_name); + if (privilege == nullptr) { + _E("strdup() is failed. privilege: %s", privilege_name); + return false; + } + + _D("appid: %s, privilege: %s", h->sender, privilege); + g_hash_table_insert(h->privileges, privilege, privilege); + + return true; +} + +static int ____context_load_privileges(__context_h h) +{ + package_info_h package_info; + app_info_h app_info; + char *package = nullptr; + int ret; + + ret = app_info_create(h->sender, &app_info); + if (ret != APP_MANAGER_ERROR_NONE) { + if (ret == APP_MANAGER_ERROR_NO_SUCH_APP) { + _W("%s is not an application", h->sender); + return 0; + } + + return ret; + } + + h->app_info = app_info; + ret = app_info_get_package(app_info, &package); + if (ret != APP_MANAGER_ERROR_NONE) { + _E("Failed to get package. error(%d)", ret); + return ret; + } + + ret = package_info_create(package, &package_info); + free(package); + if (ret != PACKAGE_MANAGER_ERROR_NONE) { + _E("Failed to create package info. error(%d)", ret); + return ret; + } + + ret = package_info_foreach_privilege_info(package_info, ____context_privilege_info_cb, h); + package_info_destroy(package_info); + + return ret; +} + static __context_h ____context_create(const char *sender, const char *instance, rpc_port_h callback_port) { __context_t *handle; @@ -364,6 +491,18 @@ static __context_h ____context_create(const char *se return nullptr; } + handle->privileges = g_hash_table_new_full(g_str_hash, g_str_equal, free, nullptr); + if (handle->privileges == nullptr) { + _E("Failed to create hash table for privileges"); + ____context_destroy(handle); + return nullptr; + } + + if (____context_load_privileges(handle) != 0) { + ____context_destroy(handle); + return nullptr; + } + #ifdef TIDL_THREAD_ENABLE g_mutex_init(&handle->mutex); g_cond_init(&handle->cond); @@ -1602,4 +1741,54 @@ int __remote_exception_destroy(__remote_exception_h } )__c_cb"; +/** + * The prefix of the interace. + * The name of the interface. + * The name of the method of the interface. + * The privileges of the method + * The flag if it's true, the stub should throw the remote exception. + */ +constexpr const char CB_INTERFACE_METHOD_PRIVILEGE_CHECKER_BASE[] = +R"__c_cb( +static int ____method__privilege_checker(__context_h h, bool *sync) +{ + static const char *privileges[] = { + + }; + + *sync = ; + for (int i = 0; i < ARRAY_SIZE(privileges); ++i) { + if (!g_hash_table_contains(h->privileges, privileges[i])) { + _E("Permission denied. %s : %s", h->sender, privileges[i]); + return RPC_PORT_ERROR_PERMISSION_DENIED; + } + } + + return RPC_PORT_ERROR_NONE; +} +)__c_cb"; + +/** + * The prefix of the interface. + * The name of the interface. + * The privilege checker for each methods. + */ +constexpr const char CB_INTERFACE_METHOD_PRIVIELGE_CHECKER_TABLE[] = +R"__c_cb( +static __privilege_checker ___privilege_checkers[] = { + +}; +)__c_cb"; + +/** + * The prefix of the interface. + * The name of the ineterface. + * The name of the method of the interface. + * The enumeration value of the method of the interface. + */ +constexpr const char CB_INTERFACE_PRIVILEGE_CHECKER[] = +R"__c_cb( +[] = ____method__privilege_checker, +)__c_cb"; + #endif // IDLC_C_GEN_C_STUB_BODY_GENERATOR_CB_H_ -- 2.7.4