Commit 37c1a76b authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add RETURNS statement to procedure declarations

parent 98a8438a
...@@ -585,8 +585,8 @@ package {process_name} is'''.format(process_name=process_name, ...@@ -585,8 +585,8 @@ package {process_name} is'''.format(process_name=process_name,
if params: if params:
params_spec = "({})".format("; ".join(params)) params_spec = "({})".format("; ".join(params))
ri_header += params_spec ri_header += params_spec
ads_template.append( ads_template.append(u'-- Sync required interface "{}"'
u'-- Sync required interface "' + proc.inputString) .format(proc.inputString))
if simu: if simu:
# As for async TM, generate a callback mechanism # As for async TM, generate a callback mechanism
ads_template.append(u"type {}_T is access procedure{};" ads_template.append(u"type {}_T is access procedure{};"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
   
# Resource object code # Resource object code
# #
# Created: Sun Nov 22 17:13:10 2015 # Created: Wed Dec 2 15:36:15 2015
# by: The Resource Compiler for PySide (Qt v4.8.6) # by: The Resource Compiler for PySide (Qt v4.8.6)
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
This diff is collapsed.
This diff is collapsed.
...@@ -97,6 +97,7 @@ tokens { ...@@ -97,6 +97,7 @@ tokens {
RANGE; RANGE;
RESET; RESET;
RETURN; RETURN;
RETURNS;
ROUTE; ROUTE;
SAVE; SAVE;
SELECTOR; SELECTOR;
...@@ -280,13 +281,21 @@ procedure ...@@ -280,13 +281,21 @@ procedure
: cif? : cif?
PROCEDURE procedure_id e1=end PROCEDURE procedure_id e1=end
fpar? fpar?
res=procedure_result?
(text_area | procedure)* (text_area | procedure)*
((processBody? ENDPROCEDURE procedure_id?) | EXTERNAL) ((processBody? ENDPROCEDURE procedure_id?) | EXTERNAL)
e2=end e2=end
-> ^(PROCEDURE cif? procedure_id $e1? $e2? fpar? -> ^(PROCEDURE cif? procedure_id $e1? $e2? fpar? $res?
text_area* procedure* processBody? EXTERNAL?) text_area* procedure* processBody? EXTERNAL?)
; ;
// Procedure result / optional return type
procedure_result
: ('->' | RETURNS)
variable_id?
sort
-> ^(RETURNS variable_id? sort)
;
// Procedure formal parameters // Procedure formal parameters
fpar fpar
...@@ -1431,6 +1440,7 @@ GEODE : G E O D E; ...@@ -1431,6 +1440,7 @@ GEODE : G E O D E;
HYPERLINK : H Y P E R L I N K; HYPERLINK : H Y P E R L I N K;
ENDTEXT : E N D T E X T; ENDTEXT : E N D T E X T;
RETURN : R E T U R N; RETURN : R E T U R N;
RETURNS : R E T U R N S;
TIMER : T I M E R; TIMER : T I M E R;
PROCESS : P R O C E S S; PROCESS : P R O C E S S;
ENDPROCESS : E N D P R O C E S S; ENDPROCESS : E N D P R O C E S S;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment