Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
29bcca73
Commit
29bcca73
authored
Oct 16, 2014
by
Maxime Perrotin
Browse files
Fix positionning of symbols when loading/rendering
parent
abfe2a93
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
genericSymbols.py
View file @
29bcca73
...
...
@@ -695,15 +695,17 @@ class Comment(Symbol):
def
__init__
(
self
,
parent
=
None
,
ast
=
None
):
ast
=
ast
or
ogAST
.
Comment
()
self
.
ast
=
ast
super
(
Comment
,
self
).
__init__
(
parent
)
self
.
connection
=
None
if
parent
:
local_pos
=
parent
.
mapFromScene
(
ast
.
pos_x
,
ast
.
pos_y
)
self
.
insert_symbol
(
parent
,
local_pos
.
x
(),
local_pos
.
y
())
self
.
set_shape
(
ast
.
width
,
ast
.
height
)
self
.
text
=
EditableText
(
parent
=
self
,
text
=
ast
.
inputString
,
hyperlink
=
ast
.
hyperlink
)
if
parent
:
local_pos
=
parent
.
mapFromScene
(
ast
.
pos_x
or
0
,
ast
.
pos_y
or
0
)
self
.
insert_symbol
(
parent
,
local_pos
.
x
(),
local_pos
.
y
())
#self.set_shape(ast.width, ast.height)
self
.
common_name
=
'end'
self
.
parser
=
ogParser
...
...
ogAST.py
View file @
29bcca73
...
...
@@ -293,8 +293,7 @@ class Decision(object):
self
.
inputString
=
''
self
.
line
=
None
self
.
charPositionInLine
=
None
self
.
pos_x
=
0
self
.
pos_y
=
0
self
.
pos_x
,
self
.
pos_y
=
None
,
None
self
.
width
=
70
self
.
height
=
50
# kind can be 'any', 'informal_text', or 'question'
...
...
@@ -325,8 +324,7 @@ class Answer(object):
self
.
inputString
=
''
self
.
line
=
None
self
.
charPositionInLine
=
None
self
.
pos_x
=
0
self
.
pos_y
=
0
self
.
pos_x
,
self
.
pos_y
=
None
,
None
self
.
width
=
70
self
.
height
=
10.5
# one of 'closed_range' 'constant' 'open_range' 'else' 'informal_text'
...
...
@@ -360,8 +358,7 @@ class Task(object):
self
.
inputString
=
''
self
.
line
=
None
self
.
charPositionInLine
=
None
self
.
pos_x
=
0
self
.
pos_y
=
0
self
.
pos_x
,
self
.
pos_y
=
None
,
None
self
.
width
=
70
self
.
height
=
35
# optional comment symbol
...
...
@@ -400,8 +397,7 @@ class Output(object):
def
__init__
(
self
,
defName
=
''
):
''' Set of OUTPUT statements '''
self
.
inputString
=
defName
self
.
pos_x
=
0
self
.
pos_y
=
0
self
.
pos_x
,
self
.
pos_y
=
None
,
None
self
.
width
=
70
self
.
height
=
35
self
.
line
=
None
...
...
@@ -475,7 +471,7 @@ class Label(object):
''' Initialize the label attributes '''
# inputString holds the label name
self
.
inputString
=
''
self
.
pos_x
=
0
self
.
pos_x
,
self
.
pos_y
=
None
,
None
self
.
pos_y
=
0
self
.
width
=
70
self
.
height
=
35
...
...
@@ -496,7 +492,7 @@ class Label(object):
l
=
self
.
line
,
c
=
self
.
charPositionInLine
)
class
Floating_label
(
Label
,
object
):
class
Floating_label
(
Label
):
''' AST Entry for a floating label '''
def
__init__
(
self
,
label
=
None
):
''' Initialize the floating label attributes '''
...
...
@@ -549,8 +545,7 @@ class Input(object):
''' Initialize the Input attributes '''
# inputString is the user text, it can contain several inputs
self
.
inputString
=
''
self
.
pos_x
=
0
self
.
pos_y
=
0
self
.
pos_x
,
self
.
pos_y
=
None
,
None
self
.
width
=
70
self
.
height
=
35
self
.
line
=
None
...
...
@@ -599,8 +594,7 @@ class Start(object):
def
__init__
(
self
):
''' Initialize the Start symbol attributes '''
self
.
inputString
=
''
self
.
pos_x
=
0
self
.
pos_y
=
0
self
.
pos_x
,
self
.
pos_y
=
None
,
None
self
.
width
=
70
self
.
height
=
35
# start transition is of type Transition
...
...
@@ -633,8 +627,8 @@ class Comment(object):
''' Comment symbol '''
# inputString is the comment value itself
self
.
inputString
=
''
self
.
pos_x
=
0
self
.
pos_y
=
0
self
.
pos_x
=
None
self
.
pos_y
=
None
self
.
width
=
70
self
.
height
=
35
self
.
line
=
None
...
...
@@ -659,7 +653,7 @@ class State(object):
self
.
statelist
=
[]
self
.
line
=
None
self
.
charPositionInLine
=
None
self
.
pos_x
=
0
self
.
pos_x
,
self
.
pos_y
=
None
,
None
self
.
pos_y
=
0
self
.
width
=
70
self
.
height
=
35
...
...
@@ -690,8 +684,7 @@ class TextArea(object):
self
.
line
=
None
self
.
charPositionInLine
=
None
# Set default coordinates and width/height
self
.
pos_x
=
0
self
.
pos_y
=
0
self
.
pos_x
,
self
.
pos_y
=
None
,
None
self
.
width
=
170
self
.
height
=
140
# DCL variables in the text area {name: (sort, default_value), ...}
...
...
@@ -731,7 +724,7 @@ class Procedure(object):
self
.
line
=
None
self
.
charPositionInLine
=
None
# Set default coordinates and width/height
self
.
pos_x
=
self
.
pos_y
=
0
self
.
pos_x
=
self
.
pos_y
=
None
self
.
width
=
70
self
.
height
=
35
# Optional hyperlink
...
...
opengeode.py
View file @
29bcca73
...
...
@@ -422,6 +422,25 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
# Render top-level items and their children:
for
each
in
Renderer
.
render
(
content
,
dest_scene
):
G_SYMBOLS
.
add
(
each
)
# Refreshing the scene may result in resizing some symbols
dest_scene
.
refresh
()
for
each
in
dest_scene
.
floating_symb
:
# Once everything is rendered, adjust position of each
# symbol to the value from the AST (positions may be
# slightly altered by the reshaping functions)
def
fix_pos_from_ast
(
symbol
):
try
:
if
symbol
.
ast
.
pos_x
and
symbol
.
ast
.
pos_y
:
relpos
=
symbol
.
mapFromScene
(
symbol
.
ast
.
pos_x
,
symbol
.
ast
.
pos_y
)
symbol
.
moveBy
(
relpos
.
x
(),
relpos
.
y
())
symbol
.
update_connections
()
for
child
in
symbol
.
childItems
():
fix_pos_from_ast
(
child
)
except
AttributeError
:
# no AST
pass
fix_pos_from_ast
(
each
)
except
TypeError
:
LOG
.
error
(
traceback
.
format_exc
())
...
...
sdlSymbols.py
View file @
29bcca73
...
...
@@ -138,12 +138,13 @@ class Input(HorizontalSymbol):
def
__init__
(
self
,
parent
=
None
,
ast
=
None
):
''' Create the INPUT symbol '''
ast
=
ast
or
ogAST
.
Input
()
self
.
ast
=
ast
self
.
branch_entrypoint
=
None
if
not
ast
.
pos_y
and
parent
:
# Make sure the item is placed below its parent
ast
.
pos_y
=
parent
.
y
()
+
parent
.
boundingRect
().
height
()
+
10
super
(
Input
,
self
).
__init__
(
parent
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
,
y
=
ast
.
pos_y
,
hyperlink
=
ast
.
hyperlink
)
x
=
ast
.
pos_x
or
0
,
y
=
ast
.
pos_y
or
0
,
hyperlink
=
ast
.
hyperlink
)
self
.
set_shape
(
ast
.
width
,
ast
.
height
)
gradient
=
QRadialGradient
(
50
,
50
,
50
,
50
,
50
)
gradient
.
setColorAt
(
0
,
QColor
(
255
,
240
,
170
))
...
...
@@ -237,8 +238,9 @@ class Output(VerticalSymbol):
def
__init__
(
self
,
parent
=
None
,
ast
=
None
):
ast
=
ast
or
ogAST
.
Output
()
self
.
ast
=
ast
super
(
Output
,
self
).
__init__
(
parent
=
parent
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
,
y
=
ast
.
pos_y
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
or
0
,
y
=
ast
.
pos_y
or
0
,
hyperlink
=
ast
.
hyperlink
)
self
.
set_shape
(
ast
.
width
,
ast
.
height
)
...
...
@@ -288,10 +290,11 @@ class Decision(VerticalSymbol):
def
__init__
(
self
,
parent
=
None
,
ast
=
None
):
ast
=
ast
or
ogAST
.
Decision
()
self
.
ast
=
ast
# Define the point where all branches of the decision can join again
self
.
connectionPoint
=
QPoint
(
ast
.
width
/
2
,
ast
.
height
+
30
)
super
(
Decision
,
self
).
__init__
(
parent
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
,
y
=
ast
.
pos_y
,
hyperlink
=
ast
.
hyperlink
)
x
=
ast
.
pos_x
or
0
,
y
=
ast
.
pos_y
or
0
,
hyperlink
=
ast
.
hyperlink
)
self
.
set_shape
(
ast
.
width
,
ast
.
height
)
self
.
setBrush
(
QColor
(
255
,
255
,
202
))
self
.
minDistanceToSymbolAbove
=
0
...
...
@@ -411,15 +414,17 @@ class DecisionAnswer(HorizontalSymbol):
def
__init__
(
self
,
parent
=
None
,
ast
=
None
):
ast
=
ast
or
ogAST
.
Answer
()
# temp, FIXME
self
.
ast
=
ast
self
.
width
,
self
.
height
=
ast
.
width
,
ast
.
height
self
.
terminal_symbol
=
False
# last_branch_item is used to compute branch length
# for the connection point positionning
self
.
last_branch_item
=
self
super
(
DecisionAnswer
,
self
).
__init__
(
parent
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
,
y
=
ast
.
pos_y
,
hyperlink
=
ast
.
hyperlink
)
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
or
0
,
y
=
ast
.
pos_y
or
0
,
hyperlink
=
ast
.
hyperlink
)
self
.
set_shape
(
ast
.
width
,
ast
.
height
)
#self.setPen(QColor(0, 0, 0, 0))
self
.
branch_entrypoint
=
self
...
...
@@ -471,13 +476,17 @@ class Join(VerticalSymbol):
redbold
=
SDL_REDBOLD
def
__init__
(
self
,
parent
=
None
,
ast
=
None
):
self
.
ast
=
ast
if
not
ast
:
ast
=
ogAST
.
Terminator
(
defName
=
''
)
ast
.
pos_y
=
0
ast
.
width
=
35
ast
.
height
=
35
super
(
Join
,
self
).
__init__
(
parent
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
,
y
=
ast
.
pos_y
,
hyperlink
=
ast
.
hyperlink
)
super
(
Join
,
self
).
__init__
(
parent
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
,
y
=
ast
.
pos_y
,
hyperlink
=
ast
.
hyperlink
)
self
.
set_shape
(
ast
.
width
,
ast
.
height
)
self
.
setPen
(
QPen
(
Qt
.
blue
))
self
.
terminal_symbol
=
True
...
...
@@ -522,6 +531,7 @@ class ProcedureStop(Join):
redbold
=
SDL_REDBOLD
def
__init__
(
self
,
parent
=
None
,
ast
=
None
):
self
.
ast
=
ast
if
not
ast
:
ast
=
ogAST
.
Terminator
(
defName
=
''
)
ast
.
pos_y
=
0
...
...
@@ -582,8 +592,12 @@ class Label(VerticalSymbol):
def
__init__
(
self
,
parent
=
None
,
ast
=
None
):
ast
=
ast
or
ogAST
.
Label
()
super
(
Label
,
self
).
__init__
(
parent
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
,
y
=
ast
.
pos_y
,
hyperlink
=
ast
.
hyperlink
)
self
.
ast
=
ast
super
(
Label
,
self
).
__init__
(
parent
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
or
0
,
y
=
ast
.
pos_y
or
0
,
hyperlink
=
ast
.
hyperlink
)
self
.
set_shape
(
ast
.
width
,
ast
.
height
)
self
.
setPen
(
QPen
(
Qt
.
blue
))
self
.
terminal_symbol
=
False
...
...
@@ -596,7 +610,6 @@ class Label(VerticalSymbol):
def
set_shape
(
self
,
width
,
height
):
''' Define the shape of the LABEL symbol '''
#print traceback.print_stack()
path
=
QPainterPath
()
path
.
addEllipse
(
0
,
height
/
2
,
width
/
4
,
height
/
2
)
path
.
moveTo
(
width
/
4
,
height
*
3
/
4
)
...
...
@@ -646,10 +659,13 @@ class Task(VerticalSymbol):
def
__init__
(
self
,
parent
=
None
,
ast
=
None
):
''' Initializes the TASK symbol '''
ast
=
ast
or
ogAST
.
Task
()
super
(
Task
,
self
).
__init__
(
parent
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
,
y
=
ast
.
pos_y
,
hyperlink
=
ast
.
hyperlink
)
self
.
ast
=
ast
super
(
Task
,
self
).
__init__
(
parent
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
or
0
,
y
=
ast
.
pos_y
or
0
,
hyperlink
=
ast
.
hyperlink
)
self
.
set_shape
(
ast
.
width
,
ast
.
height
)
self
.
setBrush
(
QBrush
(
QColor
(
255
,
255
,
202
)))
self
.
terminal_symbol
=
False
self
.
parser
=
ogParser
...
...
@@ -706,9 +722,12 @@ class ProcedureCall(VerticalSymbol):
def
__init__
(
self
,
parent
=
None
,
ast
=
None
):
ast
=
ast
or
ogAST
.
Output
(
defName
=
''
)
self
.
ast
=
ast
super
(
ProcedureCall
,
self
).
__init__
(
parent
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
,
y
=
ast
.
pos_y
,
hyperlink
=
ast
.
hyperlink
)
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
or
0
,
y
=
ast
.
pos_y
or
0
,
hyperlink
=
ast
.
hyperlink
)
self
.
set_shape
(
ast
.
width
,
ast
.
height
)
self
.
setBrush
(
QBrush
(
QColor
(
255
,
255
,
202
)))
self
.
terminal_symbol
=
False
...
...
@@ -772,13 +791,16 @@ class TextSymbol(HorizontalSymbol):
def
__init__
(
self
,
ast
=
None
):
''' Create a Text Symbol '''
ast
=
ast
or
ogAST
.
TextArea
()
self
.
ast
=
ast
super
(
TextSymbol
,
self
).
__init__
(
parent
=
None
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
,
y
=
ast
.
pos_y
,
hyperlink
=
ast
.
hyperlink
)
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
or
0
,
y
=
ast
.
pos_y
or
0
,
hyperlink
=
ast
.
hyperlink
)
self
.
set_shape
(
ast
.
width
,
ast
.
height
)
self
.
setBrush
(
QBrush
(
QColor
(
249
,
249
,
249
)))
self
.
terminal_symbol
=
False
self
.
setPos
(
ast
.
pos_x
,
ast
.
pos_y
)
self
.
setPos
(
ast
.
pos_x
or
0
,
ast
.
pos_y
or
0
)
# Disable hyperlinks for Text symbols
self
.
_no_hyperlink
=
True
# Text is not centered in the box - change default alignment:
...
...
@@ -852,24 +874,26 @@ class State(VerticalSymbol):
def
__init__
(
self
,
parent
=
None
,
ast
=
None
):
ast
=
ast
or
ogAST
.
State
()
self
.
ast
=
ast
ast
.
inputString
=
getattr
(
ast
,
'via'
,
None
)
or
ast
.
inputString
# Note: ast coordinates are in scene coordinates
super
(
State
,
self
).
__init__
(
parent
=
parent
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
,
y
=
ast
.
pos_y
,
hyperlink
=
ast
.
hyperlink
)
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
or
0
,
y
=
ast
.
pos_y
or
0
,
hyperlink
=
ast
.
hyperlink
)
self
.
set_shape
(
ast
.
width
,
ast
.
height
)
self
.
setBrush
(
QBrush
(
QColor
(
255
,
228
,
213
)))
self
.
terminal_symbol
=
True
if
parent
:
try
:
# Map AST scene coordinates to get actual position
self
.
setPos
(
self
.
pos
()
+
self
.
mapFromScene
(
ast
.
pos_x
,
ast
.
pos_y
))
self
.
setPos
(
self
.
pos
()
+
self
.
mapFromScene
(
ast
.
pos_x
or
0
,
ast
.
pos_y
or
0
))
except
TypeError
:
self
.
update_position
()
else
:
# Use scene coordinates to position
self
.
setPos
(
ast
.
pos_x
,
ast
.
pos_y
)
self
.
setPos
(
ast
.
pos_x
or
0
,
ast
.
pos_y
or
0
)
self
.
parser
=
ogParser
if
ast
.
comment
:
Comment
(
parent
=
self
,
ast
=
ast
.
comment
)
...
...
@@ -963,6 +987,7 @@ class Process(HorizontalSymbol):
def
__init__
(
self
,
ast
=
None
,
subscene
=
None
):
ast
=
ast
or
ogAST
.
Process
()
self
.
ast
=
ast
super
(
Process
,
self
).
__init__
(
parent
=
None
,
text
=
ast
.
processName
,
x
=
ast
.
pos_x
,
...
...
@@ -1018,9 +1043,12 @@ class Procedure(Process):
def
__init__
(
self
,
ast
=
None
,
subscene
=
None
):
ast
=
ast
or
ogAST
.
Procedure
()
self
.
ast
=
ast
super
(
Process
,
self
).
__init__
(
parent
=
None
,
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
,
y
=
ast
.
pos_y
,
hyperlink
=
ast
.
hyperlink
)
text
=
ast
.
inputString
,
x
=
ast
.
pos_x
or
0
,
y
=
ast
.
pos_y
or
0
,
hyperlink
=
ast
.
hyperlink
)
self
.
set_shape
(
ast
.
width
,
ast
.
height
)
self
.
setBrush
(
QBrush
(
QColor
(
255
,
255
,
202
)))
self
.
parser
=
ogParser
...
...
@@ -1079,10 +1107,12 @@ class Start(HorizontalSymbol):
def
__init__
(
self
,
ast
=
None
):
''' Create the START symbol '''
ast
=
ast
or
ogAST
.
Start
()
self
.
ast
=
ast
self
.
terminal_symbol
=
False
super
(
Start
,
self
).
__init__
(
parent
=
None
,
text
=
ast
.
inputString
[
slice
(
0
,
-
6
)],
x
=
ast
.
pos_x
,
y
=
ast
.
pos_y
,
x
=
ast
.
pos_x
or
0
,
y
=
ast
.
pos_y
or
0
,
hyperlink
=
ast
.
hyperlink
)
self
.
set_shape
(
ast
.
width
,
ast
.
height
)
self
.
setBrush
(
QBrush
(
QColor
(
255
,
228
,
213
)))
...
...
tests/regression/test-substrings/myfunction.pr
View file @
29bcca73
/* CIF PROCESS (197, 146), (150, 75) */
PROCESS myfunction;
/* CIF TEXT (7, 43), (334, 41) */
-- Test substrings in various contexts and operators
/* CIF ENDTEXT */
/* CIF TEXT (0, 133), (282, 216) */
dcl str MyOctStr := 'abc';
dcl variable_str String := 'Hello!';
...
...
@@ -16,6 +13,9 @@ dcl seqbool2 seqBool2 := { true, false};
dcl iseq IntSeq := {0,1,2,3};
dcl fixedseq FixedIntSeq := {0,1,2,3,4};
dcl n t_UInt8;
/* CIF ENDTEXT */
/* CIF TEXT (7, 43), (334, 41) */
-- Test substrings in various contexts and operators
/* CIF ENDTEXT */
/* CIF PROCEDURE (1416, 490), (91, 35) */
PROCEDURE factorial;
...
...
@@ -36,7 +36,7 @@ endfor;
ENDPROCEDURE;
/* CIF START (353, 217), (65, 37) */
START;
/* CIF TASK (3
19
, 269), (131, 35) */
/* CIF TASK (3
20
, 269), (131, 35) */
TASK n := iseq(0,2)(0);
/* CIF PROCEDURECALL (335, 319), (100, 35) */
CALL writeln(n)
...
...
@@ -48,7 +48,7 @@ endfor;
TASK for x in iseq:
call writeln(x);
endfor
/* CIF COMMENT (49
4
, 4
20
), (81, 72) */
/* CIF COMMENT (4
8
9, 4
16
), (81, 72) */
COMMENT 'print
0
1
...
...
@@ -59,144 +59,144 @@ endfor
CALL writeln(n)
/* CIF COMMENT (455, 545), (83, 35) */
COMMENT 'print 2';
/* CIF TASK (30
9
, 595), (151, 35) */
/* CIF TASK (3
1
0, 595), (151, 35) */
TASK seqof := seqof(0,1)
/* CIF COMMENT (482, 595), (20
8
, 35) */
/* CIF COMMENT (482, 595), (20
9
, 35) */
COMMENT 'equivalent to seqof := seqof';
/* CIF TASK (303, 645), (165, 35) */
TASK n := iseq(0,2)(0,1)(0);
/* CIF TASK (31
4
, 695), (141, 35) */
/* CIF TASK (31
5
, 695), (141, 35) */
TASK n := iseq(100- 1);
/* CIF DECISION (324, 745), (123, 50) */
DECISION hello in seqof
/* CIF COMMENT (46
7
, 74
6
), (179, 53) */
/* CIF COMMENT (46
8
, 74
4
), (179, 53) */
COMMENT 'Check IN operator with
enumerated type';
/* CIF ANSWER (242, 815), (70,
24
) */
/* CIF ANSWER (242, 815), (70,
33
) */
(true):
/* CIF PROCEDURECALL (188, 8
54
), (177, 35) */
/* CIF PROCEDURECALL (188, 8
63
), (177, 35) */
CALL writeln(hello in seqof)
/* CIF COMMENT (386, 8
54
), (114, 35) */
/* CIF COMMENT (386, 8
63
), (114, 35) */
COMMENT 'print "TRUE"';
/* CIF ANSWER (505, 815), (70,
24
) */
/* CIF ANSWER (505, 815), (70,
33
) */
(false):
ENDDECISION;
/* CIF DECISION (308, 9
04
), (155, 50) */
/* CIF DECISION (308, 9
13
), (155, 50) */
DECISION hello in seqof(0,0)
/* CIF COMMENT (47
9
,
865
), (236, 56) */
/* CIF COMMENT (47
5
,
910
), (236, 56) */
COMMENT 'Check IN operator with
list substring - first element only
should go to branch TRUE';
/* CIF ANSWER (2
3
2, 9
29
), (66, 33) */
/* CIF ANSWER (22
8
, 9
83
), (66, 33) */
(true):
/* CIF PROCEDURECALL (16
5
,
977
), (201, 35) */
/* CIF PROCEDURECALL (16
0
,
1031
), (201, 35) */
CALL writeln(hello in seqof(0,1))
/* CIF COMMENT (
400, 977
), (114, 35) */
/* CIF COMMENT (
396, 1031
), (114, 35) */
COMMENT 'print "TRUE"';
/* CIF ANSWER (5
22
, 9
29
), (70,
24
) */
/* CIF ANSWER (5
18
, 9
83
), (70,
33
) */
(false):
ENDDECISION;
/* CIF PROCEDURECALL (2
8
9, 10
27
), (191, 35) */
/* CIF PROCEDURECALL (29
0
, 10
81
), (191, 35) */
CALL writeln(variable_str(0,4))
/* CIF COMMENT (496,
988
), (113, 35) */
/* CIF COMMENT (496,
1081
), (113, 35) */
COMMENT 'print "Hello"';
/* CIF TASK (297, 1
077
), (176, 56) */
/* CIF TASK (297, 1
131
), (176, 56) */
TASK for x in seqof:
call writeln(num(x));
endfor
/* CIF COMMENT (498, 1
039
), (96, 56) */
/* CIF COMMENT (498, 1
131
), (96, 56) */
COMMENT 'print:
12
13';
/* CIF TASK (295, 1
148
), (180, 56) */
/* CIF TASK (295, 1
202
), (180, 56) */
TASK for x in seqof(0,1):
call writeln(-num(x));
endfor
/* CIF COMMENT (50
2
, 1
116
), (96, 56) */
/* CIF COMMENT (50
3
, 1
202
), (96, 56) */
COMMENT 'print:
-12
-13';
/* CIF PROCEDURECALL (295, 12
19
), (180, 35) */
/* CIF PROCEDURECALL (295, 12
73
), (180, 35) */
CALL writeln(length(seqof))
/* CIF COMMENT (50
7
, 1
180
), (77, 35) */
/* CIF COMMENT (50
6
, 1
273
), (77, 35) */
COMMENT 'print 2';
/* CIF PROCEDURECALL (281, 1
269
), (209, 35) */
/* CIF PROCEDURECALL (281, 1
323
), (209, 35) */
CALL writeln(length(seqof(0,1)))
/* CIF COMMENT (51
6
, 123
7
), (77, 35) */
/* CIF COMMENT (51
5
, 1
3
23), (77, 35) */
COMMENT 'print 2';
/* CIF LABEL (304, 13
19
), (162, 35) */
/* CIF LABEL (304, 13
73
), (162, 35) */
variable_length_seq:
/* CIF TASK (314, 1
369
), (142, 56) */
/* CIF TASK (314, 1
423
), (142, 56) */
TASK for x in seqint:
call writeln(x);
endfor
/* CIF COMMENT (488, 1
331
), (96, 53) */
/* CIF COMMENT (488, 1
425
), (96, 53) */
COMMENT 'print:
1';
/* CIF TASK (309, 144
0
), (152, 56) */
/* CIF TASK (309, 14
9
4), (152, 56) */
TASK for x in seqint(0,0):
call writeln(x);
endfor
/* CIF COMMENT (47
3
, 14
12
), (96, 53) */
/* CIF COMMENT (47
8
, 14
96
), (96, 53) */
COMMENT 'print:
1';
/* CIF DECISION (324, 15
11
), (123, 50) */
/* CIF DECISION (324, 15
65
), (123, 50) */
DECISION 1 in seqint
/* CIF COMMENT (4
70
, 1
470
), (179, 53) */
/* CIF COMMENT (4
55
, 1
564
), (179, 53) */
COMMENT 'Check IN operator with
variable-length seqOf';
/* CIF ANSWER (2
28
, 1
536
), (66, 33) */
/* CIF ANSWER (2
15
, 1
635
), (66, 33) */
(true):
/* CIF PROCEDURECALL (1
73
, 1
584
), (177, 35) */
/* CIF PROCEDURECALL (1
59
, 1
683
), (177, 35) */
CALL writeln(1 in seqint)
/* CIF COMMENT (3
82
, 1
584
), (114, 35) */
/* CIF COMMENT (3
69
, 1
683
), (114, 35) */
COMMENT 'print "TRUE"';
/* CIF ANSWER (49
7
, 1
536
), (70, 24) */
/* CIF ANSWER (49
2
, 1
635
), (70, 24) */
(false):
ENDDECISION;
/* CIF DECISION (321, 1
634
), (128, 50) */
/* CIF DECISION (321, 1
733
), (128, 50) */
DECISION 1 in seqint(0,0)
/* CIF COMMENT (4
59
, 1
594
), (179, 53) */
/* CIF COMMENT (4
60
, 1
732
), (179, 53) */
COMMENT 'Check IN operator with
variable-length seqOf';
/* CIF ANSWER (23
4
, 1
659
), (70, 24) */
/* CIF ANSWER (23
6
, 1
803
), (70, 24) */
(true):
/* CIF PROCEDURECALL (1
77
, 1
698
), (182, 35) */
/* CIF PROCEDURECALL (1
80
, 1
842
), (182, 35) */
CALL writeln(1 in seqint(0,0))
/* CIF COMMENT (38
2
, 1
698
), (114, 35) */
/* CIF COMMENT (38
4
, 1
842
), (114, 35) */
COMMENT 'print "TRUE"';
/* CIF ANSWER (
497, 1659
), (70, 24) */
/* CIF ANSWER (
508, 1803
), (70, 24) */
(false):
ENDDECISION;
/* CIF PROCEDURECALL (295, 1
748
), (180, 35) */
/* CIF PROCEDURECALL (295, 1
892
), (180, 35) */
CALL writeln(length(seqint))
/* CIF COMMENT (49
7
, 1
709
), (77, 35) */
/* CIF COMMENT (49
9
, 1
892
), (77, 35) */
COMMENT 'print 1';
/* CIF PROCEDURECALL (279, 1
798
), (212, 35) */
/* CIF PROCEDURECALL (279, 1
942
), (212, 35) */
CALL writeln(length(seqint(0,0)))
/* CIF COMMENT (51
6
, 1
764
), (77, 35) */
/* CIF COMMENT (51
4
, 1
942
), (77, 35) */
COMMENT 'print 1';
/* CIF TASK (30
3
, 1
848
), (163, 35) */
/* CIF TASK (30
4
, 1
992
), (163, 35) */
TASK seqint := seqint // {2};
/* CIF TASK (290,
1898
), (190, 35) */
/* CIF TASK (290,
2042
), (190, 35) */
TASK seqint := seqint(0,0) // {5};
/* CIF TASK (314,
1948
), (142, 56) */
/* CIF TASK (314,
2092
), (142, 56) */
TASK for x in seqint:
call writeln(x);
endfor
/* CIF COMMENT (49
4
,
1911
), (96, 56) */
/* CIF COMMENT (49
9
,
2092
), (96, 56) */
COMMENT 'print:
1
5';
/* CIF TASK (269, 2
019
), (233, 35) */
/* CIF TASK (269, 2
163
), (233, 35) */
TASK seqbool := seqbool and seqbool
/* CIF COMMENT (52
7
,
1979
), (194, 35) */
/* CIF COMMENT (52
5
,
2163
), (194, 35) */
COMMENT 'should not raise any error';
/* CIF TASK (256, 2
069
), (25
8
, 38) */
/* CIF TASK (256, 2
213
), (25
9
, 38) */
TASK 'seqbool2 := seqbool2 and seqbool2'
/* CIF COMMENT (53
7
, 2
033
), (21
3
, 35) */
/* CIF COMMENT (53
0
, 2
215
), (21
6
, 35) */