Support for custom assemblers syntax

Started by BogdanOntanu, October 01, 2008, 06:56:06 PM

Previous topic - Next topic

BogdanOntanu

Hi Ketilo,

I am working at my own assembler named Sol_Asm and my syntax for UNION is slightly different than MASM or TASM.

I start nameless unions with "UNION" and end them with "ENDU" (as opposed to ENDS in MASM/TASM).

The problem is:
============
When I have unions inside structures then the next structured FAIL to appear in the properties list.

In fact after it all structures in file are ignored. By trial and error I have determined that the apparent reason is that RadASM parser enters an "inside UNION" mode or state and does not "see" the ENDU token as an exit from it for the rest of the file... and because of this it skips all other structures.

Something like this fails:

STRUC MY_CTX
str_size dd ?
info_type dd ?
UNION
   info_tokens dd ?
   info_reloc dd ?
   info_dots dd ?
ENDU
str_type dd ?
ENDS

STRUC MY_HIDDEN_STRUC
my_db ?
my_dd ?
ENDS


After MY_CTX is parsed by RadAsm MY_HIDDEN_STRUC is no longer visible in properties list and it is not found on F2 key.

I mention that the code collapsing for structures and unions does work OK
but I was not able to configure this struct / union issue for Sol_Asm.

For your reference here it is an extract from sol_asm.ini that I use:



[Description]
1=Solar Assembler

[CharTab]
2=0251222522222232;20-2F
3=1111111111242221;30-3F

[Open]
0="Assembly (*.asm;*.inc),*.asm;*.inc"
1="Resource Files (*.rc),*.rc"
2="Text Files (*.txt),*.txt"
3="All Files (*.*),*.*"
src="Assembly (*.asm),*.asm,asm"
hdr="Include (*.inc),*.inc,inc"
mod="Module (*.asm),*.asm,asm"

[CodeMacro]
;KeyWord,InsertBeforeActiveLine,InsertAfterActiveLine
;{I}=Copy indent from keyword line
;{C}=Cr
;{S}=Space
;{T}=Tab
;{$}=Copy Proc/Struct Name
;The macros are set up to assume AutoIndent on
1=.if,{T},{C}{I}.endif
2=.else,{T},
3=.elseif,{T},
4=.while,{T},{C}{I}.endw
5=macro,{T},{C}{I}endm
6=proc,{T}{C}{I}{T},{C}{I}{T}ret{C}{C}{I} endp
7=struct,{T},{C}{I} ends

nASM=2
Code=endp,proc $
Const={C},$ equ, #define $
Data={C},$ db,$ dw,$ dd,$ dq,$ rb,$ rw,$ rd,$ rs,$ real4,$ real8,$ real10
Macro=endm,macro $
Struct=ends,struc $
Label={C},$ :
Local={C},local $
Other=Enums,10
Enums=ende,enum $

[CodeBlock]
1=proc $,endp,,,6
2=.if,.endif,.elseif,.else,0
3=struc $,ends,,,6
4=macro $,endm,,,14
5=#ifdef,#endif,#else,,0
6=enum $,ende,,,6
7=union,endu,,,6


Any hints about how could I chnage the "CODE" section in order to allow my syntax?


Again, Thank you for RadAsm
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

KetilO

Did you try to add:

Struct2=endu,union

BTW:
Did you know?
RadASMIni.rtf documents the assembler.ini files.

KetilO

BogdanOntanu

Thank you for your answer.

And "mea culpa"  :red

Please excuse me for not reading the RadAsm assembler.ini  documentation enough times.


Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro