refactor(gsc): simplify and clean ast (#99)

This commit is contained in:
Xenxo Espasandín 2023-04-05 17:09:21 +02:00 committed by GitHub
parent 04c0e0fce0
commit d6307893d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 3669 additions and 4808 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -45,8 +45,6 @@ private:
auto emit_stmt_comp(stmt_comp const& stm, scope& scp, bool last) -> void;
auto emit_stmt_dev(stmt_dev const& stm, scope& scp, bool last) -> void;
auto emit_stmt_expr(stmt_expr const& stm, scope& scp) -> void;
auto emit_stmt_call(stmt_call const& stm, scope& scp) -> void;
auto emit_stmt_assign(stmt_assign const& stm, scope& scp) -> void;
auto emit_stmt_endon(stmt_endon const& stm, scope& scp) -> void;
auto emit_stmt_notify(stmt_notify const& stm, scope& scp) -> void;
auto emit_stmt_wait(stmt_wait const& stm, scope& scp) -> void;
@ -80,8 +78,6 @@ private:
auto emit_expr_decrement(expr_decrement const& exp, scope& scp, bool is_stmt) -> void;
auto emit_expr_ternary(expr_ternary const& exp, scope& scp) -> void;
auto emit_expr_binary(expr_binary const& exp, scope& scp) -> void;
auto emit_expr_and(expr_and const& exp, scope& scp) -> void;
auto emit_expr_or(expr_or const& exp, scope& scp) -> void;
auto emit_expr_complement(expr_complement const& exp, scope& scp) -> void;
auto emit_expr_negate(expr_negate const& exp, scope& scp) -> void;
auto emit_expr_not(expr_not const& exp, scope& scp) -> void;
@ -128,7 +124,6 @@ private:
auto process_stmt_comp(stmt_comp const& stm, scope& scp) -> void;
auto process_stmt_dev(stmt_dev const& stm, scope& scp) -> void;
auto process_stmt_expr(stmt_expr const& stm, scope& scp) -> void;
auto process_stmt_assign(stmt_assign const& stm, scope& scp) -> void;
auto process_stmt_waittill(stmt_waittill const& stm, scope& scp) -> void;
auto process_stmt_if(stmt_if const& stm, scope& scp) -> void;
auto process_stmt_ifelse(stmt_ifelse const& stm, scope& scp) -> void;

View File

@ -55,8 +55,6 @@ private:
auto process_stmt_comp(stmt_comp& stm, scope& scp) -> void;
auto process_stmt_dev(stmt_dev& stm, scope& scp) -> void;
auto process_stmt_expr(stmt_expr& stm, scope& scp) -> void;
auto process_stmt_call(stmt_call& stm, scope& scp) -> void;
auto process_stmt_assign(stmt_assign& stm, scope& scp) -> void;
auto process_stmt_endon(stmt_endon& stm, scope& scp) -> void;
auto process_stmt_notify(stmt_notify& stm, scope& scp) -> void;
auto process_stmt_wait(stmt_wait& stm, scope& scp) -> void;
@ -72,24 +70,22 @@ private:
auto process_stmt_break(stmt_break& stm, scope& scp) -> void;
auto process_stmt_continue(stmt_continue& stm, scope& scp) -> void;
auto process_stmt_return(stmt_return& stm, scope& scp) -> void;
auto process_stmt_asm_create(asm_create& stm, scope& scp) -> void;
auto process_stmt_asm_remove(asm_remove& stm, scope& scp) -> void;
auto process_expr(expr& exp, scope& scp) -> void;
auto process_expr_assign(expr_assign::ptr& exp, scope& scp) -> void;
auto process_stmt_create(stmt_create& stm, scope& scp) -> void;
auto process_stmt_remove(stmt_remove& stm, scope& scp) -> void;
auto process_expr(expr::ptr& exp, scope& scp) -> void;
auto process_expr_increment(expr_increment& exp, scope& scp) -> void;
auto process_expr_decrement(expr_decrement& exp, scope& scp) -> void;
auto process_expr_assign(expr_assign::ptr& exp, scope& scp) -> void;
auto process_expr_ternary(expr_ternary& exp, scope& scp) -> void;
auto process_expr_binary(expr_binary& exp, scope& scp) -> void;
auto process_expr_and(expr_and& exp, scope& scp) -> void;
auto process_expr_or(expr_or& exp, scope& scp) -> void;
auto process_expr_complement(expr_complement& exp, scope& scp) -> void;
auto process_expr_not(expr_not& exp, scope& scp) -> void;
auto process_expr_call(expr_call& exp, scope& scp) -> void;
auto process_expr_method(expr_method& exp, scope& scp) -> void;
auto process_expr_call_pointer(expr_pointer& exp, scope& scp) -> void;
auto process_expr_call_function(expr_function& exp, scope& scp) -> void;
auto process_expr_method_pointer(expr_pointer& exp, expr& obj, scope& scp) -> void;
auto process_expr_method_function(expr_function& exp, expr& obj, scope& scp) -> void;
auto process_expr_method_pointer(expr_pointer& exp, expr::ptr& obj, scope& scp) -> void;
auto process_expr_method_function(expr_function& exp, expr::ptr& obj, scope& scp) -> void;
auto process_expr_arguments(expr_arguments& exp, scope& scp) -> void;
auto process_expr_add_array(expr_add_array& exp, scope& scp) -> void;
auto process_expr_size(expr_size& exp, scope& scp) -> void;
@ -97,8 +93,8 @@ private:
auto process_expr_array(expr_array& exp, scope& scp) -> void;
auto process_expr_field(expr_field& exp, scope& scp) -> void;
auto process_expr_vector(expr_vector& exp, scope& scp) -> void;
auto process_expr_asm_create(expr& exp, scope& scp) -> void;
auto process_expr_asm_access(expr& exp, scope& scp) -> void;
auto process_expr_var_create(expr::ptr& exp, scope& scp) -> void;
auto process_expr_var_access(expr::ptr& exp, scope& scp) -> void;
};
} // namespace xsk::gsc

