Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers > Absolute beginn...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 2342 of 2508
Post > Topic >>

Absolute beginner - Need some pointers

by NickCarlson <nacarlson@[EMAIL PROTECTED] > Feb 27, 2008 at 03:02 PM

Hi.

My long term goal is to write a scripting language similar to lua to
replace php (for my own work). At the moment though, I'd be happy just
implemented an interpreter what acted as a calculator.

I've written a (half finished) MIPS emulator in the past, so I'm
hoping that experience will help me with this.

At the moment, my understanding of how to go about implementing this
is as follows:

(we'll call my new language Omega for now)
i. Write a lexical analyzer to convert to Omega code into a tree
structure that the parser can parse.
2. Write a parser to parse the tree structure into bytecode.
C. Write a virtual machine that can execute the bytecode.

The problem is implementing the virtual machine. From my
understanding, it's a lot like writing an emulator, except you get to
choose what the opcodes are. Am I right here? From what I've read, I'd
prefer to write a register-based interpreter as opposed to a stack
based one, because the register based approach seems more intuitive to
me.

Can anyone give me a few tips on how to go about doing this? I'd like
to start out as simple as possible. I've looked through Lua's and
Parrot's source code, but it's more confusing that helpful at this
point.

Thanks.
[Unless you plan to save the bytecode to a file and reload it later,
it's easier just to interpret the trees. -John]
 




 8 Posts in Topic:
Absolute beginner - Need some pointers
NickCarlson <nacarlson  2008-02-27 15:02:21 
Re: Absolute beginner - Need some pointers
Hans-Peter Diettrich <  2008-02-28 11:38:48 
Re: Absolute beginner - Need some pointers
"Bartc" <bc@  2008-02-29 19:00:07 
Re: Absolute beginner - Need some pointers
anton@[EMAIL PROTECTED]   2008-03-02 17:05:10 
Re: Absolute beginner - Need some pointers
anton@[EMAIL PROTECTED]   2008-03-03 19:06:50 
Re: Absolute beginner - Need some pointers
anton@[EMAIL PROTECTED]   2008-03-04 15:32:44 
Re: Absolute beginner - Need some pointers
glen herrmannsfeldt <g  2008-03-05 09:07:43 
Re: Absolute beginner - Need some pointers
Soeren Sandmann <sandm  2008-03-07 23:39:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 7:09:36 CDT 2008.