flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > suggestion /*Comments*/ (final rev.8 - over for me) Goto page Previous 1, 2, 3, 4, 5, 6, 7, 8 Next |
Author |
|
baldr 16 Feb 2010, 15:03
ouadji,
Probably you should write specification first? It's easier to find flaws in the entire scheme than construct test cases looking at the source. For example, this does not compile: Code: db "Hello"/*,"world!"*/,0 Code: db "Hello",/*"world!",*/0 |
|||
16 Feb 2010, 15:03 |
|
ouadji 16 Feb 2010, 15:05
Code: /* nop \/* nop */ does not compile. I know why ! a stupidity Code: \/* ; it's a somewhat special sequence. I'll fix it ! @baldr Code: db "Hello"/*,"world!"*/,0 ok ... all this is the result of a unique (single ??) problem. Quote:
i will fix it. |
|||
16 Feb 2010, 15:05 |
|
ouadji 16 Feb 2010, 15:27
Baldr ok, I saw why this does not compile ! "/*" preceded by <"> or <'> is also a bit special. I have not included these particular sequences in the case of nesting. stupid of me ! i will fix all this. Your feedback is very important for me, thank you ! |
|||
16 Feb 2010, 15:27 |
|
ouadji 16 Feb 2010, 16:22
Code: /* nop \/* nop */ Code: /* nop \"/*" nop */ <---- when nested, </*> or <*/> --> ' or " ! when it is nested, I have to put </ *> or <* /> between < '> or < "> .... I soon finished solving the problem raised by Baldr. |
|||
16 Feb 2010, 16:22 |
|
ouadji 16 Feb 2010, 17:00
Code: all ok ------ db/* nop \"/*" nop */0 db 'Hello'/*,"world!"*/,0 db "Hello",/*"world!",'*/0 and this, below ... /* db 'Hello'/*,"world!"*/,0 db "Hello",/*"world!",'*/0 */ db "/*Hello*/Hello"/*/* \ 'comments | '*/' | funny, no ? '*/'*/"Hello" | *\*/ / db "Hello",/*"*/""Hello"''*/0 db "/*comment='/*'*/"/*db "/*comment='/*'*/"*/ problem reported by Baldr, fixed. Of course, feedback and results of your tests are welcome ! Last edited by ouadji on 21 Sep 2010, 20:20; edited 2 times in total |
|||
16 Feb 2010, 17:00 |
|
baldr 16 Feb 2010, 20:18
ouadji,
You may consider this artificial, but nevertheless: Code: db 7,\/* 8,9,*/10 Without clear specification it's all about contrivance to make particular code fail. Code: startcomment fix /* endcomment fix */ startcomment Hell, it's a cruel world! endcomment |
|||
16 Feb 2010, 20:18 |
|
ouadji 16 Feb 2010, 20:40
for this, it's normal it does not compile. but ... i will try to fix it, and that this example also compiles it should be possible! just a matter of algorithm, no ? specification ? start : /* end : */ inside, for /* and */ --> "/*" (or '/*'), "*/" (or '*/') that's all. |
|||
16 Feb 2010, 20:40 |
|
baldr 16 Feb 2010, 21:28
ouadji,
Code: ; I consider db 7,\/* 8,9,*/10 ; as a shortcut to db 7,\; \; 8,9, 10 ; with line numbers retained Start small. Unnestable '/*' '*/' with the ability to insert them anywhere ';' goes. Regard fixing and line numbers. Consider open comments in macros and their expansions (or deny them altogether). fasm's preprocessing stage (Tomasz, I apologize for that) is quite a mess already, and we don't have the debugger for it! As a sidenote, fasmpre was a beautiful tool for debugging macros. Tomasz, would you rewrite it to compile on current codebase (or at least make "Build symbols" able to save partially built .fas in case of error)? |
|||
16 Feb 2010, 21:28 |
|
ouadji 16 Feb 2010, 21:47
it's very nice of you, but I have another approach to the problem. with "\" just before the comment, it's a special case ... macros and comments are different problems. you have pinpointed a particular case. (one of the only remaining, or perhaps even the only). but I'll fix that. |
|||
16 Feb 2010, 21:47 |
|
baldr 16 Feb 2010, 22:37
ouadji,
It's not a nit-picking. As I can see now, there are several flaws in the design (sorry, I have to be harsh in order to help these useful changes make their way into stable release). Would you like to see my debug build of fasm? It dumps everything as it interprets it. By the way, excessive indentation and/or extra space after first operand (before comma) wouldn't help to integrate into existing codebase. Would Tomasz like it? I dunno. |
|||
16 Feb 2010, 22:37 |
|
ouadji 16 Feb 2010, 23:01
my English is not very good, and your text is quite complex for me. I can not understand everything. Quote:
I think i understood. do not worry, I can fix this and remove the spaces and unnecessary indentations, no problem. Quote:
and your comments do not bother me absolutely not. Quote:
humm ... i don't understand this, sorry. your "debug build of fasm" ? Yes, but I don't know exactly what it is. I don't quite understand this term "debug build" (?) |
|||
16 Feb 2010, 23:01 |
|
baldr 16 Feb 2010, 23:43
ouadji wrote: my English is not very good, ouadji wrote: I think the problem you raised is one of the last, probably the last one. As for my custom build of fasm — it dumps everything after preprocessing into chosen file. Helps to understand where is the point of failure in my macros (yours too ) Unless Tomasz reborns fasmpre, it's my debugger for macros and such. |
|||
16 Feb 2010, 23:43 |
|
ouadji 18 Feb 2010, 21:37
for baldr and for all I'd like, please, that you test this version. find cases that do not compile to help me to improve the algorithm! thank you very much ! but watch this: for example ... cases below do not compile, but this is normal ! the interpretation is ambiguous. This case is impossible to solve ... there are others. This would require a global analysis of context. Here, it is not a question of dialectics, but of semantics. Code: db "hello","/*" c "*/hello" == "hello","/*" + c "*/hello" or == "hello"," + /*" c "*/ + hello" => ??? impossible to choose !! and this: db "hello", /* c "*/"hello" ......... Waiting endlessly for </*> ! and this, below ... does not compile why ? here, it's a choice from me. it must remain consistent ! db 0,\ /*comment*/ 1 <--- "1" is alone ! or db 0,1,\ /* com ment*/ <-- no problem for the truncated comment 1 <--- but here, "1" is alone too ! it is not impossible to do, it's a choice from me. Having said that, this does not compile either db 0,\ ; fasm comment 2 but there are all other cases Quote:
PS: 1) Inside a nesting, the symbols "/*" and "*/" must be surrounded by '"' or "'". 2) The symbols of openness and closure of a comment block or internal nesting, can't be surrounded by the symbols "'" or '"' . 3) "/*" or "*/" can not be cut in half, look at this below : Code: db 0,/* comment * /1 does not compile. initially, this was ok ! but I deleted it, to keep the logic and coherence. (cohesiveness of meaning .... my english, ooops ) Last edited by ouadji on 21 Sep 2010, 20:25; edited 3 times in total |
|||
18 Feb 2010, 21:37 |
|
bitshifter 19 Feb 2010, 02:36
baldr wrote: Would you like to see my debug build of fasm? It dumps everything as it interprets it. Yes, please do share sources with us! _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
19 Feb 2010, 02:36 |
|
ouadji 19 Feb 2010, 12:46
Please, could you try this last release, above. ("fasm 1.69.12 multiline comments (test bench).rar") and give me your results (cases that don't compile) it would help me to Improve the algorithm. Alone to test it, this is not very effective. thank you very much. |
|||
19 Feb 2010, 12:46 |
|
ouadji 19 Feb 2010, 19:22
I found an error in the algorithm, a stupid thing I will fix it ! |
|||
19 Feb 2010, 19:22 |
|
ouadji 20 Feb 2010, 23:33
I develop a new algorithm, more efficient and more powerful. And most importantly, it analyzes the immediate environment of each Comments (the "code-context"). It allows to go further and resolve situations which hitherto was unresolved. This is really fun and exciting. I think there ... even those who are skeptical, will be interested. I hope |
|||
20 Feb 2010, 23:33 |
|
ouadji 22 Feb 2010, 10:43
hi
Code: does compile ... and much more ------------------------------ mov\ ;fasm /* ;fasm */ /* c */ eax /* comment */\ /*com*/ /* com- ;fasm ment*/ \ /* com */ ;fasm ,/* c ;fasm */\/*c*/ ;fasm /*c*/ebx/*c*/ ;fasm mov ecx,edx just below, this does not seem difficult ... and yet, it is complex ! but here, it's a case that has substantially improved the algorithm db 0, \ /*comment*/ ;link spreads over comments (over, above ?) 1,\ /*comment*/ 2 ;but also, db 0,1 /*comment*/ db 2,3 /*comment*/ db 4,5 ;in fact, ;you have to think like if the comments did not exist. ;Mentally you remove it. Here is my last version of Fasm "multiline comments". The algorithm is completely different,much more structured and much more powerful. I think this algorithm is compact, in the sense of set theory (for Baldr). Please, could you test this version and give me your results. I'd like you to give me cases that do not compile. If you find a case that does not compile, be careful at the logic of your text, because this algorithm is quite logical (in any case, I hope ) You have to think like if the comments did not exist, and mentally you remove it. Baldr, I removed and cleaned up the source file of all unnecessary spaces and tabs. Except in my code ... it clearer to me with spaces and tabs (for my code) Last edited by ouadji on 21 Sep 2010, 20:22; edited 1 time in total |
|||
22 Feb 2010, 10:43 |
|
ouadji 22 Feb 2010, 17:09
a stupid forgetfulness, line 2642, in PREPROCE___.INC Code: PREPROCE___.INC - line 2642 je abort_s (obviously !!!) and not, je found_again_text_or_stop just a small and very stupid coding error. Last edited by ouadji on 21 Sep 2010, 20:22; edited 1 time in total |
|||
22 Feb 2010, 17:09 |
|
Goto page Previous 1, 2, 3, 4, 5, 6, 7, 8 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.