Commit 7352acb5 authored by dbarbera's avatar dbarbera
Browse files

Merge remote-tracking branch 'upstream/master' into llvm

parents b341a6fb 824a7f5e
......@@ -589,7 +589,6 @@ def _call_external_function(output):
def _task_assign(task):
''' A list of assignments in a task symbol '''
code, local_decl = [], []
ada_string = ''
if task.comment:
code.extend(traceability(task.comment))
for expr in task.elems:
......@@ -850,8 +849,6 @@ def _prim_substring(prim):
stmts.extend(receiver_stms)
local_decl.extend(receiver_decl)
receiver_ty_name = receiver.exprType.ReferencedTypeName.replace('-', '_')
r1_stmts, r1_string, r1_local = expression(prim.value[1]['substring'][0])
r2_stmts, r2_string, r2_local = expression(prim.value[1]['substring'][1])
......@@ -901,8 +898,6 @@ def _prim_selector(prim):
@expression.register(ogAST.ExprPlus)
@expression.register(ogAST.ExprMul)
@expression.register(ogAST.ExprMinus)
@expression.register(ogAST.ExprEq)
@expression.register(ogAST.ExprNeq)
@expression.register(ogAST.ExprGt)
@expression.register(ogAST.ExprGe)
@expression.register(ogAST.ExprLt)
......@@ -923,6 +918,35 @@ def _basic_operators(expr):
local_decl.extend(right_local)
return code, unicode(ada_string), local_decl
@expression.register(ogAST.ExprEq)
@expression.register(ogAST.ExprNeq)
def _equality(expr):
code, left_str, local_decl = expression(expr.left)
right_stmts, right_str, right_local = expression(expr.right)
code.extend(right_stmts)
local_decl.extend(right_local)
actual_type = getattr(expr.left.exprType,
'ReferencedTypeName',
None) or expr.left.exprType.kind
actual_type = actual_type.replace('-', '_')
basic = find_basic_type(expr.left.exprType).kind in ('IntegerType',
'Integer32Type',
'BooleanType',
'RealType',
'EnumeratedType',
'ChoiceEnumeratedType')
if basic:
ada_string = u'({left} {op} {right})'.format(
left=left_str, op=expr.operand, right=right_str)
else:
ada_string = u'asn1Scc{asn1}_Equal({left}, {right})'.format(
asn1=actual_type, left=left_str, right=right_str)
if isinstance(expr, ogAST.ExprNeq):
ada_string = u'not {}'.format(ada_string)
return code, unicode(ada_string), local_decl
@expression.register(ogAST.ExprAssign)
def _assign_expression(expr):
''' Assignment: almost the same a basic operators, except for strings '''
......@@ -949,9 +973,11 @@ def _assign_expression(expr):
local_decl.extend(right_local)
return code, '', local_decl
@expression.register(ogAST.ExprOr)
@expression.register(ogAST.ExprAnd)
@expression.register(ogAST.ExprXor)
@expression.register(ogAST.ExprImplies)
def _bitwise_operators(expr):
''' Logical operators '''
code, local_decl = [], []
......@@ -974,11 +1000,19 @@ def _bitwise_operators(expr):
else:
right_payload = right_str + string_payload(expr.right, right_str)
left_payload = left_str + string_payload(expr.left, left_str)
ada_string = u'(Data => ({left} {op} {right})'.format(
if isinstance(expr, ogAST.ExprImplies):
ada_string = u'(Data => (({left} and {right}) or not {left}))'\
.format(left=left_payload, right=right_payload)
else:
ada_string = u'(Data => ({left} {op} {right}))'.format(
left=left_payload, op=expr.operand, right=right_payload)
if basic_type.Min != basic_type.Max:
ada_string += u", Length => {left}.Length".format(left=left_str)
ada_string += u')'
elif isinstance(expr, ogAST.ExprImplies):
ada_string = u'(({left} and {right}) or not {left})'.format(
left=left_str,
right=right_str)
else:
ada_string = u'({left} {op}{short} {right})'.format(
left=left_str,
......@@ -993,12 +1027,29 @@ def _bitwise_operators(expr):
@expression.register(ogAST.ExprNot)
def _not_expression(expr):
''' Generate the code for a not expression '''
code, local_decl = [], []
expr_stmts, expr_str, expr_local = expression(expr.expr)
basic_type = find_basic_type(expr.exprType)
if basic_type.kind != 'BooleanType':
expr_payload = expr_str + string_payload(expr.expr, expr_str)
ada_string = u'(Data => (not {expr}))'.format(expr=expr_payload)
else:
ada_string = u'(not {expr})'.format(expr=expr_str)
code.extend(expr_stmts)
local_decl.extend(expr_local)
return code, unicode(ada_string), local_decl
@expression.register(ogAST.ExprNeg)
def _unary_operator(expr):
''' Generate the code for an unary expression '''
def _neg_expression(expr):
''' Generate the code for a negative expression '''
code, local_decl = [], []
expr_stmts, expr_str, expr_local = expression(expr.expr)
ada_string = u'({op} {expr})'.format(op=expr.operand, expr=expr_str)
ada_string = u'(-{expr})'.format(op=expr.operand, expr=expr_str)
code.extend(expr_stmts)
local_decl.extend(expr_local)
return code, unicode(ada_string), local_decl
......@@ -1345,7 +1396,7 @@ def _decision(dec):
exp = u'asn1Scc{actType}_Equal(tmp{idx}, {ans})'.format(
actType=actual_type, idx=dec.tmpVar, ans=ans_str)
if a.openRangeOp == ogAST.ExprNeq:
exp = 'not ' + exp
exp = u'not {}'.format(exp)
else:
exp = u'tmp{idx} {op} {ans}'.format(idx=dec.tmpVar,
op=a.openRangeOp.operand, ans=ans_str)
......@@ -1581,7 +1632,6 @@ def string_payload(prim, ada_string):
prim_basic = find_basic_type(prim.exprType)
payload = ''
if prim_basic.kind in ('SequenceOfType', 'OctetStringType'):
range_string = ''
if int(prim_basic.Min) != int(prim_basic.Max):
payload = u'.Data(1..{}.Length)'.format(ada_string)
else:
......@@ -1589,7 +1639,6 @@ def string_payload(prim, ada_string):
return payload
def find_basic_type(a_type):
''' Return the ASN.1 basic type of a_type '''
basic_type = a_type
......
......@@ -65,15 +65,13 @@ def copy(selection):
def copy_branch(top_level_item):
''' Copy branches (recursively) '''
res_terminators = []
pr_text = '\n'.join(Pr.generate(top_level_item,
pr_text = '\n'.join(Pr.generate(top_level_item, cpy=True,
nextstate=False, recursive=True))
item_ast, terminators = top_level_item.get_ast(pr_text)
LOG.debug('COPY ' + str(item_ast))
# Set absolute (scene) coordinates of top level item
scene_pos = top_level_item.scenePos()
item_ast.abs_x = scene_pos.x()
item_ast.abs_y = scene_pos.y()
if not item_ast:
LOG.error('ERROR - copy failed')
return
branch = [item_ast]
......
......@@ -247,11 +247,12 @@ def _label(symbol, recursive=True, **kwargs):
@generate.register(sdlSymbols.State)
def _state(symbol, recursive=True, nextstate=True, composite=False, **kwargs):
def _state(symbol, recursive=True, nextstate=True, composite=False, cpy=False,
**kwargs):
''' State/Nextstate symbol or branch if recursive is set '''
if nextstate:
if nextstate and symbol.hasParent:
result = common('NEXTSTATE', symbol)
elif not composite and symbol.hasParent \
elif not composite and symbol.hasParent and not cpy \
and not [each for each in symbol.childSymbols()
if not isinstance(each, genericSymbols.Comment)]:
# If nextstate has no child, don't generate anything
......
......@@ -2,8 +2,8 @@
 
# Resource object code
#
# Created: Tue Jul 22 16:47:55 2014
# by: The Resource Compiler for PySide (Qt v4.8.6)
# Created: Wed Aug 6 23:54:13 2014
# by: The Resource Compiler for PySide (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
 
This diff is collapsed.
......@@ -57,7 +57,7 @@ import Connectors # NOQA
#from PySide import phonon
from PySide import QtGui, QtCore
from PySide.QtCore import Qt, QSize, QFile, QIODevice, QRectF, QTimer
from PySide.QtCore import Qt, QSize, QFile, QIODevice, QRectF, QTimer, QPoint
from PySide.QtUiTools import QUiLoader
from PySide import QtSvg
......@@ -342,6 +342,11 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
return (it for it in self.visible_symb if isinstance(it, Process) and
not isinstance(it, Procedure))
@property
def procedures(self):
''' Return visible procedures components of the scene '''
return (it for it in self.visible_symb if isinstance(it, Procedure))
@property
def states(self):
''' Return visible state components of the scene '''
......@@ -603,22 +608,6 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
except StopIteration:
LOG.info('Pattern not found')
def show_item(self, item):
'''
Select an item and make sure it is visible
(used when user clicks on a warning or error to locate the symbol)
'''
abs_coordinates = item.data(Qt.UserRole)
if not abs_coordinates:
LOG.info('Corresponding symbol not found')
return
item = self.itemAt(*abs_coordinates)
if item:
self.clearSelection()
self.clear_focus()
item.setSelected(True)
item.ensureVisible()
def delete_selected_symbols(self):
'''
Remove selected symbols from the scene, with proper re-connections
......@@ -1457,15 +1446,21 @@ class SDL_View(QtGui.QGraphicsView, object):
error[0] = 'Internal error - ' + str(error[0])
LOG.error(error[0])
item = QtGui.QListWidgetItem(u'[ERROR] ' + error[0])
if len(error) == 2:
if len(error) == 3:
item.setData(Qt.UserRole, error[1])
#found = self.scene().symbol_near(QPoint(*error[1]), 1)
# Pyside bug: setData cannot store 'found' directly
#item.setData(Qt.UserRole + 1, id(found))
item.setData(Qt.UserRole + 1, error[2])
if self.messages_window:
self.messages_window.addItem(item)
for warning in warnings:
LOG.warning(warning[0])
item = QtGui.QListWidgetItem(u'[WARNING] ' + str(warning[0]))
if len(warning) == 2:
if len(warning) == 3:
item.setData(Qt.UserRole, warning[1])
item.setData(Qt.UserRole + 1, warning[2])
#found = self.scene().symbol_near(QPoint(*warning[1]), 1)
if self.messages_window:
self.messages_window.addItem(item)
if not errors and not warnings and self.messages_window:
......@@ -1485,6 +1480,59 @@ class SDL_View(QtGui.QGraphicsView, object):
string=pr_data)
self.log_errors(errors, warnings)
def show_item(self, item):
'''
Select an item and make sure it is visible - change scene if needed
Used when user clicks on a warning or error to locate the symbol
'''
coord = item.data(Qt.UserRole)
path = item.data(Qt.UserRole + 1)
if not coord:
LOG.debug('Corresponding symbol not found (no coordinates)')
return
# Find the scene containing the symbol
while self.up_button.isEnabled():
self.go_up()
for each in path:
kind, name = each.split()
name = unicode(name).lower()
if kind == 'PROCESS':
for process in self.scene().processes:
if unicode(process).lower() == name:
self.go_down(process.nested_scene,
name=u'process {}'.format(name))
break
else:
LOG.error('Process {} not found'.format(name))
elif kind == 'STATE':
for state in self.scene().states:
if unicode(state).lower() == name:
self.go_down(state.nested_scene,
name=u'state {}'.format(name))
break
else:
LOG.error('Composite state {} not found'.format(name))
elif kind == 'PROCEDURE':
for proc in self.scene().procedures:
if unicode(proc).lower() == name:
self.go_down(proc.nested_scene,
name=u'procedure {}'.format(name))
break
else:
LOG.error('Procedure {} not found'.format(name))
pos = QPoint(*coord)
symbol = self.scene().symbol_near(pos=pos, dist=1)
if symbol:
self.scene().clearSelection()
self.scene().clear_focus()
symbol.select()
symbol.ensureVisible()
else:
LOG.info('No symbol at given coordinates in the current scene')
def generate_ada(self):
''' Generate Ada code '''
# If the current scene is a nested one, save the top parent
......@@ -1611,7 +1659,7 @@ class OG_MainWindow(QtGui.QMainWindow, object):
messages.addItem('Welcome to OpenGEODE.')
self.view.messages_window = messages
self.scene.messages_window = messages
messages.itemClicked.connect(self.scene.show_item)
messages.itemClicked.connect(self.view.show_item)
statechart_dock = self.findChild(QtGui.QDockWidget, 'statechart_dock')
#statechart_dock.setWindowTitle('Statechart view - F4 to update')
......
# $ANTLR 3.1.3 Mar 17, 2009 19:23:44 sdl92.g 2014-07-29 14:08:49
# $ANTLR 3.1.3 Mar 17, 2009 19:23:44 sdl92.g 2014-08-06 23:54:18
import sys
from antlr3 import *
......
This diff is collapsed.
......@@ -694,6 +694,13 @@ class State(VerticalSymbol):
ast, _, _, _, terminators = self.parser.parseSingleElement('state',
pr_text)
return ast, terminators
def check_syntax(self, pr_text):
''' Redefinition of the check syntax function for the state '''
name = self.common_name if self.hasParent else 'state'
_, err, _, _, _ = \
self.parser.parseSingleElement(name, pr_text)
return err
class Process(HorizontalSymbol):
......
all: test-ada
edit:
../../../opengeode.py expressions.pr system_structure.pr
test-parse:
../../../opengeode.py expressions.pr system_structure.pr --check
......
......@@ -6,8 +6,8 @@ Integer ::= INTEGER(-9223372036854775808..9223372036854775807)
Real ::= REAL (-100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0 .. 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0)
CharString ::= OCTET STRING (SIZE(0..100))
IntegerFixSeqof ::= SEQUENCE (SIZE(3)) OF Integer
IntegerVarSeqof ::= SEQUENCE (SIZE(0..100)) OF Integer
FixSeqof ::= SEQUENCE (SIZE(3)) OF Integer
VarSeqof ::= SEQUENCE (SIZE(0..100)) OF Integer
Seq ::= SEQUENCE {
i Integer,
......@@ -26,4 +26,6 @@ NestedSeq ::= SEQUENCE {
}
}
BoolSeqOf ::= SEQUENCE (SIZE(4)) OF Boolean
END
/* CIF PROCESS (145, 158), (150, 75) */
/* CIF PROCESS (144, 159), (150, 75) */
PROCESS expressions;
/* CIF TEXT (358, 168), (303, 168) */
/* CIF TEXT (350, 175), (303, 232) */
DCL i Integer;
DCL f Real;
DCL b Boolean;
DCL s CharString;
DCL fixSeqOf1 IntegerFixSeqof;
DCL fixSeqOf2 IntegerFixSeqof;
DCL varSeqOf1 IntegerVarSeqof;
DCL varSeqOf2 IntegerVarSeqof;
DCL fixSeqOf1 FixSeqof;
DCL fixSeqOf2 FixSeqof;
DCL varSeqOf1 VarSeqof;
DCL varSeqOf2 VarSeqof;
DCL seq Seq;
DCL nestedSeq NestedSeq;
DCL bs1 BoolSeqOf;
DCL bs2 BoolSeqOf;
DCL bs3 BoolSeqOf;
/* CIF ENDTEXT */
/* CIF START (0, 0), (100, 50) */
START;
......@@ -22,151 +25,179 @@ DCL nestedSeq NestedSeq;
INPUT run;
/* CIF TASK (-150, 200), (402, 35) */
TASK '------------------------------- Binary expressions -------------------------------';
/* CIF TASK (5, 250), (90, 35) */
/* CIF TASK (0, 250), (102, 35) */
TASK b := true;
/* CIF PROCEDURECALL (-75, 300), (253, 35) */
/* CIF PROCEDURECALL (-60, 300), (223, 35) */
CALL assert(b and true, 'b and true');
/* CIF PROCEDURECALL (-75, 350), (253, 35) */
/* CIF PROCEDURECALL (-53, 350), (209, 35) */
CALL assert(b or false, 'b or false');
/* CIF PROCEDURECALL (-75, 400), (253, 35) */
/* CIF PROCEDURECALL (-60, 400), (222, 35) */
CALL assert(b xor false, 'b xor false');
/* CIF TASK (14, 450), (73, 35) */
/* CIF PROCEDURECALL (-52, 450), (206, 35) */
CALL assert(b => true, 'b => true');
/* CIF TASK (14, 500), (73, 35) */
TASK i := 10;
/* CIF PROCEDURECALL (-50, 500), (203, 35) */
/* CIF PROCEDURECALL (-50, 550), (203, 35) */
CALL assert(i + 1 = 11, 'i + 1 = 11');
/* CIF PROCEDURECALL (-43, 550), (188, 35) */
/* CIF PROCEDURECALL (-43, 600), (188, 35) */
CALL assert(i - 1 = 9, 'i - 1 = 9');
/* CIF PROCEDURECALL (-49, 600), (201, 35) */
/* CIF PROCEDURECALL (-49, 650), (201, 35) */
CALL assert(i * 2 = 20, 'i * 2 = 20');
/* CIF PROCEDURECALL (-43, 650), (188, 35) */
/* CIF PROCEDURECALL (-43, 700), (188, 35) */
CALL assert(i / 2 = 5, 'i / 2 = 5');
/* CIF PROCEDURECALL (-64, 700), (230, 35) */
/* CIF PROCEDURECALL (-64, 750), (230, 35) */
CALL assert(i mod 2 = 0, 'i mod 2 = 0');
/* CIF PROCEDURECALL (-61, 750), (224, 35) */
/* CIF PROCEDURECALL (-61, 800), (224, 35) */
CALL assert(i rem 2 = 0, 'i rem 2 = 0');
/* CIF PROCEDURECALL (-29, 800), (161, 35) */
/* CIF PROCEDURECALL (-29, 850), (161, 35) */
CALL assert(i < 20, 'i < 20');
/* CIF PROCEDURECALL (-37, 850), (176, 35) */
CALL assert(i <= 10, 'i <= 10');
/* CIF PROCEDURECALL (-37, 900), (176, 35) */
CALL assert(i >= 10, 'i >= 10');
CALL assert(i <= 10, 'i <= 10');
/* CIF PROCEDURECALL (-37, 950), (176, 35) */
CALL assert(i >= 10, 'i >= 10');
/* CIF PROCEDURECALL (-37, 1000), (176, 35) */
CALL assert(i > 5, 'i > 5');
/* CIF PROCEDURECALL (-29, 1000), (161, 35) */
/* CIF PROCEDURECALL (-29, 1050), (161, 35) */
CALL assert(i = 10, 'i = 10');
/* CIF PROCEDURECALL (-27, 1050), (156, 35) */
/* CIF PROCEDURECALL (-27, 1100), (156, 35) */
CALL assert(i /= 9, 'i /= 9');
/* CIF TASK (8, 1100), (85, 35) */
/* CIF TASK (8, 1150), (85, 35) */
TASK f := 10.0;
/* CIF PROCEDURECALL (-74, 1150), (250, 35) */
/* CIF PROCEDURECALL (-74, 1200), (250, 35) */
CALL assert(f + 1.0 = 11.0, 'f + 1.0 = 11.0');
/* CIF PROCEDURECALL (-63, 1200), (228, 35) */
/* CIF PROCEDURECALL (-63, 1250), (228, 35) */
CALL assert(f - 1.0 = 9.0, 'f - 1.0 = 9.0');
/* CIF PROCEDURECALL (-73, 1250), (248, 35) */
/* CIF PROCEDURECALL (-73, 1300), (248, 35) */
CALL assert(f * 2.0 = 20.0, 'f * 2.0 = 20.0');
/* CIF PROCEDURECALL (-64, 1300), (230, 35) */
/* CIF PROCEDURECALL (-64, 1350), (230, 35) */
CALL assert(f / 2.0 = 5.0, 'f / 2.0 = 5.0');
/* CIF PROCEDURECALL (-49, 1350), (201, 35) */
CALL assert(f < 20.0, 'f < 20.0');
/* CIF PROCEDURECALL (-49, 1400), (201, 35) */
CALL assert(f <= 10.0, 'f <= 10.0');
CALL assert(f < 20.0, 'f < 20.0');
/* CIF PROCEDURECALL (-49, 1450), (201, 35) */
CALL assert(f >= 10.0, 'f >= 10.0');
CALL assert(f <= 10.0, 'f <= 10.0');
/* CIF PROCEDURECALL (-49, 1500), (201, 35) */
CALL assert(f >= 10.0, 'f >= 10.0');
/* CIF PROCEDURECALL (-49, 1550), (201, 35) */
CALL assert(f > 5.0, 'f > 5.0');
/* CIF PROCEDURECALL (-42, 1550), (186, 35) */
/* CIF PROCEDURECALL (-42, 1600), (186, 35) */
CALL assert(f = 10.0, 'f = 10.0');
/* CIF PROCEDURECALL (-44, 1600), (191, 35) */
/* CIF PROCEDURECALL (-44, 1650), (191, 35) */
CALL assert(f /= 9.0, 'f /= 9.0');
/* CIF TASK (-29, 1650), (160, 35) */
TASK fixSeqOf1 := {1, 2, 3};
/* CIF TASK (-29, 1700), (160, 35) */
TASK fixSeqOf1 := {1, 2, 3};
/* CIF TASK (-29, 1750), (160, 35) */
TASK fixSeqOf2 := {3, 4, 5};
/* CIF PROCEDURECALL (-82, 1750), (267, 35) */
/* CIF PROCEDURECALL (-82, 1800), (267, 35) */
CALL assert(2 in fixSeqOf1, '2 in fixSeqOf1');
/* CIF PROCEDURECALL (-112, 1800), (326, 35) */
/* CIF PROCEDURECALL (-112, 1850), (326, 35) */
CALL assert(not(4 in fixSeqOf1), 'not(4 in fixSeqOf1)');
/* CIF PROCEDURECALL (-137, 1850), (377, 35) */
/* CIF PROCEDURECALL (-137, 1900), (377, 35) */
CALL assert(fixSeqOf1 /= fixSeqOf2, 'fixSeqOf1 /= fixSeqOf2');
/* CIF TASK (-29, 1900), (160, 35) */
/* CIF TASK (-29, 1950), (160, 35) */
TASK fixSeqOf2 := {1, 2, 3};
/* CIF PROCEDURECALL (-132, 1950), (367, 35) */
/* CIF PROCEDURECALL (-132, 2000), (367, 35) */
CALL assert(fixSeqOf1 = fixSeqOf2, 'fixSeqOf1 = fixSeqOf2');
/* CIF TASK (-31, 2000), (164, 35) */
TASK varSeqOf1 := {1, 2, 3};
/* CIF TASK (-31, 2050), (164, 35) */
TASK varSeqOf1 := {1, 2, 3};
/* CIF TASK (-31, 2100), (164, 35) */
TASK varSeqOf2 := {4, 5, 6};
/* CIF PROCEDURECALL (-86, 2100), (274, 35) */
/* CIF PROCEDURECALL (-86, 2150), (274, 35) */
CALL assert(2 in varSeqOf1, '2 in varSeqOf1');
/* CIF PROCEDURECALL (-115, 2150), (333, 35) */
/* CIF PROCEDURECALL (-115, 2200), (333, 35) */
CALL assert(not(4 in varSeqOf1), 'not(4 in varSeqOf1)');
/* CIF PROCEDURECALL (-144, 2200), (391, 35) */
/* CIF PROCEDURECALL (-144, 2250), (391, 35) */
CALL assert(varSeqOf1 /= varSeqOf2, 'varSeqOf1 /= varSeqOf2');
/* CIF TASK (-80, 2250), (263, 35) */
/* CIF TASK (-80, 2300), (263, 35) */
TASK varSeqOf1 := varSeqOf1 // varSeqOf2;
/* CIF PROCEDURECALL (-130, 2300), (363, 35) */
/* CIF PROCEDURECALL (-130, 2350), (363, 35) */
CALL assert(length(varSeqOf1) = 6, 'lenght(varSeqOf1) = 6');
/* CIF PROCEDURECALL (-99, 2350), (300, 35) */
CALL assert(varSeqOf1(3) = 4, 'varSeqOf1(3) = 4');
/* CIF PROCEDURECALL (-99, 2400), (300, 35) */
CALL assert(varSeqOf1(4) = 5, 'varSeqOf1(4) = 5');
CALL assert(varSeqOf1(3) = 4, 'varSeqOf1(3) = 4');
/* CIF PROCEDURECALL (-99, 2450), (300, 35) */
CALL assert(varSeqOf1(4) = 5, 'varSeqOf1(4) = 5');
/* CIF PROCEDURECALL (-99, 2500), (300, 35) */
CALL assert(varSeqOf1(5) = 6, 'varSeqOf1(5) = 6');
/* CIF TASK (-32, 2500), (166, 35) */
/* CIF TASK (-32, 2550), (166, 35) */
TASK varSeqOf1 := {1, 2, 3};
/* CIF TASK (-31, 2550), (164, 35) */
/* CIF TASK (-31, 2600), (164, 35) */
TASK varSeqOf2 := {1, 2, 3};
/* CIF PROCEDURECALL (-139, 2600), (381, 35) */
/* CIF PROCEDURECALL (-139, 2650), (381, 35) */
CALL assert(varSeqOf1 = varSeqOf2, 'varSeqOf1 = varSeqOf2');
/* CIF TASK (-3, 2650), (108, 35) */
/* CIF TASK (-3, 2700), (108, 35) */
TASK s := 'HELLO';
/* CIF PROCEDURECALL (-191, 2700), (484, 35) */
/* CIF PROCEDURECALL (-195, 2750), (492, 35) */
CALL assert(s // s // s = 'HELLOHELLOHELLO', 's // s // s = "HELLOHELLOHELLO"');
/* CIF TASK (-148, 2750), (399, 35) */
/* CIF TASK (-85, 2800), (273, 35) */
TASK bs1 := {false, true, false, true};
/* CIF TASK (-85, 2850), (273, 35) */
TASK bs2 := {false, false, true, true};
/* CIF TASK (-99, 2900), (301, 35) */
TASK bs3 := {false, false, false, true};
/* CIF PROCEDURECALL (-108, 2950), (318, 35) */
CALL assert((bs1 and bs2) = bs3, 'bs1 and bs2 = bs3');
/* CIF TASK (-57, 3000), (217, 35) */
TASK bs3 := {false, true, true, true};
/* CIF PROCEDURECALL (-98, 3050), (299, 35) */
CALL assert((bs1 or bs2) = bs3, 'bs1 or bs2 = bs3');
/* CIF TASK (-60, 3100), (222, 35) */
TASK bs3 := {false, true, true, false};
/* CIF PROCEDURECALL (-105, 3150), (312, 35) */
CALL assert((bs1 xor bs2) = bs3, 'bs1 xor bs2 = bs3');
/* CIF TASK (-57, 3200), (217, 35) */
TASK bs3 := {true, false, true, true};
/* CIF PROCEDURECALL (-102, 3250), (306, 35) */
CALL assert((bs1 => bs2) = bs3, ' bs1 => bs2 = bs3');
/* CIF TASK (-148, 3300), (399, 35) */
TASK '------------------------------- Unary expressions -------------------------------';
/* CIF TASK (3, 2800), (95, 35) */
/* CIF TASK (3, 3350), (95, 35) */
TASK b := false;
/* CIF PROCEDURECALL (-29, 2850), (160, 35) */
/* CIF PROCEDURECALL (-29, 3400), (160, 35) */
CALL assert(not b, 'not b');
/* CIF TASK (14, 2900), (73, 35) */
/* CIF TASK (-85, 3450), (273, 35) */
TASK bs1 := {false, true, false, true};
/* CIF TASK (-60, 3500), (222, 35) */
TASK bs3 := {true, false, true, false};
/* CIF PROCEDURECALL (-110, 3550), (322, 35) */
CALL assert(not bs1 = bs3, 'not bs1 = bs3');
/* CIF TASK (14, 3600), (73, 35) */
TASK i := 10;
/* CIF PROCEDURECALL (-37, 2950), (177, 35) */
/* CIF PROCEDURECALL (-37, 3650), (177, 35) */
CALL assert(-i = -10, '-i = -10');
/* CIF TASK (-151, 3000), (405, 35) */