Jump to content
  • Advertisement
Sign in to follow this  
CodeTitan

Writing a scripting language

This topic is 4975 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do you write your own scripting language? I mean, do you have to use tools like lex and yacc? Or can you just write it in C/C++?

Share this post


Link to post
Share on other sites
Advertisement
The language itself is an abstract concept that you decide on. A program which makes use of that language is made just like any other program, although software such as Lex and Yacc help to automate some of the well-understood stages of using a language (such as lexing and parsing).

Share this post


Link to post
Share on other sites
Keep one thing in mind: Implementing a non-trivial scripting language directly in C++ will be much harder than learning and using tools for lexing and parsing such as lex and yacc.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Don't listen to any of the guys .. check this link out ...

http://www.devincook.com/goldparser/

Share this post


Link to post
Share on other sites
i wrote my own compiler system in less than 3 weeks
its not complete, but its extremely usable.

check it out, its on these forumns (Tribute BASIC; in the
scriping and mod forumns)

Share this post


Link to post
Share on other sites
Quote:
Original post by silvermace
i wrote my own compiler system in less than 3 weeks
its not complete, but its extremely usable.

check it out, its on these forumns (Tribute BASIC; in the
scriping and mod forumns)


realy?
i have had people tell me that it isnt posible

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by silvermace
im not saying its a miracle language or anything, but there
is very little it can't do - and those will definatly be addressed in the next release in 2 or so weeks

check it out.
http://www.gamedev.net/community/forums/topic.asp?topic_id=270108

PS. I'm not kidding about the 3 weeks, it will be 3 weeks on
thursday (tommorow here in NZ)


AND 1-2 months. for the VM......

depends how much of the functionality is in the VM versus complexity in the compilers code generator.

7-11 weeks in reality....

And then there is the testing/verifying/fixing all the feature
endcases. (There are more than a few, even in BASIC)



As to things usually needed for a script language --
how about interfacing to ASM/C/C++ libraries/calls to do graphics/engine interface stuff... which is critical for a real script language.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Sneftel
Keep one thing in mind: Implementing a non-trivial scripting language directly in C++ will be much harder than learning and using tools for lexing and parsing such as lex and yacc.


Unfortunately that is only part of writing a compiler.
The language interactions and executable creation (VM bytecode or
native code) is still a major chunk of work those dont do.

(and if its bytecode, you still have to do the VM)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!