Scripting Language project...

Started by
14 comments, last by Mike 24 years ago
For an independant study in high school I am developing a scripting language. I don''t really know what I''m doing; just kinda figuring it out as I go. The goal of the language is for it to be easily implemented it various projects. I''m not very far along, but eh... If you want to look at the code yourself to get ideas or to tell me what I''m doing wrong go here: mike010.hypermart.net Let me know what you think about the web page to. Once you see the page you will see the humor in the previous sentence.
Advertisement
Mike, check out http://root.cern.ch/root/Cint.html because you''ll need something like this.
I''m not sure what you mean by "you''ll need something like this."

I''m guessing that you mean it would be a good example to look at. Thanks for the link, and if you have some spare time do me a favor and take a look at my code (actually you would need alot of spare time concidering my project has surpased the 1500 lines of code mark) and let me know what you think.
Haven''t read too much of the source, but my first question has got to be, why is the opcode function called "Exicute"? Otherwise I can''t say much, as it seems like the project is still in its infancy.
Theres a whole series of articles on scripting languages at flipcode
SiCrane-

The Exictute function actually does something. Each OpCode class holds the actually C++ code that the virtual machine actually runs in its exicute funtion. As the virtual machine goes through the script''s op codes it calls the op code''s exicute function to actually do something. If you know of a better way to do it please share it with me. I''m new to the this game and open to suggestions.

Brad-

I read the articles at flipcode quite a while ago (before I actully had any desire to write a scirpting language). The problem I have with that series is that the author uses lex and yakk (or was it flex and bison... or flex and yakk...) to generate the lexer and parser. I plan to write my own. However, i think that i am using some of the ideas that the author presented. To be honest I''ve read alot about scripting languages, but what i read is always implemented useing a lexer and parser generator or its implemented in a C style (not C++). I''ve pretty much decided to go my own way (don''t get me wrong, I will still listen to advice). I''m just trying to make sure I don''t completely screw things up.
You misunderstand me, I understand what the function does, I''m wonder why it''s called "Exicute". Rather than, for example, "Execute."

Traditionally, though, the execution of opcodes has been a property of the VM rather than the opcodes. This is, more or less, a necessity when the code is compiled to true byte-codes. However, again, I stress I''ve only given your project a cursory look, and can''t make any judgements yet.
Oh... that''s any easy one; I can''t spell. It''s kinda funny that I would messup that one considering that you run a ".exe".
No offense bud but I seriously doubt you can write a non-ambiguous parser without the help (and ease of use) of Flex and Bison. Don't get cocky. Until you have read and understood the Dragon Book (Aho) and you understand LR(1) and LALR(1) parsers writing your own C-syle recursive descent parser is ludicrous. Flex and Bison are extremely easy and powerful tools. Hell, even GNU g++ uses them for its C++ grammar parser.

There is no one on this planet that can write a scripting parser in C or C++ faster than I can write the parser/lexer in Flex/Bison, eat a Pizza, shoot some pool, and take a nap. It just isn't possible; the larger the grammar gets the more you will thank yourself you spent the time reading Levine's book on Flex and Bison.


Edited by - Lance on 2/29/00 3:41:49 PM
Um, Lance, did you see his instruction set? For a project on this scale it''s pretty easy to handcode an RDP for the grammar. Even without lex and yacc (or flex and bison) you can use other similar tools, such as Johnston''s RDP generator or JavaCC. So you don''t need to preach flex/bison like it was gospel.

This topic is closed to new replies.

Advertisement