Lapin's Galaxy syntax validator Tool

Started by LAPIN, March 06, 2010, 06:35:42 AM

Previous topic - Next topic

LAPIN

Sick of Galaxy syntax errors? This tool should be able to show you the culprit line.

Instructions:

       
  • Extract scripts from Core.SC2Mod
  • Copy natives.galaxy inside Core.SC2Mod/TriggerLibs/
  • run lapin with "-B Core.SC2Mod/ TriggerLibs/myfile.galaxy"
Syntax and static type analysis. Download attachment!


Web version available at http://www.galaxyvalidator.com/


Type checking e.g. http://galaxyvalidator.com/results/46a5c72eb6794ecebd1fcbce4d218e28/


Enjoy,
Lapin

1337


LAPIN

#2
There are some constructs that might not be supported. If so, please provide me with your source file. Or even better, with a simplified example of the syntax.

LAPIN


CneoC

Nice tool, already saved me a bit of time so far :)

one thing it doesn't seem to be able to validate though: the += -= *= etc operators, which i use regularly (a += 1; beats a = a + 1; in my book :P)


LAPIN

Version 0.4 is out.


Added the += syntax.


It will also validate the files you include in your script. So my recommendation is to make a IncludeAll.galaxy file so you can run the program on just one file which will validate all your files.


hd

#7
my 7zip won't extract the files :X

nevermind, got it to work.

unfortunately, it's not helping me find the current error ;\

LAPIN

If it's a type error it wont be able to catch it. Let me know what the error is when you know so maybe I can add detection for that sort of errors.

CneoC

well the most usefull error validation would probably be name typo's... though that would require a bit more work i guess. But even if it just generated a list of function calls it could not find in the specified includes. (as in, put each function definition in a list and each function call in a separate list and check which calls are not in the definition list :))

It could generate a few false positives if not all includes etc are parsed, but those could be put in a separate function dictionary text file (compile once with a working build and copy/paste everything i guess ;))

same with variables per-function but that is probably even more work ;)

LAPIN


Version 0.5 is out

i added a simple function check with this version. I also provided a list of "built-in" functions.

CneoC

Quote from: LAPIN on March 07, 2010, 09:43:45 PM

Version 0.5 is out

i added a simple function check with this version. I also provided a list of "built-in" functions.

nice  ;D


LAPIN

#13
New version with basic struct/pointers support. Also detects a few more things.


Note: validate.bat will look in the current working directory now! And not in TriggerLibs.

LAPIN

#14
I'm looking for someone to host a web asp .net front-end for this tool.


Update: http://www.galaxyvalidator.com/

Any help is welcomed.