[antlr-interest] Re : pseudocode translator to java,c and Ada

Jim Idle jimi at temporal-wave.com
Thu Feb 21 19:06:59 PST 2008


My feeling is that what you are really saying is one of:

 

1)      I want a natural language processor, but one that is bound by a
certain set of rules, so the input has a definite closed set;

2)      Does anyone know of a formally defined language that is akin in
some ways to how people write pseudo-code, but that isn’t pseudo-code
(which is an open ended problem) and that  is used for specifying
programs, but is a lot easier to learn than the usual set of programming
languages. Try writing the previous sentence in pseudo-code.

 

If 1, then depending on the scope, ANLTR might work for the problem, but
there are other tools that are more specifically aimed at this sort of
thing. You might find a group that deals with natural language
processing and start there. You can make ANTLR be a part of anything
really, but whether you are using the correct tool is always something
you should ask ;-). I ask it of myself, and I would rather use ANTLR
than kiss my mother.

 

If 2, then I don’t know of such a thing beyond the highly ambiguous and
error prone languages born of attempts at ‘4GL’ by people with no idea
what computer languages are (which is not a benefit to writing a user
friendly language, before anyone pipes up ;-). I think that the issue is
not that people cannot think of reasonable languages, but that by
definition you invent a programming language, albeit at a higher level
than C, Java and so on. Hence you end up asking people to be
programmers. So, even if someone has done something like this, my
feeling is that you would find it of no particular benefit for real
world scenarios.

 

It might be more useful to you to state what the problem is that you are
trying to solve, which might be an interesting discussion. You may be
asking for 4 strong men to push a car up a hill when what you want is a
gallon of gas.

 

Jim

 

 

 

 

From: Joe Token [mailto:joe.token at yahoo.fr] 
Sent: Thursday, February 21, 2008 4:04 PM
To: Randall R Schulz; antlr-interest at antlr.org
Subject: [antlr-interest] Re : pseudocode translator to java,c and Ada

 

There might be a misunderstanding....
Let's say, i am an average end user and i want to write requirements in
pseudocode that is close to Pascal (and of course, i have defined a BNF
for 'this' pseudocode)
I doubt that this average end user is familiar to Lisp...(and to follow
you, i shall say that there are a million of Lisp...even i guess you are
talking about smthg like Common Lisp)
Then...
I would like to know, if someone has the idea of making a Java or Ada
translator , from this "common" pseudocode, just as in the past (some 20
years ago) people developed CASE tools for the lazy programmers..
Thanks all  !   :-\



----- Message d'origine ----
De : Randall R Schulz <rschulz at sonic.net>
À : antlr-interest at antlr.org
Envoyé le : Vendredi, 22 Février 2008, 0h54mn 02s
Objet : Re: [antlr-interest] pseudocode translator to java,c and Ada

On Thursday 21 February 2008 15:30, you wrote:
> You are right, but precisely, pseudocode(s) are not programming
> languages, so it (they) do(es) not really have syntax rules.

Well, then there's no hope of creating a parser, is there?


> I'll be happy with any of it ! (close to Pascal)

I'm afraid there's no way around devising a completely precise grammar 
if you're going to process it with ANTLR. Or yacc / Bison, JavaCC, 
SableCC or any other parser generator. They're all based on some form 
or elaboration of BNF (Backus Nauer Form). That's mostly what it means 
to be a formal grammar.


>> What is this "pseudocode" you speak of? There are a million, since
>> they're rarely formalized. And without formalization, they cannot be
>> translated, of course.

>  so ...i assume that among the "million" pseudocode, at least, you
> have one  to propose me ;-)

Well, you cannot do better then LISP!


>> _The_ translator?  Unless I'm missing  something,
>> the use of the definite article is unwarranted. 
>
> ok, one translator !
>
> ok, let's say , I'll be happy to find One pseudocode translator to
> Ada, for instance, whatever the pseudocode looks like,

Well, I could be surprised, but I doubt such a thing exists.


> thank's all !
>
> Joe


Randall Schulz

 

 

  _____  

Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo!
Mail 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080221/da6be6fa/attachment-0001.html 


More information about the antlr-interest mailing list