|Implementing a stack-based interpreter firstname.lastname@example.org (2005-07-17)|
|Re: Implementing a stack-based interpreter email@example.com (Alex McDonald) (2005-07-22)|
|Re: Implementing a stack-based interpreter firstname.lastname@example.org (Dmitry A. Kazakov) (2005-07-22)|
|Re: Implementing a stack-based interpreter email@example.com (glen herrmannsfeldt) (2005-07-22)|
|Re: Implementing a stack-based interpreter firstname.lastname@example.org (John Carter) (2005-07-22)|
|Re: Implementing a stack-based interpreter Jan.Bogaerts@telenet.be (Jan Bogaerts) (2005-07-22)|
|Re: Implementing a stack-based interpreter email@example.com (2005-07-26)|
|Re: Implementing a stack-based interpreter firstname.lastname@example.org (Tony Finch) (2005-07-26)|
|[6 later articles]|
|From:||Alex McDonald <email@example.com>|
|Date:||22 Jul 2005 20:14:43 -0400|
|Organization:||Virgin Net Usenet Service|
|Posted-Date:||22 Jul 2005 20:14:43 EDT|
> I know this is comp.compilers, but since there isn't a
> comp.interpreters, I figure this is the right place to ask.
> I'm trying write an interpreter for a programming language but haven't
> been able to find anything on how to write a stack-based interpreter.
> If anyone could point me to a book/website I'd be much obliged.
> Thanks again.
> - Chris
> [Compile to a string of reverse polish operators, then interpret that string
> pushing results on the stack and popping operands off the stack. -John]
Take a look at Forth; it is a stack based language. Newsgroup is over at
comp.lang.forth; there are also quite a lot of forth implementations,
from public domain to polished professional. There's a webring at
http://t.webring.com/hub?ring=forth, and a FAQ at
One stack isn't quite enough, btw, unless you're interpreter is for a
simple RPN calculator; Forth uses two, one for data and one for return
addresses of called subroutines (called words in Forth).
[One stack is enough if you have a simple enough procedure call without
variable length argument lists and the like. -John]
Return to the
Search the comp.compilers archives again.