DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Computer Science (http://www.daniweb.com/forums/forum14.html)
-   -   Programming Language Design Help (http://www.daniweb.com/forums/thread115291.html)

stupidenator Mar 23rd, 2008 2:47 am
Programming Language Design Help
 
Hello,

I am writing a programming language in c++ for a class and I am having a problem understanding how to do some of it. The language is based on Forth, and you are allowed to redefine how any of the words in the language work. I am trying to understand how to store the instructions for each of the words. If anyone can shed some light on some methods of accomplishing this, it would be greatly appreciated!

Thanks,

Nick

sarehu Mar 23rd, 2008 12:04 pm
Re: Programming Language Design Help
 
It depends.

What features of the stack language are there? What values could possible appear on the stack? Numbers? Integers, Doubles? Strings, arrays, linked lists? Do you want to have runtime checks to see what kind of data structure you're dealing with? Can pointers (to functions) go on the stack? Do you want to be able to construct functions in the middle of code?

tobbilla78 Mar 24th, 2008 5:24 am
Re: Programming Language Design Help
 
Quote:

Originally Posted by stupidenator (Post 567195)
Hello,

I am writing a programming language in c++ for a class and I am having a problem understanding how to do some of it. The language is based on Forth, and you are allowed to redefine how any of the words in the language work. I am trying to understand how to store the instructions for each of the words. If anyone can shed some light on some methods of accomplishing this, it would be greatly appreciated!

Thanks,

Nick

i will give you the code in the next week
---------------------
[snipped fake signature]

ithelp Mar 24th, 2008 9:56 am
Re: Programming Language Design Help
 
I guess it is a compiler project assignment, you can probrably use lex and yacc to do it.


All times are GMT -4. The time now is 8:16 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC