Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

how do i wrote interpreter?

Name: Anonymous 2006-04-26 2:08

I want to implement a scripting language in my project.

I don't want to use Lua, even though it's the easiest way I know how.  Instead, I want to write my own scripting language interpreter into my program.

I've a B.S. degree in Computer Science so I know most of the fundamentals, but not the advanced practicalities.  For example, I can probably write up a formal grammar for whatever scripting language I wish to use -- but ... then what?  How do I apply that knowledge, to what I wish to do?

Any good sources on this subject that isn't targeted towards Ph.Ds with Masters Degrees, but good enough for someone with a B.S. degree level of education?

Name: Anonymous 2006-04-27 2:50

There is no hard part.
1 - read line
2 - use strtok to iterate through lines, and search for keywords
3 - when keyword is found, use strtok more to get parameters for keywords if keyword needs them
4 - search for keyword in an array and convert it to a function pointer
5 - call function pointer with keyword's parameters as arguments
6 - repeat

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List