It appears you have not registered with our community. To register please click here ...

May 18, 2012, 05:15:40 AM

Author Topic: Lapin's Galaxy syntax validator Tool  (Read 2922 times)

LAPIN

  • Resident
  • **
  • Posts: 25
    • View Profile
Lapin's Galaxy syntax validator Tool
« on: March 06, 2010, 06:35:42 AM »
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
« Last Edit: April 13, 2010, 11:37:07 AM by LAPIN »

DarkBlizz - Making Battle.net Magic -

Lapin's Galaxy syntax validator Tool
« on: March 06, 2010, 06:35:42 AM »

1337

  • Resident
  • **
  • Posts: 34
    • View Profile
Re: Galaxy syntax validator
« Reply #1 on: March 06, 2010, 07:09:36 AM »
i <3 u

LAPIN

  • Resident
  • **
  • Posts: 25
    • View Profile
Re: Galaxy syntax validator
« Reply #2 on: March 06, 2010, 07:12:36 AM »
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.
« Last Edit: March 07, 2010, 01:01:26 PM by LAPIN »

LAPIN

  • Resident
  • **
  • Posts: 25
    • View Profile
Re: Galaxy syntax validator Tool
« Reply #3 on: March 06, 2010, 03:48:30 PM »
0.3 out w\ gui

CneoC

  • New Member
  • *
  • Posts: 5
    • View Profile
Re: Galaxy syntax validator Tool
« Reply #4 on: March 07, 2010, 10:52:01 AM »
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

  • Resident
  • **
  • Posts: 25
    • View Profile
Re: Galaxy syntax validator Tool
« Reply #5 on: March 07, 2010, 04:28:46 PM »
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.

CneoC

  • New Member
  • *
  • Posts: 5
    • View Profile
Re: Galaxy syntax validator Tool
« Reply #6 on: March 07, 2010, 04:32:56 PM »
awesome :)

hd

  • Member
  • ***
  • Posts: 56
    • View Profile
Re: Galaxy syntax validator Tool
« Reply #7 on: March 07, 2010, 04:45:33 PM »
my 7zip won't extract the files :X

nevermind, got it to work.

unfortunately, it's not helping me find the current error ;\
« Last Edit: March 07, 2010, 04:48:58 PM by hd »

LAPIN

  • Resident
  • **
  • Posts: 25
    • View Profile
Re: Galaxy syntax validator Tool
« Reply #8 on: March 07, 2010, 04:57:13 PM »
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

  • New Member
  • *
  • Posts: 5
    • View Profile
Re: Galaxy syntax validator Tool
« Reply #9 on: March 07, 2010, 05:01:06 PM »
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

  • Resident
  • **
  • Posts: 25
    • View Profile
Re: Galaxy syntax validator Tool
« Reply #10 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.

CneoC

  • New Member
  • *
  • Posts: 5
    • View Profile
Re: Galaxy syntax validator Tool
« Reply #11 on: March 08, 2010, 02:45:00 AM »

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

jenkinsdjtg

  • Member
  • ***
  • Posts: 40
    • View Profile
Re: Galaxy syntax validator Tool
« Reply #12 on: March 08, 2010, 10:01:35 AM »
 :D

LAPIN

  • Resident
  • **
  • Posts: 25
    • View Profile
Re: Galaxy syntax validator Tool
« Reply #13 on: March 09, 2010, 12:52:58 PM »
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.
« Last Edit: March 09, 2010, 01:01:36 PM by LAPIN »

LAPIN

  • Resident
  • **
  • Posts: 25
    • View Profile
Re: Galaxy syntax validator Tool
« Reply #14 on: March 09, 2010, 07:05:40 PM »
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.
« Last Edit: April 13, 2010, 11:51:17 AM by LAPIN »

DarkBlizz - Making Battle.net Magic -

Re: Galaxy syntax validator Tool
« Reply #14 on: March 09, 2010, 07:05:40 PM »