flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > [sug]Case insensitive MATCHIng

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Don't you think this is quite a mess? Especially implementation of "common stack" could be problematic...
Post 10 Jul 2007, 19:44
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Certainly not since it is possible already with handwritten code. About implementation the sensitive and insensitive stacks seems to be easier to implement (on error handler add code for a second chance using the insensitive stack). However, with the separated stacks implementation, tricks like the following cannot be done:
Code:
macro times [args]
{
  define_all_macros

  match count dummy, args ; I know that count cannot be extracted properly in this way for all cases. Don't mention it Razz
  \{
    repeat count 
       args
    end repeat
  \}

  purge_all_macros
}    

Because defining with imacro wouldn't be enough since the user could have defined a conventional macro like nOp and define_all_macros defines "imacro nop" and "macro nop" (the latter as a desperately attempt to prevent calling the user defined macro). But as I said, implementing with one stack is harder and the trivial implementation wastes unnaceptable amounts of memory.
Post 10 Jul 2007, 20:07
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17475
Location: In your JS exploiting you and your system
revolution
I am not convinced by any of the arguments for imacro (or istruc). No one has shown a case where it is either useful or needed. I think it creates more confusion that anything. Nobody writes mixed case opcodes unless there is a very compelling reason for it (like to deliberately avoid invoking a macro).

But how about imatch? Matching strings by case insensitivity is a useful endeavour IMO. I also showed a use for it in the first post of this thread.

As for code page concerns and the international charset thing, I think that just the ASCII 7-bit codes are sufficient as a starting point. Certainly if it was to be expanded to some form of unicode case match with all the acutes and umlauts etc. then the code becomes quite messy with definitions of code pages and other whatnot.
Post 21 Dec 2008, 03:28
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Quote:

Nobody writes mixed case opcodes unless there is a very compelling reason for it (like to deliberately avoid invoking a macro).


I write non-capitalized opcodes and so the macros that "overrides" them. Could I share my macros with people who likes to use the first letter capitalized or even with those who use all letters capitalized? (since my redaction sucks I mean things like "Mov" and "MOV" respectively when my macros are "mov")

[edit]Yet, your suggestion is priority one IMHO[/edit]
Post 21 Dec 2008, 04:22
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17475
Location: In your JS exploiting you and your system
revolution
Does anyone really write their opcodes with the initial letter capitalised and the rest lower case? I have not seen it. And it seems to be quite inconvenient to type like that anyway.

I accept that some people do write in all uppercase, but they are a clear minority. If I ever have occasion to include code from someone that writes in all uppercase I simply use my editor to push it all to lowercase before I do anything else with it.
Post 21 Dec 2008, 04:37
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Can't remember where I've seen things like "Invoke", but yes some (not many) people does it.
Post 21 Dec 2008, 04:55
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< 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 YouTube, Twitter.

Website powered by rwasa.