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

Joe Token joe.token at yahoo.fr
Thu Feb 21 20:14:13 PST 2008


Thank you fo trying to understand...
I do not know another way of writing algorithms than using a pseudocode.
So, when i have to write a complex algorithm,
i start to use a pseudo, which might not being standardized, but
that everyone understands.
So, you see it is none of 1/ or 2/ because the question is not that it is easier to write
with a pseudo than a programming language.
The question is you are not at the same abstraction level, when you have to specify smth.

Then...once you have written you specification, you would like 
to implement one way of coomputing the result in your favorite language.

So, if i got a precise grammar for my "pseudo" pseudocode, i should be able to make a translator.

Then..the question was : does anyone here has done this work before ?





----- Message d'origine ----
De : Jim Idle <jimi at temporal-wave.com>
À : antlr-interest <antlr-interest at antlr.org>
Envoyé le : Vendredi, 22 Février 2008, 4h06mn 59s
Objet : Re: [antlr-interest] Re :  pseudocode translator to java,c and Ada





 


<!--
 _filtered {font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;}
 _filtered {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}
 _filtered {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", "serif";}
a:link, span.MsoHyperlink
	{color:blue;text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;text-decoration:underline;}
p
	{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman", "serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", "serif";}
span.EmailStyle18
	{font-family:"Calibri", "sans-serif";color:#1F497D;}
.MsoChpDefault
	{font-size:10.0pt;}
 _filtered {margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
	{}
 _filtered {}
 _filtered {}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
-->






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 
















      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail http://mail.yahoo.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080222/a27ad441/attachment.html 


More information about the antlr-interest mailing list