Stateflow    

Parsing Diagram Example

These steps describe parsing, assuming this Stateflow diagram.

  1. Parse the Stateflow diagram.
  1. Choose Parse Diagram from the graphics editor Tools menu to parse the Stateflow diagram. State A in the upper left corner is selected and this message is displayed in the pop-up window and the MATLAB Command Window.

  1. Fix the parse error.
  1. In this example, there are two states with the name A. Edit the Stateflow diagram and label the duplicate state with the text B.

    The Stateflow diagram should look similar to this.

  1. Reparse.
  1. Choose Parse Diagram from the graphics editor Tools menu. This message displays in the pop-up menu and the MATLAB Command Window.

  1. Fix the parse error.
  1. In this example, the state with the question mark needs to be labeled with at least a state name. Edit the Stateflow diagram and label the state with the text C. The Stateflow diagram should look similar to this.

  1. Reparse.
  1. Choose Parse Diagram from the graphics editor Tools menu. This message is displayed in the pop-up window and the MATLAB Command Window.

  1. Fix the parse error.
  1. In this example, the transition label contains a syntax error. The closing bracket of the condition is missing. Edit the Stateflow diagram and add the closing bracket so that the label is E_one [C_one].

  1. Reparse.
  1. Choose Parse Diagram from the graphics editor Tools menu. This message is displayed in the pop-up window and the MATLAB Command Window.

    The Stateflow diagram now has no parse errors.


  Parsing Stateflow Diagrams Resolving Event, Data, and Function Symbols