Re: Adding an interpreted language to program

Louis Krupp <lkrupp@pssw.com>
30 Mar 2007 23:06:11 -0400

          From comp.compilers

Related articles
Adding an interpreted language to program me262c@gmail.com (me262) (2007-03-29)
Re: Adding an interpreted language to program me262c@gmail.com (me262) (2007-03-29)
Re: Adding an interpreted language to program lkrupp@pssw.com (Louis Krupp) (2007-03-30)
| List of all articles for this month |
From: Louis Krupp <lkrupp@pssw.com>
Newsgroups: comp.compilers
Date: 30 Mar 2007 23:06:11 -0400
Organization: Posted via Supernews, http://www.supernews.com
References: 07-03-105 07-03-108
Keywords: interpreter
Posted-Date: 30 Mar 2007 23:06:11 EDT

me262 wrote:
> On Mar 28, 10:01 pm, "me262" <me2...@gmail.com> wrote:
>> I am facing a task of hooking up my program to an intepreted
>> language for front end. I know nothing about compiler theory. Is there
>> a step-by-step guide on how to do that?
>>
>> I looked into some tools such and ANTLR and GOLD. Somehow, they
>> would produce an AST. But how do I work it to do things that are
>> useful, for example, printing "Hello world: we saw a = 10?".
>>
>> Thanks,
>> [This question comes up a lot, and the best advice is NOT to try to
>> write your own interpreter. There are plenty of interpreted languages
>> already such as TCL, Lua, and Python, any of which can be used to
>> drive your application. -John]
>
> Hi John,
>
> Thanks for the comment. I totally agree with what you said. But in
> our particular branch of engineering, there are thousands of scripts
> already written in an old interpretive language. As a new comer, we
> must be able to pop in CD, install and kick ass. We just can't ask
> customers to Pythonize first.
> [In that case, you'll have to reimplent your scripting language. Ugh.
> I'd suggest parsing into an AST or RPN, then interpret that, rather
> than trying to interpret directly from the parser. -John]


Depending on the interpretive language, you *might* be able to
translate a script on the fly to Lua or whatever, and then execute the
result.


Louis
lkrupp *at* pssw *dot* com



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.