[TxMt] Assembly language patterns

Edward K. Chew ekchew at gmail.com
Fri Apr 4 12:48:20 UTC 2008


I am new to this list and apologize if this topic has already been  
covered.

I am trying to design a bundle for an obscure DSP assembly language,  
and I have reached the point where I have got this sprawling regular  
expression that can identify every instruction recognized by the  
processor.  It actually works quite well, and it's wonderful to see  
the syntax coloring kick in.

So my question is about how best to identify assembly language  
components in terms of themes.  Are there any precedents in this  
regard?  For the time being, I am using two main categories:

assembly.opcode
assembly.directive

I have also broken these down into the likes of  
assembly.directive.macro and assembly.opcode.modifier.  The latter may  
be a peculiarity of the language I am using, which has constructs like  
this:

  tst d0
  add d1,d2 ifeq

This tells the processor to add data register d1 to d2, but only if  
the value of d0 tested zero.  The "ifeq", then, is what I am referring  
to as an opcode modifier, for want of a better term.

Anyway, I'm not sure if I am going about this right, or if it all  
needs to go under keyword or something.  Any suggestions?

-Ted




More information about the textmate mailing list