View previous topic :: View next topic |
Author |
Message |
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: Apr 28th, 2012, 7:03pm Post subject: Try out the parser |
|
|
You can download an executable file that implements the current stable syntax from www.b6sw.com/ViviFire/VF.exe.
The program needs to be passed the name of a file to parse on the command line; therefore, it's best to run this from the Command Prompt. _________________ Brent
Last edited by Brent on Aug 14th, 2014, 7:17pm; edited 1 time in total |
|
Back to top |
|
|
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: May 1st, 2012, 8:15pm Post subject: Re: Try out the parser |
|
|
I just uploaded a new version. My current and primary reason for this executable release is to see what you all think about the error messages it generates.
You don't need to know every detail of VF's syntax. In fact, it might be preferable if you know only LB or RB and haven't been following this forum that closely. You could make it into a little game with the goal to produce the most obscure error message.
If you do produce an error message you don't understand, please post the code here. _________________ Brent |
|
Back to top |
|
|
STPendl Full Member
Joined: 20 Aug 2007 Posts: 161 Location: Austria
|
Posted: May 2nd, 2012, 8:01pm Post subject: Re: Try out the parser |
|
|
I will hopefully be able to do some testing over the weekend.
Thanks for the sneak-peek _________________ Stefan
Any code I post can be freely used, just give credit. |
|
Back to top |
|
|
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: May 4th, 2012, 10:03pm Post subject: Re: Try out the parser |
|
|
I continue to work on improving the error messages—particularly those related to malformed tokens. Look for an update this weekend.
http://www.b6sw.com/docs/ViviFire _________________ Brent |
|
Back to top |
|
|
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: May 6th, 2012, 5:43pm Post subject: Re: Try out the parser |
|
|
There's a new release, just in case you didn't notice. The next release will likely be next weekend. Some problems I'm working on include allowing comments in more places and repeated comments. I'll also try to make the EXE much smaller. _________________ Brent |
|
Back to top |
|
|
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: May 7th, 2012, 5:39pm Post subject: Re: Try out the parser |
|
|
After seeing Brandon's recent bug report, I ran his code through VF and got "Invalid IfStatement" which seems unsatisfactory. In the next release it should instead display the message "Mismatched parentheses." _________________ Brent |
|
Back to top |
|
|
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: May 11th, 2012, 9:57am Post subject: Re: Try out the parser |
|
|
I just updated the files. You may notice that VF.exe has shed some weight. It's about 500KB smaller than its predecessor. If you feel so inclined, please try it out.
The only complaint about the feedback I'm getting is that it's completely nonexistent. Please let me know what causes your disinterest. Or if that term doesn't cover it, I'm eager to learn what you really think.
I have considered posting about VF on the Conforums board, but hesitate, not wishing to appear as competition with LB5 for people's attention. _________________ Brent |
|
Back to top |
|
|
Alyce Full Member
Joined: 04 Jul 2005 Posts: 91
|
Posted: May 11th, 2012, 12:16pm Post subject: Re: Try out the parser |
|
|
Brent wrote: | I just updated the files. You may notice that VF.exe has shed some weight. It's about 500KB smaller than its predecessor. If you feel so inclined, please try it out.
The only complaint about the feedback I'm getting is that it's completely nonexistent. Please let me know what causes your disinterest. Or if that term doesn't cover it, I'm eager to learn what you really think.
I have considered posting about VF on the Conforums board, but hesitate, not wishing to appear as competition with LB5 for people's attention. |
I was going to suggest that you do exactly that, Brent. Please feel free. There is a thread there about translating LB to C that really belongs here on your board. I don't have time to explain it there without appearing abrupt (I'm out the door to the oral surgeon... joy.) Please invite the "translate to C" folks here. (The topic sure doesn't belong on the novice board anyway.)
My dad (age 86) is in hospital again with pneumonia and my attention is fragmented and elsewhere. That is why I haven't tried your parser. Sorry.
Edit to add: if I wasn't clear, YES, please post about vivifire on the conforums board. _________________ - Alyce |
|
Back to top |
|
|
robmcal Guest
|
Posted: May 14th, 2012, 7:26pm Post subject: Re: Try out the parser |
|
|
I would love to help with testing but I'm not real sure what to do. I opened the command prompt and typed in <C:\Users\rob\Desktop\vivfire\VF.exe "VFUnit.txt"> (without the arrows, didnt want to use quotes and confuse things) When I press run a dos type window flashes on my screen. Not really sure if VFUnit.txt is a vf program or not. Tried it with a small LB program and got same flashing window. |
|
Back to top |
|
|
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: May 14th, 2012, 10:03pm Post subject: Re: Try out the parser |
|
|
The .txt files are grammar specifications for VF. In particular, VFUnit.txt is for the sub-scanner to lex unit names which follow different rules from the normal grammar specified by VF2012.txt. I haven't uploaded any test files yet, because the grammar is still in flux. The main purpose for releasing the executable is to allow people to stumble around and tell me if they get any errors they find strange. If you have read all of my "experiment" posts, you should get a good idea of what is going on with syntax and the goals of the project.
The best way to run VF.exe is to place it in a folder of your choice, then start Command Prompt and CD to that directory. Then type "notepad <some file>" where <some file> is a name of your choice and allow Notepad to create it. Then you can type some code you think will produce a certain error (or not) and save it. Then go back to Command Prompt and type "vf <some file>" and watch what happens.
Currently the program will display each token on a separate line. For an expression, it will print out labels that indicate which productions are invoked to parse the expression. The numbers to the left of the token are that token's associated token number (eg 1 = newline). _________________ Brent |
|
Back to top |
|
|
robmcal Guest
|
Posted: May 14th, 2012, 11:27pm Post subject: Re: Try out the parser |
|
|
Quote: | If you have read all of my "experiment" posts, you should get a good idea of what is going on with syntax and the goals of the project. |
No I hadn't because:
Quote: | In fact, it might be preferable if you know only LB or RB and haven't been following this forum that closely. |
Sorry, I thought this would take an LB program and make an .exe. That was the subject of the thread at the LB forum where this thread was linked. Unforunately I don't have time to learn a new language right now. Good luck with your project.
@ Alyce,
Best wishes for a speedy recovery for your dad. He will be in my thoughts and prayers. |
|
Back to top |
|
|
JosephE Junior Member
Joined: 01 Nov 2007 Posts: 21
|
Posted: May 15th, 2012, 3:21am Post subject: Re: Try out the parser |
|
|
I tried out the parser. It's great! I think.
I ran it on this code file:
Code: |
print "Hello, world!"
end
|
Based on LB, right?
Code: | C:\Users\Joseph\Downloads>vf vf.txt
19:print
17:"hello, world!"-- line 1 col 7: plainHandle expected
1:?
19:end-- line 2 col 4: plainHandle expected
-- 2 error(s) |
That's what I got. It looks like it's working! I'm just...at a loss of what "plainHandle" is. Does VF require mandatory parenthesis on all function calls?
I can't tell, but I changed it to this:
Code: | Print("hello, world!")
end |
And got this:
Code: | C:\Users\Joseph\Downloads>vf vf.txt
19:print
4:( Identifier variable
17:"hello, world!" Expression Logical Relational Additive Multiplicative Power U
nary Primary String
5:)
1:?-- line 1 col 24: invalid AssignmentStatement
19:end-- line 2 col 4: plainHandle expected
-- 2 error(s) |
Enlighten me, perhaps? In any event, great job on your parser! It seems to be completely over-controlling jerk, which is always a good thing when it comes to parsers. |
|
Back to top |
|
|
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: May 15th, 2012, 4:18am Post subject: Re: Try out the parser |
|
|
Hi Joseph,
VF isn't designed to work like LB; it was inspired by it. That being the case, there's no PRINT keyword. Instead you have to pass a value to an object's method. It might look like Code: | require IO #out
#out "Hello world!"NL"" |
Here, the REQUIRE statement works much like Run BASIC's RUN statement to import a library and assign it a handle. The library exports an anonymous method, which is called in the second line. The NL metacharacter is to print a newline. I have considered adding support for macros that would provide an exact equivalent to the PRINT statement, but haven't.
The term "plainHandle" is to distinguish it from a "handleArray". Code: | #handle = #null
#handles(1) = #null
#handles("test") = #null |
_________________ Brent |
|
Back to top |
|
|
JosephE Junior Member
Joined: 01 Nov 2007 Posts: 21
|
Posted: May 15th, 2012, 4:50am Post subject: Re: Try out the parser |
|
|
Ok, I'm starting to get the idea of it.
But even this didn't work. It should at least be valid to the parser, right?
Code: | require IO #io
#io "Hello world!" |
|
|
Back to top |
|
|
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: May 15th, 2012, 5:33am Post subject: Re: Try out the parser |
|
|
Joseph, you didn't mention what the error message was, or if you got one. The only error I can fathom you getting is "newline expected" because every statement must end with a line break.
BTW, for anyone running Vista or later, you can send VF's output to the clipboard using a command like _________________ Brent |
|
Back to top |
|
|
|