View File

@ -424,10 +424,10 @@ namespace xsk { namespace gsc {
{
// expr_function
// expr_pointer
char dummy1[sizeof (call)];
char dummy1[sizeof (call::ptr)];
// declaration
char dummy2[sizeof (decl)];
char dummy2[sizeof (decl::ptr)];
// decl_constant
char dummy3[sizeof (decl_constant::ptr)];
@ -440,16 +440,16 @@ namespace xsk { namespace gsc {
// expr
// expr_or_empty
// expr_assign
// expr_increment
// expr_decrement
// expr_assign
// expr_ternary
// expr_binary
// expr_primitive
// expr_tuple
// expr_tuple_types
// expr_object
char dummy6[sizeof (expr)];
char dummy6[sizeof (expr::ptr)];
// expr_add_array
char dummy7[sizeof (expr_add_array::ptr)];
@ -571,7 +571,7 @@ namespace xsk { namespace gsc {
// stmt
// stmt_or_dev
char dummy44[sizeof (stmt)];
char dummy44[sizeof (stmt::ptr)];
// stmt_assert
char dummy45[sizeof (stmt_assert::ptr)];
@ -582,90 +582,86 @@ namespace xsk { namespace gsc {
// stmt_assertmsg
char dummy47[sizeof (stmt_assertmsg::ptr)];
// stmt_assign
char dummy48[sizeof (stmt_assign::ptr)];
// stmt_break
char dummy49[sizeof (stmt_break::ptr)];
char dummy48[sizeof (stmt_break::ptr)];
// stmt_breakpoint
char dummy50[sizeof (stmt_breakpoint::ptr)];
// stmt_call
char dummy51[sizeof (stmt_call::ptr)];
char dummy49[sizeof (stmt_breakpoint::ptr)];
// stmt_case
char dummy52[sizeof (stmt_case::ptr)];
char dummy50[sizeof (stmt_case::ptr)];
// stmt_comp
char dummy53[sizeof (stmt_comp::ptr)];
char dummy51[sizeof (stmt_comp::ptr)];
// stmt_continue
char dummy54[sizeof (stmt_continue::ptr)];
char dummy52[sizeof (stmt_continue::ptr)];
// stmt_default
char dummy55[sizeof (stmt_default::ptr)];
char dummy53[sizeof (stmt_default::ptr)];
// stmt_dev
char dummy56[sizeof (stmt_dev::ptr)];
char dummy54[sizeof (stmt_dev::ptr)];
// stmt_dowhile
char dummy57[sizeof (stmt_dowhile::ptr)];
char dummy55[sizeof (stmt_dowhile::ptr)];
// stmt_endon
char dummy58[sizeof (stmt_endon::ptr)];
char dummy56[sizeof (stmt_endon::ptr)];
// stmt_expr
char dummy59[sizeof (stmt_expr::ptr)];
// stmt_call
// stmt_assign
char dummy57[sizeof (stmt_expr::ptr)];
// stmt_for
char dummy60[sizeof (stmt_for::ptr)];
char dummy58[sizeof (stmt_for::ptr)];
// stmt_foreach
char dummy61[sizeof (stmt_foreach::ptr)];
char dummy59[sizeof (stmt_foreach::ptr)];
// stmt_if
char dummy62[sizeof (stmt_if::ptr)];
char dummy60[sizeof (stmt_if::ptr)];
// stmt_ifelse
char dummy63[sizeof (stmt_ifelse::ptr)];
char dummy61[sizeof (stmt_ifelse::ptr)];
// stmt_list
// stmt_or_dev_list
char dummy64[sizeof (stmt_list::ptr)];
char dummy62[sizeof (stmt_list::ptr)];
// stmt_notify
char dummy65[sizeof (stmt_notify::ptr)];
char dummy63[sizeof (stmt_notify::ptr)];
// stmt_prof_begin
char dummy66[sizeof (stmt_prof_begin::ptr)];
char dummy64[sizeof (stmt_prof_begin::ptr)];
// stmt_prof_end
char dummy67[sizeof (stmt_prof_end::ptr)];
char dummy65[sizeof (stmt_prof_end::ptr)];
// stmt_return
char dummy68[sizeof (stmt_return::ptr)];
char dummy66[sizeof (stmt_return::ptr)];
// stmt_switch
char dummy69[sizeof (stmt_switch::ptr)];
char dummy67[sizeof (stmt_switch::ptr)];
// stmt_wait
char dummy70[sizeof (stmt_wait::ptr)];
char dummy68[sizeof (stmt_wait::ptr)];
// stmt_waitframe
char dummy71[sizeof (stmt_waitframe::ptr)];
char dummy69[sizeof (stmt_waitframe::ptr)];
// stmt_waittill
char dummy72[sizeof (stmt_waittill::ptr)];
char dummy70[sizeof (stmt_waittill::ptr)];
// stmt_waittillframeend
char dummy73[sizeof (stmt_waittillframeend::ptr)];
char dummy71[sizeof (stmt_waittillframeend::ptr)];
// stmt_waittillmatch
char dummy74[sizeof (stmt_waittillmatch::ptr)];
char dummy72[sizeof (stmt_waittillmatch::ptr)];
// stmt_while
char dummy75[sizeof (stmt_while::ptr)];
char dummy73[sizeof (stmt_while::ptr)];
};
/// The size of the largest semantic type.
@ -1004,9 +1000,9 @@ namespace xsk { namespace gsc {
S_stmt_assertmsg = 155, // stmt_assertmsg
S_expr = 156, // expr
S_expr_or_empty = 157, // expr_or_empty
S_expr_assign = 158, // expr_assign
S_expr_increment = 159, // expr_increment
S_expr_decrement = 160, // expr_decrement
S_expr_increment = 158, // expr_increment
S_expr_decrement = 159, // expr_decrement
S_expr_assign = 160, // expr_assign
S_expr_ternary = 161, // expr_ternary
S_expr_binary = 162, // expr_binary
S_expr_primitive = 163, // expr_primitive
@ -1089,11 +1085,11 @@ namespace xsk { namespace gsc {
{
case symbol_kind::S_expr_function: // expr_function
case symbol_kind::S_expr_pointer: // expr_pointer
value.move< call > (std::move (that.value));
value.move< call::ptr > (std::move (that.value));
break;
case symbol_kind::S_declaration: // declaration
value.move< decl > (std::move (that.value));
value.move< decl::ptr > (std::move (that.value));
break;
case symbol_kind::S_decl_constant: // decl_constant
@ -1110,16 +1106,16 @@ namespace xsk { namespace gsc {
case symbol_kind::S_expr: // expr
case symbol_kind::S_expr_or_empty: // expr_or_empty
case symbol_kind::S_expr_assign: // expr_assign
case symbol_kind::S_expr_increment: // expr_increment
case symbol_kind::S_expr_decrement: // expr_decrement
case symbol_kind::S_expr_assign: // expr_assign
case symbol_kind::S_expr_ternary: // expr_ternary
case symbol_kind::S_expr_binary: // expr_binary
case symbol_kind::S_expr_primitive: // expr_primitive
case symbol_kind::S_expr_tuple: // expr_tuple
case symbol_kind::S_expr_tuple_types: // expr_tuple_types
case symbol_kind::S_expr_object: // expr_object
value.move< expr > (std::move (that.value));
value.move< expr::ptr > (std::move (that.value));
break;
case symbol_kind::S_expr_add_array: // expr_add_array
@ -1279,7 +1275,7 @@ namespace xsk { namespace gsc {
case symbol_kind::S_stmt: // stmt
case symbol_kind::S_stmt_or_dev: // stmt_or_dev
value.move< stmt > (std::move (that.value));
value.move< stmt::ptr > (std::move (that.value));
break;
case symbol_kind::S_stmt_assert: // stmt_assert
@ -1294,10 +1290,6 @@ namespace xsk { namespace gsc {
value.move< stmt_assertmsg::ptr > (std::move (that.value));
break;
case symbol_kind::S_stmt_assign: // stmt_assign
value.move< stmt_assign::ptr > (std::move (that.value));
break;
case symbol_kind::S_stmt_break: // stmt_break
value.move< stmt_break::ptr > (std::move (that.value));
break;
@ -1306,10 +1298,6 @@ namespace xsk { namespace gsc {
value.move< stmt_breakpoint::ptr > (std::move (that.value));
break;
case symbol_kind::S_stmt_call: // stmt_call
value.move< stmt_call::ptr > (std::move (that.value));
break;
case symbol_kind::S_stmt_case: // stmt_case
value.move< stmt_case::ptr > (std::move (that.value));
break;
@ -1339,6 +1327,8 @@ namespace xsk { namespace gsc {
break;
case symbol_kind::S_stmt_expr: // stmt_expr
case symbol_kind::S_stmt_call: // stmt_call
case symbol_kind::S_stmt_assign: // stmt_assign
value.move< stmt_expr::ptr > (std::move (that.value));
break;
@ -1431,13 +1421,13 @@ namespace xsk { namespace gsc {
#endif
#if 201103L <= YY_CPLUSPLUS
basic_symbol (typename Base::kind_type t, call&& v, location_type&& l)
basic_symbol (typename Base::kind_type t, call::ptr&& v, location_type&& l)
: Base (t)
, value (std::move (v))
, location (std::move (l))
{}
#else
basic_symbol (typename Base::kind_type t, const call& v, const location_type& l)
basic_symbol (typename Base::kind_type t, const call::ptr& v, const location_type& l)
: Base (t)
, value (v)
, location (l)
@ -1445,13 +1435,13 @@ namespace xsk { namespace gsc {
#endif
#if 201103L <= YY_CPLUSPLUS
basic_symbol (typename Base::kind_type t, decl&& v, location_type&& l)
basic_symbol (typename Base::kind_type t, decl::ptr&& v, location_type&& l)
: Base (t)
, value (std::move (v))
, location (std::move (l))
{}
#else
basic_symbol (typename Base::kind_type t, const decl& v, const location_type& l)
basic_symbol (typename Base::kind_type t, const decl::ptr& v, const location_type& l)
: Base (t)
, value (v)
, location (l)
@ -1501,13 +1491,13 @@ namespace xsk { namespace gsc {
#endif
#if 201103L <= YY_CPLUSPLUS
basic_symbol (typename Base::kind_type t, expr&& v, location_type&& l)
basic_symbol (typename Base::kind_type t, expr::ptr&& v, location_type&& l)
: Base (t)
, value (std::move (v))
, location (std::move (l))
{}
#else
basic_symbol (typename Base::kind_type t, const expr& v, const location_type& l)
basic_symbol (typename Base::kind_type t, const expr::ptr& v, const location_type& l)
: Base (t)
, value (v)
, location (l)
@ -2033,13 +2023,13 @@ namespace xsk { namespace gsc {
#endif
#if 201103L <= YY_CPLUSPLUS
basic_symbol (typename Base::kind_type t, stmt&& v, location_type&& l)
basic_symbol (typename Base::kind_type t, stmt::ptr&& v, location_type&& l)
: Base (t)
, value (std::move (v))
, location (std::move (l))
{}
#else
basic_symbol (typename Base::kind_type t, const stmt& v, const location_type& l)
basic_symbol (typename Base::kind_type t, const stmt::ptr& v, const location_type& l)
: Base (t)
, value (v)
, location (l)
@ -2088,20 +2078,6 @@ namespace xsk { namespace gsc {
{}
#endif
#if 201103L <= YY_CPLUSPLUS
basic_symbol (typename Base::kind_type t, stmt_assign::ptr&& v, location_type&& l)
: Base (t)
, value (std::move (v))
, location (std::move (l))
{}
#else
basic_symbol (typename Base::kind_type t, const stmt_assign::ptr& v, const location_type& l)
: Base (t)
, value (v)
, location (l)
{}
#endif
#if 201103L <= YY_CPLUSPLUS
basic_symbol (typename Base::kind_type t, stmt_break::ptr&& v, location_type&& l)
: Base (t)
@ -2130,20 +2106,6 @@ namespace xsk { namespace gsc {
{}
#endif
#if 201103L <= YY_CPLUSPLUS
basic_symbol (typename Base::kind_type t, stmt_call::ptr&& v, location_type&& l)
: Base (t)
, value (std::move (v))
, location (std::move (l))
{}
#else
basic_symbol (typename Base::kind_type t, const stmt_call::ptr& v, const location_type& l)
: Base (t)
, value (v)
, location (l)
{}
#endif
#if 201103L <= YY_CPLUSPLUS
basic_symbol (typename Base::kind_type t, stmt_case::ptr&& v, location_type&& l)
: Base (t)
@ -2506,11 +2468,11 @@ switch (yykind)
{
case symbol_kind::S_expr_function: // expr_function
case symbol_kind::S_expr_pointer: // expr_pointer
value.template destroy< call > ();
value.template destroy< call::ptr > ();
break;
case symbol_kind::S_declaration: // declaration
value.template destroy< decl > ();
value.template destroy< decl::ptr > ();
break;
case symbol_kind::S_decl_constant: // decl_constant
@ -2527,16 +2489,16 @@ switch (yykind)
case symbol_kind::S_expr: // expr
case symbol_kind::S_expr_or_empty: // expr_or_empty
case symbol_kind::S_expr_assign: // expr_assign
case symbol_kind::S_expr_increment: // expr_increment
case symbol_kind::S_expr_decrement: // expr_decrement
case symbol_kind::S_expr_assign: // expr_assign
case symbol_kind::S_expr_ternary: // expr_ternary
case symbol_kind::S_expr_binary: // expr_binary
case symbol_kind::S_expr_primitive: // expr_primitive
case symbol_kind::S_expr_tuple: // expr_tuple
case symbol_kind::S_expr_tuple_types: // expr_tuple_types
case symbol_kind::S_expr_object: // expr_object
value.template destroy< expr > ();
value.template destroy< expr::ptr > ();
break;
case symbol_kind::S_expr_add_array: // expr_add_array
@ -2696,7 +2658,7 @@ switch (yykind)
case symbol_kind::S_stmt: // stmt
case symbol_kind::S_stmt_or_dev: // stmt_or_dev
value.template destroy< stmt > ();
value.template destroy< stmt::ptr > ();
break;
case symbol_kind::S_stmt_assert: // stmt_assert
@ -2711,10 +2673,6 @@ switch (yykind)
value.template destroy< stmt_assertmsg::ptr > ();
break;
case symbol_kind::S_stmt_assign: // stmt_assign
value.template destroy< stmt_assign::ptr > ();
break;
case symbol_kind::S_stmt_break: // stmt_break
value.template destroy< stmt_break::ptr > ();
break;
@ -2723,10 +2681,6 @@ switch (yykind)
value.template destroy< stmt_breakpoint::ptr > ();
break;
case symbol_kind::S_stmt_call: // stmt_call
value.template destroy< stmt_call::ptr > ();
break;
case symbol_kind::S_stmt_case: // stmt_case
value.template destroy< stmt_case::ptr > ();
break;
@ -2756,6 +2710,8 @@ switch (yykind)
break;
case symbol_kind::S_stmt_expr: // stmt_expr
case symbol_kind::S_stmt_call: // stmt_call
case symbol_kind::S_stmt_assign: // stmt_assign
value.template destroy< stmt_expr::ptr > ();
break;
@ -5057,11 +5013,11 @@ switch (yykind)
{
case symbol_kind::S_expr_function: // expr_function
case symbol_kind::S_expr_pointer: // expr_pointer
value.copy< call > (YY_MOVE (that.value));
value.copy< call::ptr > (YY_MOVE (that.value));
break;
case symbol_kind::S_declaration: // declaration
value.copy< decl > (YY_MOVE (that.value));
value.copy< decl::ptr > (YY_MOVE (that.value));
break;
case symbol_kind::S_decl_constant: // decl_constant
@ -5078,16 +5034,16 @@ switch (yykind)
case symbol_kind::S_expr: // expr
case symbol_kind::S_expr_or_empty: // expr_or_empty
case symbol_kind::S_expr_assign: // expr_assign
case symbol_kind::S_expr_increment: // expr_increment
case symbol_kind::S_expr_decrement: // expr_decrement
case symbol_kind::S_expr_assign: // expr_assign
case symbol_kind::S_expr_ternary: // expr_ternary
case symbol_kind::S_expr_binary: // expr_binary
case symbol_kind::S_expr_primitive: // expr_primitive
case symbol_kind::S_expr_tuple: // expr_tuple
case symbol_kind::S_expr_tuple_types: // expr_tuple_types
case symbol_kind::S_expr_object: // expr_object
value.copy< expr > (YY_MOVE (that.value));
value.copy< expr::ptr > (YY_MOVE (that.value));
break;
case symbol_kind::S_expr_add_array: // expr_add_array
@ -5247,7 +5203,7 @@ switch (yykind)
case symbol_kind::S_stmt: // stmt
case symbol_kind::S_stmt_or_dev: // stmt_or_dev
value.copy< stmt > (YY_MOVE (that.value));
value.copy< stmt::ptr > (YY_MOVE (that.value));
break;
case symbol_kind::S_stmt_assert: // stmt_assert
@ -5262,10 +5218,6 @@ switch (yykind)
value.copy< stmt_assertmsg::ptr > (YY_MOVE (that.value));
break;
case symbol_kind::S_stmt_assign: // stmt_assign
value.copy< stmt_assign::ptr > (YY_MOVE (that.value));
break;
case symbol_kind::S_stmt_break: // stmt_break
value.copy< stmt_break::ptr > (YY_MOVE (that.value));
break;
@ -5274,10 +5226,6 @@ switch (yykind)
value.copy< stmt_breakpoint::ptr > (YY_MOVE (that.value));
break;
case symbol_kind::S_stmt_call: // stmt_call
value.copy< stmt_call::ptr > (YY_MOVE (that.value));
break;
case symbol_kind::S_stmt_case: // stmt_case
value.copy< stmt_case::ptr > (YY_MOVE (that.value));
break;
@ -5307,6 +5255,8 @@ switch (yykind)
break;
case symbol_kind::S_stmt_expr: // stmt_expr
case symbol_kind::S_stmt_call: // stmt_call
case symbol_kind::S_stmt_assign: // stmt_assign
value.copy< stmt_expr::ptr > (YY_MOVE (that.value));
break;
@ -5408,11 +5358,11 @@ switch (yykind)
{
case symbol_kind::S_expr_function: // expr_function
case symbol_kind::S_expr_pointer: // expr_pointer
value.move< call > (YY_MOVE (s.value));
value.move< call::ptr > (YY_MOVE (s.value));
break;
case symbol_kind::S_declaration: // declaration
value.move< decl > (YY_MOVE (s.value));
value.move< decl::ptr > (YY_MOVE (s.value));
break;
case symbol_kind::S_decl_constant: // decl_constant
@ -5429,16 +5379,16 @@ switch (yykind)
case symbol_kind::S_expr: // expr
case symbol_kind::S_expr_or_empty: // expr_or_empty
case symbol_kind::S_expr_assign: // expr_assign
case symbol_kind::S_expr_increment: // expr_increment
case symbol_kind::S_expr_decrement: // expr_decrement
case symbol_kind::S_expr_assign: // expr_assign
case symbol_kind::S_expr_ternary: // expr_ternary
case symbol_kind::S_expr_binary: // expr_binary
case symbol_kind::S_expr_primitive: // expr_primitive
case symbol_kind::S_expr_tuple: // expr_tuple
case symbol_kind::S_expr_tuple_types: // expr_tuple_types
case symbol_kind::S_expr_object: // expr_object
value.move< expr > (YY_MOVE (s.value));
value.move< expr::ptr > (YY_MOVE (s.value));
break;
case symbol_kind::S_expr_add_array: // expr_add_array
@ -5598,7 +5548,7 @@ switch (yykind)
case symbol_kind::S_stmt: // stmt
case symbol_kind::S_stmt_or_dev: // stmt_or_dev
value.move< stmt > (YY_MOVE (s.value));
value.move< stmt::ptr > (YY_MOVE (s.value));
break;
case symbol_kind::S_stmt_assert: // stmt_assert
@ -5613,10 +5563,6 @@ switch (yykind)
value.move< stmt_assertmsg::ptr > (YY_MOVE (s.value));
break;
case symbol_kind::S_stmt_assign: // stmt_assign
value.move< stmt_assign::ptr > (YY_MOVE (s.value));
break;
case symbol_kind::S_stmt_break: // stmt_break
value.move< stmt_break::ptr > (YY_MOVE (s.value));
break;
@ -5625,10 +5571,6 @@ switch (yykind)
value.move< stmt_breakpoint::ptr > (YY_MOVE (s.value));
break;
case symbol_kind::S_stmt_call: // stmt_call
value.move< stmt_call::ptr > (YY_MOVE (s.value));
break;
case symbol_kind::S_stmt_case: // stmt_case
value.move< stmt_case::ptr > (YY_MOVE (s.value));
break;
@ -5658,6 +5600,8 @@ switch (yykind)
break;
case symbol_kind::S_stmt_expr: // stmt_expr
case symbol_kind::S_stmt_call: // stmt_call
case symbol_kind::S_stmt_assign: // stmt_assign
value.move< stmt_expr::ptr > (YY_MOVE (s.value));
break;
@ -5793,7 +5737,7 @@ switch (yykind)
#line 13 "parser.ypp"
} } // xsk::gsc
#line 5797 "parser.hpp"
#line 5741 "parser.hpp"

View File

@ -39,13 +39,13 @@ private:
auto dump_decl_usingtree(decl_usingtree const& dec) -> void;
auto dump_decl_constant(decl_constant const& dec) -> void;
auto dump_decl_function(decl_function const& dec) -> void;
auto dump_decl_empty(decl_empty const& dec) -> void;
auto dump_stmt(stmt const& stm) -> void;
auto dump_stmt_empty(stmt_empty const& stm) -> void;
auto dump_stmt_list(stmt_list const& stm) -> void;
auto dump_stmt_comp(stmt_comp const& stm) -> void;
auto dump_stmt_dev(stmt_dev const& stm) -> void;
auto dump_stmt_expr(stmt_expr const& stm) -> void;
auto dump_stmt_call(stmt_call const& stm) -> void;
auto dump_stmt_assign(stmt_assign const& stm) -> void;
auto dump_stmt_endon(stmt_endon const& stm) -> void;
auto dump_stmt_notify(stmt_notify const& stm) -> void;
auto dump_stmt_wait(stmt_wait const& stm) -> void;
@ -71,39 +71,22 @@ private:
auto dump_stmt_assert(stmt_assert const& stm) -> void;
auto dump_stmt_assertex(stmt_assertex const& stm) -> void;
auto dump_stmt_assertmsg(stmt_assertmsg const& stm) -> void;
auto dump_stmt_create(stmt_create const& stm) -> void;
auto dump_stmt_remove(stmt_remove const& stm) -> void;
auto dump_stmt_clear(stmt_clear const& stm) -> void;
auto dump_stmt_jmp(stmt_jmp const& stm) -> void;
auto dump_stmt_jmp_back(stmt_jmp_back const& stm) -> void;
auto dump_stmt_jmp_cond(stmt_jmp_cond const& stm) -> void;
auto dump_stmt_jmp_true(stmt_jmp_true const& stm) -> void;
auto dump_stmt_jmp_false(stmt_jmp_false const& stm) -> void;
auto dump_stmt_jmp_switch(stmt_jmp_switch const& stm) -> void;
auto dump_stmt_jmp_endswitch(stmt_jmp_endswitch const& stm) -> void;
auto dump_expr(expr const& exp) -> void;
auto dump_expr_increment(expr_increment const& exp) -> void;
auto dump_expr_decrement(expr_decrement const& exp) -> void;
auto dump_expr_assign_equal(expr_assign_equal const& exp) -> void;
auto dump_expr_assign_add(expr_assign_add const& exp) -> void;
auto dump_expr_assign_sub(expr_assign_sub const& exp) -> void;
auto dump_expr_assign_mul(expr_assign_mul const& exp) -> void;
auto dump_expr_assign_div(expr_assign_div const& exp) -> void;
auto dump_expr_assign_mod(expr_assign_mod const& exp) -> void;
auto dump_expr_assign_shift_left(expr_assign_shift_left const& exp) -> void;
auto dump_expr_assign_shift_right(expr_assign_shift_right const& exp) -> void;
auto dump_expr_assign_bitwise_or(expr_assign_bitwise_or const& exp) -> void;
auto dump_expr_assign_bitwise_and(expr_assign_bitwise_and const& exp) -> void;
auto dump_expr_assign_bitwise_exor(expr_assign_bitwise_exor const& exp) -> void;
auto dump_expr_assign(expr_assign const& exp) -> void;
auto dump_expr_ternary(expr_ternary const& exp) -> void;
auto dump_expr_or(expr_or const& exp) -> void;
auto dump_expr_and(expr_and const& exp) -> void;
auto dump_expr_equality(expr_equality const& exp) -> void;
auto dump_expr_inequality(expr_inequality const& exp) -> void;
auto dump_expr_less_equal(expr_less_equal const& exp) -> void;
auto dump_expr_greater_equal(expr_greater_equal const& exp) -> void;
auto dump_expr_less(expr_less const& exp) -> void;
auto dump_expr_greater(expr_greater const& exp) -> void;
auto dump_expr_add(expr_add const& exp) -> void;
auto dump_expr_sub(expr_sub const& exp) -> void;
auto dump_expr_mul(expr_mul const& exp) -> void;
auto dump_expr_div(expr_div const& exp) -> void;
auto dump_expr_mod(expr_mod const& exp) -> void;
auto dump_expr_shift_left(expr_shift_left const& exp) -> void;
auto dump_expr_shift_right(expr_shift_right const& exp) -> void;
auto dump_expr_bitwise_or(expr_bitwise_or const& exp) -> void;
auto dump_expr_bitwise_and(expr_bitwise_and const& exp) -> void;
auto dump_expr_bitwise_exor(expr_bitwise_exor const& exp) -> void;
auto dump_expr_binary(expr_binary const& exp) -> void;
auto dump_expr_not(expr_not const& exp) -> void;
auto dump_expr_negate(expr_negate const& exp) -> void;
auto dump_expr_complement(expr_complement const& exp) -> void;
@ -141,19 +124,8 @@ private:
auto dump_expr_integer(expr_integer const& exp) -> void;
auto dump_expr_false(expr_false const& exp) -> void;
auto dump_expr_true(expr_true const& exp) -> void;
auto dump_asm_jmp(asm_jmp const& exp) -> void;
auto dump_asm_jmp_back(asm_jmp_back const& exp) -> void;
auto dump_asm_jmp_cond(asm_jmp_cond const& exp) -> void;
auto dump_asm_jmp_true(asm_jmp_true const& exp) -> void;
auto dump_asm_jmp_false(asm_jmp_false const& exp) -> void;
auto dump_asm_switch(asm_switch const& exp) -> void;
auto dump_asm_endswitch(asm_endswitch const& exp) -> void;
auto dump_asm_prescriptcall(asm_prescriptcall const& exp) -> void;
auto dump_asm_voidcodepos(asm_voidcodepos const& exp) -> void;
auto dump_asm_create(asm_create const& exp) -> void;
auto dump_asm_access(asm_access const& exp) -> void;
auto dump_asm_remove(asm_remove const& exp) -> void;
auto dump_asm_clear(asm_clear const& exp) -> void;
auto dump_expr_var_create(expr_var_create const& exp) -> void;
auto dump_expr_var_access(expr_var_access const& exp) -> void;
};
} // namespace xsk::gsc

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -725,9 +725,9 @@ auto context::load_include(std::string const& name) -> bool
for (auto const& dec : prog->declarations)
{
if (dec == node::decl_function)
if (dec->is<decl_function>())
{
funcs.push_back(dec.as_function->name->value);
funcs.push_back(dec->as<decl_function>().name->value);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff