0

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

4
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by ithelp
0

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?

0

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]

0

I guess it is a compiler project assignment, you can probrably use lex and yacc to do it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.