- When yacc/bison yyparse() successfully terminates, EFSM values are also set for the EFSM object. The parameters/variables presented at each component (input, output, assignment, set, reset, enablingPredicate, or procedureCall) are stored in the parameter/variable list of each component accordingly. The parameters/variables in each list follow the order of their appearances as in the EFSM file.
- For an input or an output component, if the statement does not contain any variable, then the parameter/variable list is empty.
- For an assignment component, the first element in the parameter/variable list is the left-most variable in the assignment statement, i.e., the variable appearing before the assignment operator (:=).
- For a set or a reset component, the timerId is stored in the parameter/variable list.
- For an enablingPredicate component, the used variables are stored in the parameter/variable list, but the boolean expression is ignored for now.
- A procedureCall component is syntactically composed of a number of assignment components, separated from each other in the paramater/variable list of the component by a semi-colon (;), i.e., the top assignment component in the procedureCall is the left-most element in the list, and the bottom assignment component in the procedureCall is the right-most element in the list.
- The next task is to classify the occurrences of parameters/variables (def, cuse, or puse) and assign an order to the occurrences of parameters/variables in each transition in the EFSM.
- The components in a transition are processed from top-to-bottom and the occurrences of parameters/variables in each component are given an order from right-to-left.
For example, in transition T2 of the ATM System, variable attempts occurs twice in the assignment component. Applying the right-to-left rule, the first occurrence of variable attempts in that component is identified as a cuse and the second occurrence is identified as a def, respectively taking the 5th and the 6th in the order of occurrences of all variables from top-to-bottom in transition T2.
- The resultant quadruples (oType, var, tLabel, oOrder) for parameter/variable occurrences are stored at each transition accordingly, where:
- oType is the type of occurrence, i.e., def, cuse, or puse
- var is the variable identifier
- tLabel is the label of the transition
- oOrder is the order of occurrence of that variable in this transition
Continuing the previous example, transition T2 of the ATM System contains two quadruples for the assignment component: (cuse, attempts, T2, 5) and (def, attempts, T2, 6).
- Each component also maintains one pointer for each of the quadruples (oType, var, tLabel, oOrder) for parameter/variable occurrences within the component. That is to avoid redundancy in data storing but still keeping the relationship between each component and its resultant quadruples.
- More examples for the ATM System can be found in the test log (testEFSM).
- After parameter/variable occurrences are classified and their order of occurrences are assigned, the previous parameter/variable list of each component is destroyed to save memory.
Home