[Bug 544] New: Unable have event transition with no select statements

For more infomation about this bug, visit <https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=544>

           Summary: Unable have event transition with no select statements
           Product: RTT
           Version: rtt-trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Real-Time Toolkit (RTT)
        AssignedTo: orocos-dev at lists [dot] mech [dot] kuleuven [dot] be
        ReportedBy: kiwi.net at mac [dot] com
                CC: orocos-dev at lists [dot] mech [dot] kuleuven [dot] be
   Estimated Hours: 0.0

This may not technically be legal ... Was playing with work-arounds for #543,
and found that the following was considered invalid. It's very similar to #178.


  state JJ_POINT2POINT
  {
    entry
        {
            do nAxesGeneratorPos.start()
            do Robot.requestPositionControl()
            do nAxesGeneratorPos.moveTo(jjPoint2Point_pose,                    
                                                jjPoint2Point_time)
        }
    exit
        {
       do nAxesGeneratorPos.stop()
    }
    transition requestSafe() select SAFE
    transition requestJJPoint2Point(
           jjPoint2Point_pose, jjPoint2Point_time) 
           {
            do nAxesGeneratorPos.moveTo(jjPoint2Point_pose, 
                                        jjPoint2Point_time)
           }
  }

The above produces "Syntactic error: 'select' statement required after event or
transition program" and indicates the second transition is the problem.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

[Bug 544] Unable have event transition with no select statements

For more infomation about this bug, visit <https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=544>

Peter Soetens <peter.soetens at fmtc [dot] be> changed:

           What    |Removed                     |Added
 --------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|orocos-                     |peter.soetens@fmtc.be
                   |dev@lists.mech.kuleuven.be  |
--- Comment #1 from Peter Soetens <peter.soetens at fmtc [dot] be>  2008-05-09 23:35:43 ---

Created an attachment (id=279)

 --> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=279)

Fixes the transitions notation and this bug

Being a paranormal open source case, I was already working on a patch for this.
I've updated the syntax such that it is now valid to write:

 transitions {
    select X
    if c then select X
    if c then  { do nothing } 
    if c then { do nothing } select X
    myEvent() select X
    myEvent() if c then select X
    myEvent() if c then {do nothing}
    myEvent() if c then {do nothing} select X
 }

An alternative notation is also accepted using the 'transition' keyword:

 transition select X
 transition if c then select X
 transition myEvent() select X
 etc...

The latter notation is used in the examples in the scripting manual.

Unit tested change.


[Bug 544] Unable have event transition with no select statements

For more infomation about this bug, visit <https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=544>

Peter Soetens <peter.soetens at fmtc [dot] be> changed:

           What    |Removed                     |Added
 --------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.6.0
--- Comment #2 from Peter Soetens <peter.soetens at fmtc [dot] be>  2008-05-09 23:37:31 ---

Patch applied on trunk/rtt.

$ svn ci -m"Fix bug #544: Unable have event transition with no select
statements:
> Rewrote the transition parsing, added unit tests, updated documentation.
> "
Sending rtt/doc/xml/orocos-program-parser.xml
Sending rtt/src/scripting/StateGraphParser.cpp
Sending rtt/src/scripting/StateGraphParser.hpp
Sending rtt/tests/state_test.cpp
Sending rtt/tests/state_test.hpp
Transmitting file data .....
Committed revision 29269.