Commit 3685658d authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add VDM to mini-CV

parent f0053de7
/* Buildsupport is (c) 2008-2015 European Space Agency
/* Buildsupport is (c) 2008-2016 European Space Agency
* contact: maxime.perrotin@esa.int
* License is LGPL, check LICENSE file */
/*
......@@ -20,7 +20,7 @@ Copyright 2014-2015 IB Krates <info@krates.ee>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h> // Works with GCC under Windows (not tested with cl.exe)
#include <sys/stat.h>
#include "my_types.h"
#include "practical_functions.h"
......@@ -29,6 +29,7 @@ Copyright 2014-2015 IB Krates <info@krates.ee>
(simulink==i->parent_fv->language)?"Simulink":\
(qgenc==i->parent_fv->language)?"QGenC":\
(ada==i->parent_fv->language)?"Ada":\
(vdm==i->parent_fv->language)?"Vdm":\
(qgenada==i->parent_fv->language)?"QGenAda":\
(rtds==i->parent_fv->language)?"RTDS":\
(scade==i->parent_fv->language)?"SCADE6":\
......@@ -61,8 +62,6 @@ void Init_MiniCV_Backend(FV * fv)
/* Add a new AADL SUBPROGRAM to the Concurrency view*/
void Add_Subprogram(Interface * i)
{
Parameter_list *tmp;
if (NULL == cv)
return;
......@@ -72,50 +71,35 @@ void Add_Subprogram(Interface * i)
if (NULL != i->in || NULL != i->out) {
fprintf(cv, "FEATURES\n");
tmp = i->in;
while (NULL != tmp) {
FOREACH(param, Parameter, i->in, {
fprintf(cv,
"\t%s:%s PARAMETER DataView::%s {encoding=>%s;};\n",
tmp->value->name, (PI == i->direction) ? "IN" : "OUT",
(tmp->value->type),
BINARY_ENCODING(tmp->value));
/* (native == tmp->value->encoding) ? "Native" : (uper ==
tmp->
value->
encoding)
? "UPER" : (NULL != i->out) ? "Native" : "UPER"); */
tmp = tmp->next;
}
param->name,
(PI == i->direction) ? "IN" : "OUT",
param->type,
BINARY_ENCODING(param));
});
tmp = i->out;
while (NULL != tmp) {
FOREACH(param, Parameter, i->out, {
fprintf(cv,
"\t%s:%s PARAMETER DataView::%s {encoding=>%s;};\n",
tmp->value->name, (PI == i->direction) ? "OUT" : "IN",
(tmp->value->type),
BINARY_ENCODING(tmp->value));
/* (native == tmp->value->encoding) ? "Native" : (uper ==
tmp->
value->
encoding)
? "UPER" : "Native");*/
tmp = tmp->next;
}
param->name,
(PI == i->direction) ? "OUT" : "IN",
param->type,
BINARY_ENCODING(param));
});
}
fprintf(cv, "END %s;\n\n", i->name);
fprintf(cv, "SUBPROGRAM IMPLEMENTATION %s.%s\nPROPERTIES\n",
i->name, ENCODING(i)
);
i->name, ENCODING(i));
fprintf(cv, "\tFV_Name => \"%s\";\n", i->parent_fv->name);
fprintf(cv, "\tSource_Language => %s;\nEND %s.%s;\n\n",
ENCODING(i), i->name, ENCODING(i)
);
ENCODING(i), i->name, ENCODING(i));
}
/* Close the Concurrency view */
......
Supports Markdown
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