@@ -324,26 +324,6 @@ class Context
324
324
325
325
}; // class Context
326
326
327
- // __FLAG__
328
- template <typename Input>
329
- void debug_action (
330
- const std::string& rule_name,
331
- const Input& in,
332
- const std::map<std::string, std::string>& state)
333
- {
334
- std::cout << " [DEBUG] Rule: " << rule_name << " \n " ;
335
- std::cout << " Input: \" " << in.string () << " \"\n " ;
336
- std::cout << " State:\n " ;
337
- for (std::map<std::string, std::string>::const_iterator it = state.begin (); it != state.end (); ++it)
338
- {
339
- std::cout << " - " << it->first << " : " << it->second << " \n " ;
340
- }
341
-
342
- std::cout << " -----------------------------------\n " ;
343
- }
344
-
345
- // ///////////////
346
-
347
327
// Actions
348
328
template <typename Rule>
349
329
struct action
@@ -370,9 +350,6 @@ struct action<identifier>
370
350
std::map<std::string, std::string>& state,
371
351
std::vector<traits<DynamicData>::ref_type>& /* operands*/ )
372
352
{
373
- // __FLAG__
374
- // debug_action("identifier", in, state);
375
- // /////////////
376
353
auto module = ctx->modules ().current ();
377
354
const std::string identifier_name = in.string ();
378
355
const std::string scoped_identifier_name = module ->create_scoped_name (identifier_name);
@@ -1689,9 +1666,6 @@ struct action<struct_forward_dcl>
1689
1666
1690
1667
if (scoped_struct_name == ctx->target_type_name )
1691
1668
{
1692
- // __FLAG__
1693
- std::cout << " Found target struct: " << scoped_struct_name << std::endl;
1694
- // //////////////
1695
1669
ctx->builder = builder;
1696
1670
}
1697
1671
}
@@ -1941,7 +1915,7 @@ struct action<kw_struct>
1941
1915
{
1942
1916
template <typename Input>
1943
1917
static void apply (
1944
- const Input& in ,
1918
+ const Input& /* in */ ,
1945
1919
Context* ctx,
1946
1920
std::map<std::string, std::string>& state,
1947
1921
std::vector<traits<DynamicData>::ref_type>& /* operands*/ )
@@ -1956,10 +1930,6 @@ struct action<kw_struct>
1956
1930
state[" current_array_sizes" ] = " " ;
1957
1931
state[" sequence_sizes" ] = " " ;
1958
1932
1959
- // __FLAG__
1960
- static_cast <void >(in);
1961
- // debug_action("kw_struct", in, state);
1962
- // ///////////////////
1963
1933
// Add pending struct annotations if were processed
1964
1934
if (state.count (" annotation_names" ) && !state[" annotation_names" ].empty ())
1965
1935
{
@@ -2118,13 +2088,6 @@ struct action<struct_def>
2118
2088
2119
2089
// Annotate the member descriptor with the annotations collected during parsing
2120
2090
const auto & member_annotations = ctx->annotations ().pending_member_annotations ();
2121
- // // __FLAG__
2122
- // for (const auto& info : ctx->annotations().pending_member_annotations())
2123
- // {
2124
- // std::cout << "Pending member annotations size: " << info.second.size() << " for member: "
2125
- // << info.first << std::endl;
2126
- // }
2127
- // //////////////////
2128
2091
if (member_annotations.count (names[i]))
2129
2092
{
2130
2093
for (const auto & info : member_annotations.at (names[i]))
@@ -2163,7 +2126,7 @@ struct action<kw_union>
2163
2126
{
2164
2127
template <typename Input>
2165
2128
static void apply (
2166
- const Input& in ,
2129
+ const Input& /* in */ ,
2167
2130
Context* ctx,
2168
2131
std::map<std::string, std::string>& state,
2169
2132
std::vector<traits<DynamicData>::ref_type>& /* operands*/ )
@@ -2178,9 +2141,6 @@ struct action<kw_union>
2178
2141
state[" sequence_sizes" ] = " " ;
2179
2142
state[" type" ] = " " ;
2180
2143
2181
- // __FLAG__
2182
- debug_action (" kw_union" , in, state);
2183
- // ///////////////////
2184
2144
// Add pending union annotations if were processed
2185
2145
if (state.count (" annotation_names" ) && !state[" annotation_names" ].empty ())
2186
2146
{
@@ -2374,7 +2334,7 @@ struct action<union_def>
2374
2334
2375
2335
template <typename Input>
2376
2336
static void apply (
2377
- const Input& in ,
2337
+ const Input& /* in */ ,
2378
2338
Context* ctx,
2379
2339
std::map<std::string, std::string>& state,
2380
2340
std::vector<traits<DynamicData>::ref_type>& /* operands*/ )
@@ -2392,10 +2352,6 @@ struct action<union_def>
2392
2352
}
2393
2353
cleanup_guard{state, ctx};
2394
2354
2395
- // __FLAG__
2396
- static_cast <void >(in);
2397
- // debug_action("union_def", in, state);
2398
- // //////////////////////
2399
2355
auto module = ctx->modules ().current ();
2400
2356
const std::string scoped_union_name = module ->create_scoped_name (state[" union_name" ]);
2401
2357
@@ -2738,42 +2694,16 @@ struct action<annotation_appl_params>
2738
2694
std::map<std::string, std::string>& state,
2739
2695
std::vector<traits<DynamicData>::ref_type>& /* operands*/ )
2740
2696
{
2741
- // __FLAG__
2742
- // debug_action("annotation_appl_params", in, state);
2743
- // //////////////
2744
-
2745
2697
const std::string& last_ann_params = in.string ();
2746
2698
std::string& current_ann_params = state[" annotation_params" ];
2747
2699
2748
2700
// Last parsed annotation has parameters, update the state
2749
2701
std::vector<std::string> tokens = ctx->split_string (current_ann_params, ' ;' );
2750
- // __FLAG__
2751
- if (tokens.empty ())
2752
- {
2753
- EPROSIMA_LOG_ERROR (IDLPARSER, " Invalid annotation parameters: " << current_ann_params);
2754
- throw std::runtime_error (" Invalid annotation parameters: " + current_ann_params);
2755
- }
2756
- // //////////////
2757
2702
tokens.back () = last_ann_params;
2758
2703
current_ann_params = ctx->join_strings (tokens, ' ;' );
2759
2704
}
2760
2705
};
2761
2706
2762
- // template<>
2763
- // struct action<annotation_appl>
2764
- // {
2765
- // template<typename Input>
2766
- // static void apply(
2767
- // const Input& in,
2768
- // Context* /*ctx*/,
2769
- // std::map<std::string, std::string>& state,
2770
- // std::vector<traits<DynamicData>::ref_type>& /*operands*/)
2771
- // {
2772
- // EPROSIMA_LOG_INFO(IDLPARSER, "[TODO] annotation_appl parsing not supported: " << state["type"]);
2773
- // }
2774
-
2775
- // };
2776
-
2777
2707
template <>
2778
2708
struct action <bitmask_dcl>
2779
2709
{
@@ -2784,9 +2714,6 @@ struct action<bitmask_dcl>
2784
2714
std::map<std::string, std::string>& state,
2785
2715
std::vector<traits<DynamicData>::ref_type>& /* operands*/ )
2786
2716
{
2787
- // __FLAG__
2788
- // debug_action("bitmask_dcl", in, state);
2789
- // ///////////////////
2790
2717
state[" type" ] = in.string ();
2791
2718
EPROSIMA_LOG_INFO (IDLPARSER, " [TODO] bitmask_dcl parsing not supported: " << state[" type" ]);
2792
2719
// Ignore bitmask annotations (Unsupported type)
@@ -3108,14 +3035,6 @@ traits<DynamicType>::ref_type Context::get_type(
3108
3035
bool AnnotationsManager::update_pending_annotations (
3109
3036
std::map<std::string, std::string>& state)
3110
3037
{
3111
- // // __FLAG__
3112
- // std::cout << "UPDATING PENDING ANNOTATIONS\n";
3113
- // std::cout << "Current state:\n";
3114
- // for (std::map<std::string, std::string>::const_iterator it = state.begin(); it != state.end(); ++it)
3115
- // {
3116
- // std::cout << " - " << it->first << ": " << it->second << "\n";
3117
- // }
3118
- // ///////////////////////
3119
3038
if (!state.count (" annotation_names" ) || !state.count (" annotation_params" ) || !state.count (" annotation_target" ))
3120
3039
{
3121
3040
EPROSIMA_LOG_ERROR (IDLPARSER, " Unable to update pending annotations: missing required state keys." );
0 commit comments