AllBASIC Forum

BASIC Developer & Support Resources => Open Forum => Topic started by: jcfuller on September 12, 2010, 10:27:04 AM

Title: Regular Expressions
Post by: jcfuller on September 12, 2010, 10:27:04 AM
Just curious if any of the authors make use of a regular expression library for parsing in their interpreters, compilers, or translators?

James
Title: Re: Regular Expressions
Post by: JRS on September 12, 2010, 10:46:17 AM
I use the ScriptBasic Regular Expression extension module from time to time. Are you thinking of creating a library?



Title: Re: Regular Expressions
Post by: jcfuller on September 12, 2010, 11:04:30 AM
I use the ScriptBasic Regular Expression extension module from time to time. Are you thinking of creating a library?

No.
I rephrased my question!

James
Title: Re: Regular Expressions
Post by: rdc on September 12, 2010, 01:24:49 PM
Just curious if any of the authors make use of a regular expression library for parsing in their interpreters, compilers, or translators?

James

Lex uses regular expressions to parse the syntax, and I am sure most commercial use something similar to Lex. Most home-brew systems I have seen don't.
Title: Re: Regular Expressions
Post by: JRS on September 12, 2010, 02:48:16 PM
James,

It might be worth looking at the ScriptBasic's parser (http://www.scriptbasic.org/docs/dg/devguide_toc.html) and instead of creating a token, increment the C(++) run time function reference count.
Title: Re: Regular Expressions
Post by: Steve A. on September 12, 2010, 04:18:03 PM
Just curious if any of the authors make use of a regular expression library for parsing in their interpreters, compilers, or translators?

I do not, in Bxbasic.
My parser is entirely "home spun".

In years past, I played around (extensively) with the Perl Regex library and found it quite amusing to say the least.
I tinkered with the idea of incorporating it into Bxbasic, but, never got around to it.
For the lay-person, Regex can appear very complex, (at first).
Title: Re: Regular Expressions
Post by: Pjot on September 13, 2010, 12:07:27 AM
Yes, I do use the "POSIX Extended Regular Expressions" which comes with the C library in <regex.h>. See also 'man regex' or this link (http://linux.die.net/man/7/regex).

Peter