2

I have some scripts written in proprietary language. I want to know whether there is any language with similar syntax like this ?

    PROCEDURE MY_PROC_NAME DO 
    {
        DECLARE VARIABLE ABC AS NUMBER 
        [ABC] := 123;

        IF ([ABC] = 123) THEN
        {
            WHILE (TRUE) DO
            {
            }
        }
        ELSE
        {
            RETURN
        }
        #a comment
        SomeFunction(123, 456);
        CALL ANOTHER_PROCEDURE;
    }

Thank you.

Morpheus
  • 1,722
  • 5
  • 27
  • 38
  • That's not a lot of code to go on. Do you have a bit more? Maybe some reserved words? – david.pfx Apr 25 '14 at 11:27
  • What is your aim? To run the scripts as is or to convert them to another language which you can run? – lhf Apr 26 '14 at 13:20
  • @lhf I needed to build a full parser and analyzer for this language. So I thought if there is similar language I could use some free stuff out there. This was written by some old folks, so I think they should have inspired by some old language. – Morpheus Apr 27 '14 at 02:48
  • @david.pfx I have added more code :) – Morpheus Apr 27 '14 at 02:52
  • Reminds me a bit of Pascal. But the declarations are different, and Pascal does not use curly braces. – Reto Koradi Apr 27 '14 at 02:59

2 Answers2

0

That looks a lot like Comal. See http://en.m.wikipedia.org/wiki/COMAL

Mattias Åslund
  • 3,877
  • 2
  • 18
  • 17
0

This is an imperative programming language, with no macro, functional or object-oriented features in the samples provided. It has features borrowed from Pascal (':=') and C ('{}'). The structure is otherwise unremarkable.

There are some distinctive constructs.

  1. PROCEDURE name DO {} to define a procedure (but apparently not a function).
  2. DECLARE VARIABLE name AS type to define a variable.
  3. [ABC] in referring to the contents of a variable.

The lack of a semicolon on the DECLARE line is interesting, but could be a typo.

So, a derivative language probably dating from around the mid to late 1980s. It could even be a dialect of Basic (there were lots of them!).

With some additional code it might be possible to narrow it down further.

david.pfx
  • 10,520
  • 3
  • 30
  • 63