jp-embedded / scxmlcc

The SCXML state machine to C++ compiler
GNU General Public License v3.0
138 stars 34 forks source link

Undeclared event on <raise> #72

Closed sstiller closed 5 years ago

sstiller commented 5 years ago

If a signal is triggered with <raise>, but it has no matching transition in the SM, it leads to a compile error.

The solution should be similar to the fix for #69

Example:

<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" binding="early" name="raise" datamodel="cplusplus">
    <state id="State_1">
        <onentry>
            <raise event="ev1"/>
        </onentry>
    </state>
</scxml>

Result:

raise.h: In member function ‘void sc_raise::state_actions<C>::enter(sc_raise::data_model&) [with C = sc_raise::state_State_1]::with::operator()()’:
raise.h:163:46: error: ‘event_ev1’ is not a member of ‘sc_raise::state’
   event_queue.emplace_back(&sc_raise::state::event_ev1);
                                              ^~~~~~~~~
jp-embedded commented 5 years ago

fixed