BasEdit.NET
Moderator: Moderators
OK, It now passes the syntax check without crashes, still remain some "false" syntax error results that I will report you.
I will find a bit of time during the week-end, here in Italy is very hot, it's time for the beach along with my children... btw the night is very looong
I will find a bit of time during the week-end, here in Italy is very hot, it's time for the beach along with my children... btw the night is very looong
Mega-Cart: the cartridge you plug in once and for all.
OK, very log test season !!!
checked about 150 listing
I've found a "compilation" problem on this row:
When compiled the word "DELL" is on the end of the row.
maybe there is an OS incompatibility, do you use a MAC ?
I've also the full list of "false" syntax error check, you have PM
checked about 150 listing
I've found a "compilation" problem on this row:
Code: Select all
3220 DATAUNA,CHIAVE,18,DEI,TOPI,21,DELL',AGLIO,27,UNA,SCALA,14,UNA,BOTTIGLIA,0
maybe there is an OS incompatibility, do you use a MAC ?
I've also the full list of "false" syntax error check, you have PM
Mega-Cart: the cartridge you plug in once and for all.
I had a first look at nbla000's impressive list of "syntax check errors" and detected something I never thought of:
There are some usages of relational operators in "the wrong order":
instead of
I always thought that only the <>, <= and >= where allowed, not ><, => or =<. Maybe I'm a little bit biased by Pascal or some other languages...
Anyways, it shouldn't be to difficult to accept the other combinations, but then I detected another anomaly:
may be syntactically ok for Basic V2 but as my tests show the part behind "if a$<>="s"then" will be executed regardless of the variable a$!
It doesn't matter what you put into a$, you will always get the message "behind then" printed. Therefore I would like to specify the following allowed combinations of relative operatores:
=
<
>
<= / =<
>= / =>
<> / ><
So at most it could have 2 relational operators! Did I miss anything about these relational operators which is used and valid and makes sense?
There are some usages of relational operators in "the wrong order":
Code: Select all
10 ifa$><"s"then...
Code: Select all
10 ifa$<>"s"then...
Anyways, it shouldn't be to difficult to accept the other combinations, but then I detected another anomaly:
Code: Select all
61 ifa$<>="s"thenpokeva,0:tt=tt+1:iftt=500then4
Code: Select all
10a$="s"
20ifa$<>="s"thenprint"behind then!"
=
<
>
<= / =<
>= / =>
<> / ><
So at most it could have 2 relational operators! Did I miss anything about these relational operators which is used and valid and makes sense?
It seems ok to me.Schlowski wrote:So at most it could have 2 relational operators! Did I miss anything about these relational operators which is used and valid and makes sense?
Mega-Cart: the cartridge you plug in once and for all.
After some more thoughts I think Basic V2 simply has 3 comparison flags for <, = and > and simply checks if these operators are present. Afterwards the values left and right of these operators will be compared and then Basic will evaluate if the comparison result matches with one of the available flags.
So if you have all three operators in your expression, it will check the result against "is less" OR "is equal" OR "is greater". Since any comparison has to match one of these results the <>= operation will always result in TRUE.
Another time I learned something new about the Interpreter!
So I will change the check as follows: Check for a single(!) occurance of <, = and > regardless of order. This way it's compatible to the Interpreter and does report a syntax error for constructs like >>=.
So if you have all three operators in your expression, it will check the result against "is less" OR "is equal" OR "is greater". Since any comparison has to match one of these results the <>= operation will always result in TRUE.
Another time I learned something new about the Interpreter!
So I will change the check as follows: Check for a single(!) occurance of <, = and > regardless of order. This way it's compatible to the Interpreter and does report a syntax error for constructs like >>=.
New version 1.42 uploaded:
- lots of bugfixes for syntax check
- tokenization bug fixed (FORI=CSTOCS now works as expected)
- better handling of ' comment in tokenization and code generation
@nbla000: all of your 88 samples now pass the syntax check
I made some changes to the behaviour of the ' comment, so it now does not mark parts of the source as comment if you are not in label mode or the basic token file hasn't "HasSimpleRem=1".
But there still is the error that when converting from label to line# mode everything after the ' will be truncated if it's not in quotes.
So for your example
you must enclose the offending data in quotes:
This is on my todo-list but for the moment I do not have more time and wanted to release the version with syntax check bugfixes!
- lots of bugfixes for syntax check
- tokenization bug fixed (FORI=CSTOCS now works as expected)
- better handling of ' comment in tokenization and code generation
@nbla000: all of your 88 samples now pass the syntax check
I made some changes to the behaviour of the ' comment, so it now does not mark parts of the source as comment if you are not in label mode or the basic token file hasn't "HasSimpleRem=1".
But there still is the error that when converting from label to line# mode everything after the ' will be truncated if it's not in quotes.
So for your example
Code: Select all
3220 DATAUNA,CHIAVE,18,DEI,TOPI,21,DELL',AGLIO,27,UNA,SCALA,14,UNA,BOTTIGLIA,0
Code: Select all
3220 DATAUNA,CHIAVE,18,DEI,TOPI,21,"DELL'",AGLIO,27,UNA,SCALA,14,UNA,BOTTIGLIA,0
I've briefly tested what you said and it seems ok, very good job !
btw..... I will reserve myself to recheck the Syntax Check and if all is ok, I will test the code generation, the tokenizer
btw..... I will reserve myself to recheck the Syntax Check and if all is ok, I will test the code generation, the tokenizer
Mega-Cart: the cartridge you plug in once and for all.
I noticed BaseEdit doesn't like the color purple. I crunched a program with a PRINT statement in it that used the color purple. It turned the usual character(half checkerboard half filled space) into a reverse shift L.
I also noticed that if I use Convert to Labels and then Convert to Line Numbers, I noticed it is joining commands after a RETURN statement, rendering those commands basically invisible to the program. The line That its adding past the RETURN command is not referenced by the program at all. It is only used when I need it, as in: RUN 10000. I do this some times to run a disk error check program. In this case, all the little snippet does is display a redefined character set, so I can reference it. If you need me to send you the file let me know, and I will.
Later,
I also noticed that if I use Convert to Labels and then Convert to Line Numbers, I noticed it is joining commands after a RETURN statement, rendering those commands basically invisible to the program. The line That its adding past the RETURN command is not referenced by the program at all. It is only used when I need it, as in: RUN 10000. I do this some times to run a disk error check program. In this case, all the little snippet does is display a redefined character set, so I can reference it. If you need me to send you the file let me know, and I will.
Later,
Rob
As time goes by... The last months where very busy and I hadn't any time for my VIC-20. And as it seems I won't have much more time in the following months so I thought I should take the opportunity to release the sources of my BasEdit.NET to the public domain.
If anyone is interested just grab the sources at http://www.stojalowski.de/files/BasEditNet_SRC.zip
It's a Visual Studio 2010 project, should load just fine with the express version of VB.NET 2010.
Do what you want with it, rip it apart, use the parts of it which suit your needs or simply ignore it
If anyone is interested just grab the sources at http://www.stojalowski.de/files/BasEditNet_SRC.zip
It's a Visual Studio 2010 project, should load just fine with the express version of VB.NET 2010.
Do what you want with it, rip it apart, use the parts of it which suit your needs or simply ignore it
-
- Vic 20 Afficionado
- Posts: 350
- Joined: Tue Apr 14, 2009 8:15 am
- Website: http://wimbasic.webs.com
- Location: Netherlands
- Occupation: farmer
This is true. A mask of 3 bits, representing each of the comparison operators is built by the interpreter, from the Basic programtext. This can be 1, 2 or 3 bits set.Schlowski wrote: After some more thoughts I think Basic V2 simply has 3 comparison flags for <, = and > and simply checks if these operators are present. Afterwards the values left and right of these operators will be compared and then Basic will evaluate if the comparison result matches with one of the available flags.
Then the difference between the two values is calculated and from the sign of the result (>0, =0, <0) a mask is built with one bit set in the appropriate position.
Both masks are ANDed and when the result is zero, the answer of the comparison is false, otherwise true (set to -1).
Regards,
Wim.
VICE; selfwritten 65asmgen; tasm; maintainer of WimBasic
- plbyrd
- Vic 20 Hobbyist
- Posts: 135
- Joined: Tue Jun 01, 2010 9:32 pm
- Website: http://thesharp.ninja
- Location: Clarksville, TN
- Occupation: Software Engineer
Cannot convert to Labels
I have a HUGE source file that is full of spaghetti that is dying to be converted to labels. However, when I try to do so I get the following exception:
I cannot post the code here for privacy reasons, so if you can email me directly at plbyrd at gmail dot com I'll send you the file causing this problem.
Code: Select all
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at BasEdit.modUtility.GenerateLabels()
at BasEdit.frmMain.ConvertLineToLabelsToolStripMenuItem1_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)