flat assembler
Message board for the users of flat assembler.

Index > Main > Feature Request: Regular Expressions

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
art_sands



Joined: 23 Oct 2003
Posts: 55
art_sands
I don't need to justify the fact that regular expressions are extremely powerful. But since, regexps for asmers are rarely available except for HLA, which has pattern matching, I would love FASM to have regular expressions built-in.

Regards,
Art
Post 29 Nov 2003, 17:06
View user's profile Send private message Reply with quote
dickhead



Joined: 30 Nov 2003
Posts: 17
Location: Memory
dickhead
hi art_sands,


what is regular expressions. i never headr of it in other assemblers.

Wink
blabla

_________________
teach me or i'll dick ya.
Post 30 Nov 2003, 12:45
View user's profile Send private message Reply with quote
art_sands



Joined: 23 Oct 2003
Posts: 55
art_sands
Well

You haven't heard of regular expressions may be because you're rather new to programming. There are C libraries like PCRE and GNU regexp which offer them.

Regular expressions are very useful in parsing and matching. They are basically one form of pattern matching (which I think you may also have never heard of). Randy Hyde's book has an excellent chapter on pattern matching and his HLA also has it built in its standard library.

Regards,
Art
Post 30 Nov 2003, 14:51
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7797
Location: Kraków, Poland
Tomasz Grysztar
Can you explain what did you mean by "built-in"? Being a part of standard library is something different from being built-in into the compiler/assembler.
Post 30 Nov 2003, 14:57
View user's profile Send private message Visit poster's website Reply with quote
art_sands



Joined: 23 Oct 2003
Posts: 55
art_sands
Oh that,

Sorry my mistake. Yeah, it should be "built into the standard library" with FASM.

Regards,
Art
Post 30 Nov 2003, 15:04
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
art_sands wrote:
Oh that,
Sorry my mistake. Yeah, it should be "built into the standard library" with FASM.
Regards,
Art


BTW: StrLib.asm is a part of Fresh "standard library" . There should be something similar to regular expresions, but still no one write it. Wink
Post 30 Nov 2003, 16:25
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Kain



Joined: 26 Oct 2003
Posts: 108
Kain
nm
Post 30 Nov 2003, 18:22
View user's profile Send private message Reply with quote
fasm9



Joined: 19 Jun 2003
Posts: 439
fasm9
yes. we need regex(regular expression).

the regex in asm very different from regex in C/perl/C++/C#.
if it can be done, it will be more easy to make masm2FASM, C# 2 FASM translator.

--


Last edited by fasm9 on 01 Dec 2003, 11:58; edited 1 time in total
Post 30 Nov 2003, 21:33
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
PCRE library is small and easy to use in assembly projects.

And is ready to use for any purposes, so you don't need to wait until someone codes a full regexp in fasm.
Post 01 Dec 2003, 09:14
View user's profile Send private message Yahoo Messenger Reply with quote
art_sands



Joined: 23 Oct 2003
Posts: 55
art_sands
Also,

Windows has a scripting regexp library (available with WSH 5.6) that is made available to asmers via COM, but that is only if you know COM properly. PCRE is much easier than doing it in COM.

Regards,
Art
Post 01 Dec 2003, 09:43
View user's profile Send private message Reply with quote
fasm9



Joined: 19 Jun 2003
Posts: 439
fasm9
pelaillo wrote:
1.PCRE library is small and easy to use in assembly projects.

2. And is ready to use for any purposes, so you don't need to wait until someone codes a full regexp in fasm.


1. Hi, Did you mean this? http://www.pcre.org/

2. no, not all purposes, it can be used for C++ base, but you can't use PCRE for FASM.

--
Post 01 Dec 2003, 12:02
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
fasm9 wrote:
2. no, not all purposes

Why not?
It's a DLL that you can call from your fasm code.
Post 01 Dec 2003, 12:40
View user's profile Send private message Yahoo Messenger Reply with quote
art_sands



Joined: 23 Oct 2003
Posts: 55
art_sands
Hi there,

I had tried using it for MASM I made some incs from the headers and the libs, I posted it in the Win32 ASM Community forum, so you might be able to find it there:

http://board.win32asmcommunity.net/showthread.php?s=03f126d3c6539c96323fc6b6a1fcd81d&threadid=15797&highlight=pcre

Regards,
Art
Post 01 Dec 2003, 16:34
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
Here is a test in FASM for using PCRE.

The file pcre.exe will find a regex that matches within the source file pcre.asm


Description: Perl-Compatible Regular Expressions dll +
test coded in fasm to use library

Download
Filename: PCRE.zip
Filesize: 38.14 KB
Downloaded: 592 Time(s)

Post 01 Dec 2003, 20:17
View user's profile Send private message Yahoo Messenger Reply with quote
fasm9



Joined: 19 Jun 2003
Posts: 439
fasm9
sorry,

But still i believe it's useless for FASM. especially, compiler design, language unity. i.e. not application side.

--
i could be wrong.
Post 01 Dec 2003, 20:56
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
fasm9 wrote:
But still i believe it's useless for FASM. especially, compiler design, language unity. i.e. not application side.

Shocked sorry, I don't follow you.

Regular Expression parser is are multipurpose and useful tool that permit to do many things, some of them simple but some others could be very complex. One of the diamond tools of perl programmers.

An immediate use is for advanced search and replace operations.
Post 02 Dec 2003, 09:15
View user's profile Send private message Yahoo Messenger Reply with quote
dickhead



Joined: 30 Nov 2003
Posts: 17
Location: Memory
dickhead
mr. pelailo

can u give me a simple eg. coz i'm new to this

and the above eg just went over my head.


Wink
bla bla

_________________
teach me or i'll dick ya.
Post 02 Dec 2003, 10:54
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
Sure, give me some time to prepare an explanation. In the mean time try playing with the example.
The body is a subclassed edit box that receives function keys.
Post 02 Dec 2003, 13:37
View user's profile Send private message Yahoo Messenger Reply with quote
Randall Hyde



Joined: 03 Dec 2003
Posts: 57
Randall Hyde
art_sands wrote:
I don't need to justify the fact that regular expressions are extremely powerful. But since, regexps for asmers are rarely available except for HLA, which has pattern matching, I would love FASM to have regular expressions built-in.

Regards,
Art


Actually, you can call the HLA pattern matching routines from FASM. There are only a couple of difficulties:

1. the nice syntax that the HLA standard library code uses is based on HLA's macro facilities, which aren't available in other assemblers. Still, you can make up your own macros or call the routines in a "bare" manner.

2. The HLA Standard Library pattern matching routines use character sets. Generating character set constants by hand is a real pain in the butt. I tried to do it with MASM's macros once, but failed miserably. Without character sets, you lose at least half the power of the pattern matching libraries. Of course, you can always write a little utility into which you type a character set and it spits out the data for the character set to include in your FASM code.

Another alternative is to write the pattern matching sequence with HLA, turn on FASM output, and copy that code into your FASM application.
Cheers,
Randy Hyde
Post 03 Dec 2003, 19:26
View user's profile Send private message Visit poster's website Reply with quote
Betov



Joined: 17 Jun 2003
Posts: 98
Betov
I suppose it could be also possible to call Vbrun from FASM also, if someone knows the calling convention... but who would like to?


Betov.
Post 03 Dec 2003, 22:29
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.