script engine // parse scripts

Started by
17 comments, last by GameDev.net 17 years, 11 months ago
isn't there just a compiled library out there wich supports the **** regular expressions? i've now downloaded tons of them, but either they require all the mfc garbage i don't need or they won't work and produce tons of compiler errors...

*edit*

i'm too stupid to install boost under windows, i don't know what i have to do after setting the paths for visual studio in the console, the manual doesn't help very well. the search doesn't help me either -.-

[Edited by - SiS-Shadowman on May 17, 2006 3:48:58 PM]
Advertisement
Is there some devestating flaw in Angelscript that prevents you from using it?
i can't see anything about egular expressions in the manual
Is one of your requirments that the scripting library support regexs? Then bind boost::regex to angelscript. Angelscript doesn't include ANY built in libraries because you can add anything to it so easily. :)
i don't need regex in a scripting language. i want to create my own and use regex to parse the lines ( i know it's not possible because of the infinite thing, but i just need a simple syntax )

i don't get any of the librarys supporting regex running... the manuals aren't helping a bit
boost::regex is certainly the best option for regexs in C++. I've been told it's interface is very similiar to java and .net's regex packages, but I've never used either of those two myself. If you have trouble getting it working, I'm sure if you posted a thread here about the specific problem you would get plenty of help.
Quote:Original post by SiS-Shadowman
i don't need regex in a scripting language. i want to create my own and use regex to parse the lines ( i know it's not possible because of the infinite thing, but i just need a simple syntax )

i don't get any of the librarys supporting regex running... the manuals aren't helping a bit


It's too bad you can't seem to install boost... since boost::spirit is very nice for creating your own parser/script language.

It does seem a little scary at first; but if you follow Joel's docs from the start, and try the examples... your brain should open up to it and it will seem easy.

We've currently implemented a GUI scripting language for our apps... boost::spirit can do what you're asking.


Chad
my_life:          nop          jmp my_life
[ Keep track of your TDD cycle using "The Death Star" ] [ Verge Video Editor Support Forums ] [ Principles of Verg-o-nomics ] [ "t00t-orials" ]
thanks, i'll opend a new thread right away :)


You can write a state engine that processes your language's statements.

One would be a tokenizer that reads in a line string and determine from the characters what the token is (ie- a number, a variablename, a quote delimited string, punctuation/operators etc...).

You then gave another state engine that builds your statements (using the tokens that come from the tokenizer to transition your state engine). Its not too complicated if you stay away from nesting of control blocks, or parenthesized equations, etc....

You would either execute operations corresponding to the language or build bytecode. Things get weirder when you have things like ELSE statements (when you have to skip execution of statements and find the end of a code block...

This topic is closed to new replies.

Advertisement