0

How to make a new scripting language in C++ ?...I need: parser,scanner,grammar,included functions,syntax.Where I can start?. I think I use JavaScript/PHP syntax.

4
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by siddhant3s
Featured Replies
  • 1

    Well, I guess the kid is ready to slash the mountain. You basically want to write your own language. There is a Bible for Compiler writing which called Dragon Book. [url]http://en.wikipedia.org/wiki/21st_Century_Compilers[/url] It is a vast book. If you are dedicated to write a language, you should pay a price, i.e. … Read More

0

I know you like ambitious projects:

I am going to make OS. And I need help with GUI...how to make an GUI ?...I am not on Windows so CreateWindowEx() doesn't exist.

But I suggest starting of with the easy stuff, hehe. :D

0

:-)...yes...:-)...I have ideas so I need to ask to you ;-)

0

This is a C++ forum, ask questions about C++. If you want to talk about software design in general (for instance, what merits your script will have compared to the other scripts already available), go to the Computer Science forum.. I guess.

Anyway, first define your script on paper. How will scripters create variables? How will scripters add them together?

Then write an interpreter that picks a file (or lines anyway) and parses them.

For instance, if you decided that people create integers with "int <name> = <val>;", you can decide to create a map<string, int> which will hold the users and then add one int when such a line is read.

0

How to make a new scripting language in C++ ?...I need: parser,scanner,grammar,included functions,syntax.Where I can start?. I think I use JavaScript/PHP syntax.

Just before you start to design grammars (the language grammar is the same thing as the language syntax ;)), scanners, parsers, libraries etc - it's a good idea to design A NEW scripting (or what else) LANGUAGE per se. Design before implement...

It's especially valued proposal if "make a new scripting language in C++" means "implement new scripting language interpreter (or JIT compiler, or both) in C++"... or in C... or in Java... or in NEW SCRIPTING LANGUAGE...

Now it looks like I don't know what is it but I want to implement this The Great Nothing in C++!
Probably, the only reasonable reaction is:
Good luck! ( return 0; in C and C++)...

This article 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.