JOVIAL2CTM Translator

The JOVIAL2C translator converts source code written in JOVIAL to functionally equivalent source code in C taking advantage of some GNU 3.0 extensions of C. The tool has been constructed using the DMS Software Reengineering Toolkit, the JOVIAL Front End, and a customization of the C Front End by GNU extensions for C used by the translator.

The JOVIAL2C translator has been used to modernize sophisticated embedded aircraft software, such as the mission software for the Northrop Grumman B-2.

The JOVIAL2C translator supports:

Example

JOVIAL source code

    START

      %define records%
      TABLE tbl'one'grp W 1;
        BEGIN
          ITEM itm'one'A S 3 POS(3,0) = 1;
          ITEM itm'one'B S 3 POS(8,0) = 2;
        END;
      TABLE tbl'two'grp W 1;
        BEGIN
          ITEM itm'two'A S 3 POS(3,0) = 3;
          ITEM itm'two'B S 3 POS(8,0) = 4;
        END

      %access members of records%
      DEFINE get'A(G) "itm'!G'A";
      DEFINE get'B(G) "itm'!G'B";

      %test procedure%
      PROC test(:param) S;
        BEGIN
          ITEM param S;
          ITEM sumA S = get'A(one) + get'A(two);
          ITEM sumB S = get'B(one) + get'B(two);
          test = sumA + param + sumB;
          %perform sumA times%
          FOR I: 1 BY 1 WHILE I<= sumA;
            IF I < sumB;
              sumB = sumB + test(I);
            ELSE
              RETURN;
          param = param + sumB;
        END
    TERM

C source code produced by JOVIAL2C Translator

    #include "jovial.h"
    static struct
           {
             U(3) : 3 _align_to_bit;
             S(3) itm_one_a : 4 _align_to_bit;
             U(1) : 1 _align_to_bit;
             S(3) itm_one_b : 4 _align_to_bit;
             U(4) : 4 _align_to_bit;
           } tbl_one_grp = { .itm_one_a = 1,
                             .itm_one_b = 2 };
    static struct
           {
             U(3) : 3 _align_to_bit;
             S(3) itm_two_a : 4 _align_to_bit;
             U(1) : 1 _align_to_bit;
             S(3) itm_two_b : 4 _align_to_bit;
             U(4) : 4 _align_to_bit;
           } tbl_two_grp = { .itm_two_a = 3,
                             .itm_two_b = 4 };
    /* access members of records */
    #define GET_A(__g__) \
      tbl_##__g__##_grp.itm_##__g__##_a
    #define GET_B(__g__) \
      tbl_##__g__##_grp.itm_##__g__##_b
    static S test(S *ARG(param));
    /* test procedure */
    static S test(S *ARG(param))
      {
        __typeof__(*ARG(param)) param = *ARG(param);
        __typeof__(test(ARG(param))) RESULT(test);
        _main :
          {
            S suma = GET_A(one) + GET_A(two);
            S sumb = GET_B(one) + GET_B(two);
            RESULT(test) = suma + param + sumb;
            /* perform sumA times */
            {
              __typeof__(1) i;
              for (i = 1; i <= suma; i += 1)
                if (i < sumb)
                  sumb = sumb + test(i);
                else
                  goto _return;
            }
            param = param + sumb;
          }
        _return :
          {
            *ARG(param) = param;
            return RESULT(test);
          }
      }

Semantic Designs can provide cusomized tools and migration support to your organization.




JOVIAL2C
Translator