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
2871eaac
Commit
2871eaac
authored
Jul 17, 2015
by
Maxime Perrotin
Browse files
Add Enumerated types support to write(ln)
Upgraded to version 1.1.0 due to the new feature
parent
44526062
Changes
5
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
2871eaac
...
...
@@ -148,6 +148,9 @@ The fonts are the fonts from Ubuntu, check licence in file FONT-LICENSE.TXT
Changelog
=========
1.
1.0 (07/2015)
-
Write/Writeln procedure support enumerated types
1.
0.1 (06/2015)
-
Bugfix: use mono when calling asn1.exe by default (needed redhat-based
distros)
...
...
opengeode/AdaGenerator.py
View file @
2871eaac
...
...
@@ -709,6 +709,10 @@ def write_statement(param, newline):
elif
type_kind
==
'BooleanType'
:
cast
=
'Boolean'
code
.
append
(
u
"Put({cast}'Image({s}));"
.
format
(
cast
=
cast
,
s
=
string
))
elif
type_kind
==
'EnumeratedType'
:
code
,
string
,
local
=
expression
(
param
)
code
.
append
(
u
"Put({}'Image({}));"
.
format
(
type_name
(
param
.
exprType
),
string
))
else
:
error
=
(
u
'Unsupported parameter in write call '
+
param
.
inputString
)
...
...
opengeode/ogParser.py
View file @
2871eaac
...
...
@@ -465,7 +465,8 @@ def check_call(name, params, context):
if
name
.
lower
()
in
(
'write'
,
'writeln'
):
for
p
in
params
:
p_ty
=
p
.
exprType
if
is_numeric
(
p_ty
)
or
is_boolean
(
p_ty
)
or
is_string
(
p_ty
):
if
is_numeric
(
p_ty
)
or
is_boolean
(
p_ty
)
or
is_string
(
p_ty
)
or
\
is_enumerated
(
p_ty
):
continue
raise
TypeError
(
'Type {} not supported in call to {}'
.
format
(
type_name
(
p
.
exprType
),
name
))
...
...
opengeode/opengeode.py
View file @
2871eaac
...
...
@@ -115,7 +115,7 @@ except ImportError:
__all__
=
[
'opengeode'
,
'SDL_Scene'
,
'SDL_View'
,
'parse'
]
__version__
=
'1.
0.1
'
__version__
=
'1.
1.0
'
if
hasattr
(
sys
,
'frozen'
):
# Detect if we are running on Windows (py2exe-generated)
...
...
tests/regression/test-simu/orchestrator.pr
View file @
2871eaac
...
...
@@ -30,15 +30,6 @@ external comment '#vdm #classname=RemoteCall';
START;
/* CIF NEXTSTATE (944, 201), (72, 34) */
NEXTSTATE Wait;
/* CIF STATE (1474, 345), (74, 35) */
STATE next;
/* CIF INPUT (1447, 400), (122, 35) */
INPUT pulse(a);
/* CIF PROCEDURECALL (1401, 450), (213, 35) */
CALL reset_timer(mytimer);
/* CIF NEXTSTATE (1473, 500), (70, 35) */
NEXTSTATE wait;
ENDSTATE;
/* CIF STATE (1468, 125), (100, 35) */
STATE timeout;
/* CIF INPUT (1453, 180), (147, 35) */
...
...
@@ -48,6 +39,15 @@ external comment '#vdm #classname=RemoteCall';
/* CIF NEXTSTATE (1489, 280), (74, 35) */
NEXTSTATE next;
ENDSTATE;
/* CIF STATE (1474, 345), (74, 35) */
STATE next;
/* CIF INPUT (1447, 400), (122, 35) */
INPUT pulse(a);
/* CIF PROCEDURECALL (1401, 450), (213, 35) */
CALL reset_timer(mytimer);
/* CIF NEXTSTATE (1473, 500), (70, 35) */
NEXTSTATE wait;
ENDSTATE;
/* CIF STATE (944, 201), (72, 34) */
STATE Wait;
/* CIF INPUT (666, 255), (101, 35) */
...
...
@@ -79,8 +79,8 @@ anint := 478;
CALL writeln('Calling VDM2 with value', fixed(0));
/* CIF PROCEDURECALL (595, 946), (242, 35) */
CALL vdm2(fixed(0), simpleseq);
/* CIF PROCEDURECALL (
52
1, 996), (
39
1, 40) */
CALL writeln('Result:', simpleseq!a, ' ', simpleseq!b);
/* CIF PROCEDURECALL (
46
1, 996), (
51
1, 40) */
CALL writeln('Result:', simpleseq!a, ' ', simpleseq!b
, ' ', simpleseq!c
);
/* CIF OUTPUT (647, 1051), (138, 35) */
OUTPUT telemetry(a);
/* CIF OUTPUT (643, 1101), (147, 35) */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment