Re: Writing an interpreter

Psi <oplec@westminster.ac.uk>
8 Jun 1996 18:33:46 -0400

          From comp.compilers

Related articles
Writing an interpreter Arne.Evertsson@Octalogic.se (1996-06-01)
Re: Writing an interpreter oplec@westminster.ac.uk (Psi) (1996-06-08)
Re: Writing an interpreter emcee@efi.com (1996-06-08)
Re: Writing an interpreter adf@idt.unit.no (1996-06-13)
Re: Writing an interpreter qjackson@direct.ca (1996-06-13)
| List of all articles for this month |

From: Psi <oplec@westminster.ac.uk>
Newsgroups: comp.compilers
Date: 8 Jun 1996 18:33:46 -0400
Organization: Psionics Inc.
References: 96-06-011
Keywords: interpreter

Arne Evertsson wrote:
> Which is easier:
>
> * Write a compiler that produces p-code, and find an existing p-code
> interpreter.
> * Write my own interpreter


IMHO writing a p-code compiler & P-code interp is easier to program.
Also you get a slight advantage when porting your code to another
platform. (your binaries may still work if you write your output
in a big/little endian-independant manner)


Okay, there is a published pascal/p-code interpreter by wirth
(or at least based on his work). Sorry cannot remember the URL
but I could email it to you, if you want it (needs porting work).
It itself is written in Pascal so you need to 'bootstap' it.


It is in two parts:


pint, and pcomp


pascal_code --> pcomp --> p_code


p_code ------> pint [runs the program]




Regards


Simon
--


Post a followup to this message

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