Commit 76027f3e authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Save pr with aggregation, and reload properly

parent 829c8d2f
......@@ -332,7 +332,8 @@ def _state(symbol, recursive=True, nextstate=True, composite=False, cpy=False,
else:
# Generate code for a nested state
result = Indent()
result.append('STATE {};'.format(unicode(symbol).split()[0]))
agg = ' AGGREGATION' if not list(symbol.nested_scene.start) else ''
result.append('STATE{} {};'.format(agg, unicode(symbol).split()[0]))
result.append('SUBSTRUCTURE')
Indent.indent += 1
entry_points, exit_points = [], []
......
......@@ -2,7 +2,7 @@
 
# Resource object code
#
# Created: Tue Oct 13 21:25:22 2015
# Created: Tue Oct 20 15:17:00 2015
# by: The Resource Compiler for PySide (Qt v4.8.6)
#
# WARNING! All changes made in this file will be lost!
......@@ -1971,8 +1971,7 @@ def composite_state(root, parent=None, context=None):
str(comp.statename)),
[0 , 0], # No graphical position
[]])
if (states or floatings or starts) and isinstance(comp,
ogAST.StateAggregation):
if (floatings or starts) and isinstance(comp, ogAST.StateAggregation):
errors.append(['State aggregation can only contain composite state(s)',
[0, 0], []])
for each in inner_composite:
......
# $ANTLR 3.1.3 Mar 17, 2009 19:23:44 sdl92.g 2015-10-13 21:25:24
# $ANTLR 3.1.3 Mar 17, 2009 19:23:44 sdl92.g 2015-10-20 15:17:07
import sys
from antlr3 import *
......@@ -9,232 +9,232 @@ from antlr3.compat import set, frozenset
HIDDEN = BaseRecognizer.HIDDEN
# token types
NUMBER_OF_INSTANCES=61
COMMENT2=219
MANTISSA=176
ROUTE=82
MOD=168
GROUND=45
PARAM=66
NOT=170
SEQOF=85
TEXTAREA_CONTENT=109
EOF=-1
ACTION=4
CREATE=158
IMPORT=180
FPAR=44
NEXTSTATE=60
RETURN=81
THIS=159
ENTRY_POINT=32
ENDSTATE=137
STR=215
PROCESS=76
STOP=96
ENDFOR=160
PROVIDED=77
CONDITIONAL=19
CHANNEL=13
VIAPATH=120
ENDCONNECTION=135
EXPORT=33
EQ=152
GEODE=184
INFORMAL_TEXT=50
THEN=110
XOR=163
CALL=148
A=190
B=212
PFPAR=70
SET=87
C=194
D=193
E=196
F=203
GE=157
G=204
A=190
IMPLIES=161
B=212
C=194
L=195
M=200
N=191
O=205
STOPIF=97
TERMINATOR=106
H=206
L_BRACKET=188
I=202
ELSE=27
OPEN_RANGE=63
J=213
K=197
U=209
T=207
W=211
TYPE_INSTANCE=114
STOP=96
V=210
INT=133
Q=220
L=195
M=200
ENDSYSTEM=121
N=191
O=205
P=198
S=201
VALUE=116
Q=220
R=199
Y=192
S=201
T=207
U=209
VARIABLE=117
V=210
GROUND=45
W=211
X=208
FI=36
Y=192
FPAR=44
Z=221
MINUS_INFINITY=175
WS=218
OUT=132
NONE=143
INPUT_NONE=53
CONSTANT=22
GT=154
CALL=148
END=186
FLOATING_LABEL=42
IFTHENELSE=48
POINT=71
INPUT=52
ENDSUBSTRUCTURE=140
FLOAT=41
SUBSTRUCTURE=139
T__223=223
ASTERISK=138
T__222=222
PROCEDURE=73
PARAMNAMES=67
PAREN=69
INOUT=51
STR=215
STIMULUS=95
APPEND=166
NEWTYPE=59
CONNECTION=21
DIV=167
SELECTOR=84
THEN=110
ENDDECISION=150
OPEN_RANGE=63
SIGNAL=88
ENDSYSTEM=121
PLUS=164
CHOICE=14
TASK_BODY=105
PARAMS=68
CLOSED_RANGE=16
STATE=91
STATELIST=94
MINUS_INFINITY=175
STRING=98
VARIABLES=118
TO=112
REM=169
ASSIG_OP=187
SIGNALROUTE=127
ENDSYNTYPE=30
SORT=90
SET=87
TEXT=107
SEMI=136
TEXTAREA=108
T__228=228
T__224=224
T__225=225
T__226=226
T__227=227
BLOCK=12
CIF=15
START=134
DECISION=25
DIV=167
PROCESS=76
STRING=98
INPUTLIST=54
EXTERNAL=35
LT=155
EXPONENT=178
TRANSITION=113
ENDBLOCK=126
RESET=80
ENDNEWTYPE=29
SIGNAL_LIST=89
ENDTEXT=31
CONNECTION=21
SYSTEM=103
CONNECT=20
STATE_PARTITION_CONNECTION=93
L_PAREN=145
PROCEDURE_CALL=74
BASE=177
COMMENT=17
SYNONYM=100
ENDALTERNATIVE=149
ARRAY=8
ACTIVE=179
ENDFOR=160
FIELD_NAME=38
VIEW=181
OCTSTR=62
EMPTYSTR=28
PFPAR=70
ROUTE=82
T__223=223
T__222=222
ENDCHANNEL=123
NULL=173
ANSWER=7
CONDITIONAL=19
PRIMARY=72
TASK=104
REFERENCED=129
IFTHENELSE=48
TASK_BODY=105
ALPHA=216
SEQUENCE=86
VARIABLE=117
PRIORITY=144
VIEW=181
HYPERLINK=46
LABEL=56
CIF=15
OUTPUT=64
FOR=43
INPUTLIST=54
EQ=152
FLOATING_LABEL=42
VIAPATH=120
FLOAT2=40
NOT=170
SPECIFIC=183
AGGREGATION=141
OR=162
COMPOSITE_STATE=18
FIELD=37
USE=115
FROM=124
STIMULUS=95
THIS=159
ENDPROCEDURE=131
FALSE=172
OUTPUT=64
SYNONYM_LIST=101
APPEND=166
L_BRACKET=188
END=186
AGGREGATION=141
FI=36
DIGITS=26
HYPERLINK=46
NEWTYPE=59
Exponent=217
FOR=43
ENDSTATE=137
STATE=91
OUTPUT_BODY=65
QUESTION=78
BITSTR=11
BASE=177
RETURN=81
STATE_AGGREGATION=92
ENDNEWTYPE=29
SEQUENCE=86
R_PAREN=146
WS=218
EOF=-1
GE=157
NEXTSTATE=60
ANSWER=7
MOD=168
SEQOF=85
PLUS_INFINITY=174
PARAM=66
R_BRACKET=189
GT=154
WITH=125
ACTION=4
STOPIF=97
T__228=228
START=134
FALSE=172
T__225=225
T__224=224
T__227=227
DEFAULT=142
T__226=226
IMPLIES=161
ENDCONNECTION=135
ENDDECISION=150
EXPORT=33
JOIN=55
TEXT=107
REFERENCED=129
ALTERNATIVE=6
SYNTYPE=102
ELSE=27
PROCEDURE_NAME=75
CONSTANTS=23
ID=122
AND=128
FLOAT2=40
NONE=143
IF=47
SUBSTRUCTURE=139
FIELDS=39
LITERAL=57
IN=49
PROVIDED=77
COMMA=147
ALL=5
ASNFILENAME=185
FIELD=37
DOT=214
SYNONYM=100
OUT=132
ENDBLOCK=126
STATELIST=94
SEMI=136
CONNECT=20
ASN1=9
ASSIGN=10
COMMENT=17
IMPORT=180
MANTISSA=176
SAVE=83
CLOSED_RANGE=16
SIGNAL=88
COMMA=147
ENDTEXT=31
NUMBER_OF_INSTANCES=61
USE=115
CONSTANT=22
ASTERISK=138
COMMENT2=219
TRANSITION=113
NEG=58
LE=156
EXPONENT=178
NEQ=153
GEODE=184
EXPRESSION=34
WITH=125
BITSTR=11
XOR=163
ALL=5
SYNONYM_LIST=101
TERMINATOR=106
DECISION=25
TEXTAREA_CONTENT=109
ARRAY=8
INPUT=52
LT=155
STATE_PARTITION_CONNECTION=93
ENDALTERNATIVE=149
RESET=80
VALUE=116
FROM=124
DASH=165
ENDPROCESS=130
TASK=104
NULL=173
KEEP=182
BLOCK=12
TRUE=171
ENDSYNTYPE=30
DCL=24
DEFAULT=142
VIA=119
RANGE=79
OCTSTR=62
AND=128
SORT=90
PARAMS=68
STRUCT=99
LITERAL=57
SAVE=83
FIELDS=39
REM=169
STATE_AGGREGATION=92
TRUE=171
JOIN=55
PROCEDURE=73
R_BRACKET=189
R_PAREN=146
OUTPUT_BODY=65
NEQ=153
RANGE=79
PLUS=164
INOUT=51
FLOAT=41
CONSTANTS=23
ACTIVE=179
Exponent=217
L_PAREN=145
ANY=151
QUESTION=78
LABEL=56
PLUS_INFINITY=174
PARAMNAMES=67
ASN1=9
ENTRY_POINT=32
KEEP=182
NEG=58
VARIABLES=118
ASSIGN=10
ALTERNATIVE=6
SYNTYPE=102
INT=133
CHOICE=14
EXTERNAL=35
FIELD_NAME=38
TYPE_INSTANCE=114
ENDSUBSTRUCTURE=140
PROCEDURE_CALL=74
TEXTAREA=108
OR=162
SIGNAL_LIST=89
INFORMAL_TEXT=50
TIMER=111
LE=156
PRIMARY=72
COMPOSITE_STATE=18
VIA=119
ASNFILENAME=185
ENDPROCESS=130
EMPTYSTR=28
SIGNALROUTE=127
INPUT_NONE=53
POINT=71
class sdl92Lexer(Lexer):
......@@ -458,8 +458,8 @@ class sdl92Lexer(Lexer):
_type = ASSIG_OP
_channel = DEFAULT_CHANNEL
# sdl92.g:1412:17: ( ':=' )
# sdl92.g:1412:25: ':='
# sdl92.g:1413:17: ( ':=' )
# sdl92.g:1413:25: ':='
pass
self.match(":=")
......@@ -483,8 +483,8 @@ class sdl92Lexer(Lexer):
_type = L_BRACKET
_channel = DEFAULT_CHANNEL
# sdl92.g:1413:17: ( '{' )
# sdl92.g:1413:25: '{'
# sdl92.g:1414:17: ( '{' )
# sdl92.g:1414:25: '{'
pass
self.match(123)
......@@ -508,8 +508,8 @@ class sdl92Lexer(Lexer):
_type = R_BRACKET
_channel = DEFAULT_CHANNEL
# sdl92.g:1414:17: ( '}' )
# sdl92.g:1414:25: '}'
# sdl92.g:1415:17: ( '}' )
# sdl92.g:1415:25: '}'
pass
self.match(125)
......@@ -533,8 +533,8 @@ class sdl92Lexer(Lexer):
_type = L_PAREN
_channel = DEFAULT_CHANNEL
# sdl92.g:1415:17: ( '(' )
# sdl92.g:1415:25: '('
# sdl92.g:1416:17: ( '(' )
# sdl92.g:1416:25: '('
pass
self.match(40)
......@@ -558,8 +558,8 @@ class sdl92Lexer(Lexer):
_type = R_PAREN
_channel = DEFAULT_CHANNEL
# sdl92.g:1416:17: ( ')' )
# sdl92.g:1416:25: ')'
# sdl92.g:1417:17: ( ')' )
# sdl92.g:1417:25: ')'
pass
self.match(41)
......@@ -583,8 +583,8 @@ class sdl92Lexer(Lexer):
_type = COMMA
_channel = DEFAULT_CHANNEL
# sdl92.g:1417:17: ( ',' )
# sdl92.g:1417:25: ','
# sdl92.g:1418:17: ( ',' )
# sdl92.g:1418:25: ','
pass
self.match(44)
......@@ -608,8 +608,8 @@ class sdl92Lexer(Lexer):
_type = SEMI
_channel = DEFAULT_CHANNEL
# sdl92.g:1418:17: ( ';' )
# sdl92.g:1418:25: ';'
# sdl92.g:1419:17: ( ';' )
# sdl92.g:1419:25: ';'
pass
self.match(59)
......@@ -633,8 +633,8 @@ class sdl92Lexer(Lexer):
_type = DASH
_channel = DEFAULT_CHANNEL
# sdl92.g:1419:17: ( '-' )
# sdl92.g:1419:25: '-'
# sdl92.g:1420:17: ( '-' )
# sdl92.g:1420:25: '-'
pass
self.match(45)
......@@ -658,8 +658,8 @@ class sdl92Lexer(Lexer):
_type = ANY
_channel = DEFAULT_CHANNEL
# sdl92.g:1420:17: ( A N Y )
# sdl92.g:1420:25: A N Y
# sdl92.g:1421:17: ( A N Y )
# sdl92.g:1421:25: A N Y
pass
self.mA()
self.mN()
......@@ -685,8 +685,8 @@ class sdl92Lexer(Lexer):
_type = ASTERISK
_channel = DEFAULT_CHANNEL
# sdl92.g:1421:17: ( '*' )
# sdl92.g:1421:25: '*'
# sdl92.g:1422:17: ( '*' )
# sdl92.g:1422:25: '*'
pass
self.match(42)
......@@ -710,8 +710,8 @@ class sdl92Lexer(Lexer):
_type = DCL
_channel = DEFAULT_CHANNEL
# sdl92.g:1422:17: ( D C L )
# sdl92.g:1422:25: D C L
# sdl92.g:1423:17: ( D C L )
# sdl92.g:1423:25: D C L
pass
self.mD()
self.mC()
......@@ -737,8 +737,8 @@ class sdl92Lexer(Lexer):
_type = END
_channel = DEFAULT_CHANNEL
# sdl92.g:1423:17: ( E N D )
# sdl92.g:1423:25: E N D
# sdl92.g:1424:17: ( E N D )
# sdl92.g:1424:25: E N D
pass
self.mE()
self.mN()
......@@ -764,8 +764,8 @@ class sdl92Lexer(Lexer):
_type = KEEP
_channel = DEFAULT_CHANNEL
# sdl92.g:1424:17: ( K E E P )
# sdl92.g:1424:25: K E E P
# sdl92.g:1425:17: ( K E E P )
# sdl92.g:1425:25: K E E P
pass
self.mK()
self.mE()
......@@ -792,8 +792,8 @@ class sdl92Lexer(Lexer):
_type = PARAMNAMES
_channel = DEFAULT_CHANNEL
# sdl92.g:1425:17: ( P A R A M N A M E S )
# sdl92.g:1425:25: P A R A M N A M E S
# sdl92.g:1426:17: ( P A R A M N A M E S )
# sdl92.g:1426:25: P A R A M N A M E S
pass
self.mP()
self.mA()
......@@ -826,8 +826,8 @@ class sdl92Lexer(Lexer):
_type = SPECIFIC
_channel = DEFAULT_CHANNEL
# sdl92.g:1426:17: ( S P E C I F I C )
# sdl92.g:1426:25: S P E C I F I C
# sdl92.g:1427:17: ( S P E C I F I C )
# sdl92.g:1427:25: S P E C I F I C
pass
self.mS()
self.mP()
......@@ -858,8 +858,8 @@ class sdl92Lexer(Lexer):
_type = GEODE
_channel = DEFAULT_CHANNEL
# sdl92.g:1427:17: ( G E O D E )
# sdl92.g:1427:25: G E O D E
# sdl92.g:1428:17: ( G E O D E )
# sdl92.g:1428:25: G E O D E
pass
self.mG()
self.mE()
......@@ -887,8 +887,8 @@ class sdl92Lexer(Lexer):
_type = HYPERLINK
_channel = DEFAULT_CHANNEL
# sdl92.g:1428:17: ( H Y P E R L I N K )
# sdl92.g:1428:25: H Y P E R L I N K
# sdl92.g:1429:17: ( H Y P E R L I N K )
# sdl92.g:1429:25: H Y P E R L I N K
pass
self.mH()
self.mY()
......@@ -920,8 +920,8 @@ class sdl92Lexer(Lexer):
_type = ENDTEXT
_channel = DEFAULT_CHANNEL