Jump to content

  • Log In with Google      Sign In   
  • Create Account

Scripting library


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 TheDeath   Members   -  Reputation: 122

Like
Likes
Like

Posted 20 May 2000 - 03:11 PM

Hello all, I''m need to do a parser for my own scripting system to add AI to a RPG creator that I''m doing. Anyone knows of one (or more) libraries to do that (to understand the scripts)? Library for DJGPP and to understand C scripts. Thanks a lot!

Sponsor:

#2 Dæmin   Members   -  Reputation: 128

Like
Likes
Like

Posted 20 May 2000 - 03:15 PM

I''m afraid that you''re on your own there, I suggest that you use the good old stdio.h , stdlib.h string.h functions for parsing your script. You could like have a function that parses one line of text and puts the strings in their variables etc, like it puts the "function" into the function string, var1 into the variable string etc, then you''d jsut check what function it is and pass the variables to it?

Sounds simple but you need to code it well and it might take a weekend...

Dæmin
(Dominik Grabiec)
sdgrab@eisa.net.au

CyberPunk RPG
http://www.eisa.net.au/~sdgrab/index.html

#3 Altmann   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 May 2000 - 06:58 AM

Just looking for a parser ?
Run a search for "lex" and "yacc" in any search engine.

Be reading you,
David

#4 TheDeath   Members   -  Reputation: 122

Like
Likes
Like

Posted 24 May 2000 - 11:56 AM

Well, actually i was talking about a library like SeeR (more or less). Just a library like it, not to do my own parser. Is it out there in the net?

#5 Altmann   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 May 2000 - 10:28 PM

I do not understand. What is the SeeR library ?
If you are looking for a C interpreter, I am pretty sure there are some. You can start by looking for csh.
However, I am not sure I understand why anybody would like interpreted C.

Be reading you,
David

#6 Kylotan   Moderators   -  Reputation: 3338

Like
Likes
Like

Posted 26 May 2000 - 02:40 AM

Interpreted C could be useful in letting designers, or even end users customise your game, without needing a compiler, to to stop the game, etc.

#7 TheDeath   Members   -  Reputation: 122

Like
Likes
Like

Posted 26 May 2000 - 04:53 AM

...and that's what I'm trying to do with my creator.

I haven't said it better!

What I'm trying to do is something like a mini-"compiler" for the creator, something like Quake-C, and that's the reason why I'm looking for a library to understand C scripts and let me do whatever I want in my creator without need of "real" C-compiler. I hope this is clear...

Edited by - TheDeath on May 26, 2000 12:00:32 PM

#8 Altmann   Members   -  Reputation: 122

Like
Likes
Like

Posted 26 May 2000 - 07:58 AM

Almost.
Do you want it compiled or interpreted ?

#9 TheDeath   Members   -  Reputation: 122

Like
Likes
Like

Posted 26 May 2000 - 08:13 AM

Well, at first just interpreted, but if the library has the option to compile it (like SeeR - look in www.allegro.cc in ai & scripting), better!

#10 Morbo   Members   -  Reputation: 218

Like
Likes
Like

Posted 28 May 2000 - 10:38 AM

As was mentioned before, yacc and lex would be a good start. They''re a free lexxer and parser, which gets half your job done. Then all you need to do is write the code which actually executes the tokens from the script (a virtual machine).
As to the question of compiled vs. interpreted, it''s a fairly moot point. If you save the tokens, and later execute them directly, it''s compiled. If you parse the script, then execute the tokens, it''s interpretted. Big whoop, eh? You don''t have to create native code (in fact, I''d advise against it) in order to have a compiled language.


#11 TheDeath   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 May 2000 - 11:14 AM

Ok, I would REALLY like to use yacc (bison) and lex (flex) but, I NEED HELP ON USING IT! They look like a mess. Does anyone knows of a VERY easy tutorial? please! my ICQ is 69513633

#12 Kylotan   Moderators   -  Reputation: 3338

Like
Likes
Like

Posted 29 May 2000 - 02:01 AM

Anyone using Visual C++ could look at www.fg-soup.com as they do a Bison/Flex wizard. It crashes my machine though.

#13 TheDeath   Members   -  Reputation: 122

Like
Likes
Like

Posted 29 May 2000 - 02:08 AM

Ups. I''m using DJGPP....




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS