google-code-export / umple

Automatically exported from code.google.com/p/umple
1 stars 0 forks source link

when there is no space between -> and / in a state transition it is not recognized as two tokens #547

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Enter the following code:

class X {
  sm2 {
    s1 {
      ->/ {checksComplete=0;}  s2;
    }
    s2 {}
  }
}

It raises
Error on line 4 : State name '>/' must be alphanumeric and start with a letter. 
More information (152)
Warning on line 4 : State machine syntax could not be processed. It has been 
considered as Extra Code. More information (1006)
Warning on line 4 : State machine syntax could not be processed. It has been 
considered as Extra Code. More information (1006)

But if I add a space after the -> all is fine.

Original issue reported on code.google.com by TimothyCLethbridge on 2 May 2014 at 1:50

GoogleCodeExporter commented 9 years ago

Original comment by TimothyCLethbridge on 2 May 2014 at 3:55

GoogleCodeExporter commented 9 years ago
Cause: This problem was caused by a misinterpretation of the State Machine 
Grammar rule:

stateInternal-: [[comment]] | [=changeType:+|-|*]? [[stateEntity]] | 
[**extraCode]

"->/" was being seem as [changeType:-][state][stateName:>/] instead of 
[autoTransition][action]

Solution: Changing the rules that analyse the [change type] token to:

extendedStateMachine#: ( [[comment]] | [=changeType:+| - |- |*]? [[state]] )*
stateInternal-# : [[comment]] | [=changeType:+| - |- |*]? [[stateEntity]] | 
[**extraCode]

Obs: This solution still need to be fully tested to make sure that the parser 
is working properly. In special tests involving change type operations of a 
state machine. 

Original comment by PedroAug...@gmail.com on 9 May 2014 at 7:34

GoogleCodeExporter commented 9 years ago

Original comment by PedroAug...@gmail.com on 15 May 2014 at 6:45

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by TimothyCLethbridge on 15 May 2014 at 8:09