Script checking program

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Script checking program
Post Navel Trauma ^_^
Member # 67
Profile Homepage #0
I've made a program to check BoA scripts for errors. It's not fully tested, but I think it works well enough for at least a beta type of release.

Get it here: alint
You need OS X to run it.

Source is here . Needs flex and bison to compile it. It should work with no modification on Unix-like OSes and possibly with not too much effort on Windows.

If you don't have flex and bison, you could try lex and yacc, although I'm not sure they work, or get the processed source here. This is not a form you want to modify things in, though.

Let me know if you use it, and whether it works.

[ Wednesday, August 18, 2004 11:27: Message edited by: Khothie ]

--------------------
Barcoorah: I even did it to a big dorset ram.

New Mac BoE
Posts: 1798 | Registered: Thursday, October 4 2001 07:00
Off With Their Heads
Member # 4045
Profile Homepage #1
Wow. I just started using it, and it looks really impressive. I was thinking about mentioning the total lack of a separate compiler outside the BoA app itself and how useful such a thing would be, and BAM, here it is. Nice job, Khoth!

It has some small issues. It gives double errors, sometimes. For instance, these two lines:

while ((j <= 84) && (i == 0))
{if char_ok(j)
It complained that they were both wrong, even though the second one is the only one with an error. It does this from time to time.

When a semicolon is missing, it consistently gives the next line, not line it's missing from. I don't know if this was intentional.

It also doesn't seem to recognize the special SANCTIFICATION_STATE in terrain scripts.

[ Wednesday, August 18, 2004 16:56: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Shock Trooper
Member # 643
Profile #2
I think I may put my new knowledge of C++ to do a port to PC. If that's alright with you Khoth.(hopefully I'll be able to alter the source if you've used something different? not heard of flex or bison or lex and yacc, I'll look into it)

Wish me luck.

--------------------
Fine Meal is people!!!
Posts: 289 | Registered: Saturday, February 16 2002 08:00
Post Navel Trauma ^_^
Member # 67
Profile Homepage #3
I'll have to look into that while and if thing. I have no idea why it's doing that, or even how it can possibly be doing that. As for the semicolon thing, statements are allowed to have line breaks in them, so it doesn't know there's a mistake until it gets to the next line and finds that it doesn't follow on from what was there.

Flex and Bison are programs that generate C code to do what I want.

Flex: http://www.gnu.org/software/flex/
Bison: http://www.gnu.org/software/bison/bison.html

Alint is written in C, and you are allowed to compile, modify, reverse engineer and/or disassemble to your heart's content.

--------------------
Barcoorah: I even did it to a big dorset ram.

New Mac BoE
Posts: 1798 | Registered: Thursday, October 4 2001 07:00
Infiltrator
Member # 4637
Profile Homepage #4
Sounds cool, but I'm on PC.

I'll wait a couple more reply posts before adding it to my site (to be sure that it doesn't has nasty bugs in it ;) ).

--------------------
Visit the Blades of Avernum Center
and the Beta Testing Center

--------------
"Beware lest anyone cheat you through philosophy and empty deceit, according to the tradition of men, according to the basic principles of the world, and not according to Christ." Colossians 2:6-9
Posts: 483 | Registered: Tuesday, June 29 2004 07:00
Post Navel Trauma ^_^
Member # 67
Profile Homepage #5
PC version, courtesy of uranusalien: http://www.srcf.ucam.org/~eet23/alint/alint.exe.zip

If you want documentation and the like, download the Mac version. It comes with a few helpful rtf files.

--------------------
Barcoorah: I even did it to a big dorset ram.

New Mac BoE
Posts: 1798 | Registered: Thursday, October 4 2001 07:00
Shock Trooper
Member # 643
Profile #6
heh, nevermind, I was bet to it.

--------------------
Fine Meal is people!!!
Posts: 289 | Registered: Saturday, February 16 2002 08:00
Infiltrator
Member # 4637
Profile Homepage #7
Nice. Added it to the site. Included the docs in the zip file too.

--------------------
Visit the Blades of Avernum Center
and the Beta Testing Center

--------------
"Beware lest anyone cheat you through philosophy and empty deceit, according to the tradition of men, according to the basic principles of the world, and not according to Christ." Colossians 2:6-9
Posts: 483 | Registered: Tuesday, June 29 2004 07:00
Shock Trooper
Member # 4557
Profile #8
I added an extra semicolon to the "clear" statement at the beginning of scenario data script, and got about thousands of "structural errors" on almost every line. This has to be an error.

I am using the Windows version.
Posts: 264 | Registered: Wednesday, June 16 2004 07:00
Babelicious
Member # 3149
Profile Homepage #9
Khoth:

lineend: ';'
| lineend ';'
;
and replacing all instances of ';' with lineend in grammar.y should fix the 'structural error' issue. It'd help if I had some scripts in Unix format to test with.

--------------------
I've got a pyg in a poke.
Posts: 999 | Registered: Friday, June 27 2003 07:00
Post Navel Trauma ^_^
Member # 67
Profile Homepage #10
Thanks, Djur. I'll try that.

What do you mean, scripts in unix format? It doesn't care what sort of line endings you use, if that's the problem.

--------------------
Barcoorah: I even did it to a big dorset ram.

New Mac BoE
Posts: 1798 | Registered: Thursday, October 4 2001 07:00
Babelicious
Member # 3149
Profile Homepage #11
I get tons of syntax errors on every script I test it on.

--------------------
I've got a pyg in a poke.
Posts: 999 | Registered: Friday, June 27 2003 07:00
Post Navel Trauma ^_^
Member # 67
Profile Homepage #12
Ick. Would you mind testing it on a very short script where it produces errors it shouldn't, with the -d option on, and sending me the script and results?

--------------------
Barcoorah: I even did it to a big dorset ram.

New Mac BoE
Posts: 1798 | Registered: Thursday, October 4 2001 07:00