The Helper Forums
The Helper offers free technical support for computer games,
computer hardware, and other computer software. Staffed
by volunteer tech support workers, The Helper is highly
regarded as a premium destination for those who are
experiencing technical problems with their computers.
Affiliate Sites
Warcraft 3 World Editor Tutorials - The Greatest Resource for the new Warcraft 3 Mapper
Silkroad Online Forums
Houston Microsoft Access, VBA and Visual Basic Programming
The source for NUON news, information, and games.
Griffonrawl Muay Thai and MMA
Warcraft 3 Modding Site.
Element Tower Defense by Karawasa.
Topaz Games.
Chernobyl Lost Riddles

Able Auto Glass specializes in Houston Auto Glass Replacement as well as windshield repair and replacement services.
Apex Steel Pipe - Buys and sells Used Steel Pipe.

Go Back   The Helper Forums > Starcraft II Zone > Starcraft II Resources

Reply
 
Thread Tools Display Modes
  #1  
Old February 28th, 2010, 06:43 PM
phyrex1an's Avatar
phyrex1an phyrex1an is offline
Staff Member and irregular helper
 
Join Date: Mar 2005
Location: Sweden
Posts: 3,776
phyrex1an has disabled reputation
Galaxy parser

http://github.com/phyrex1an/galaxy-parser
Parses all .galaxy files I (read Azlier) found. Completely without comments and otherwise untested. But hey, what is a beta-less coder to do?

You need the haskell platform for it to compile.

Or try the online galaxy syntax checker.
__________________

Last edited by phyrex1an; March 5th, 2010 at 08:24 AM.
Reply With Quote
  #2  
Old March 1st, 2010, 02:43 PM
Lyerae Lyerae is offline
Hai.
 
Join Date: May 2009
Posts: 1,882
Lyerae seems to have the helping tendency (+150)Lyerae seems to have the helping tendency (+150)
What exactly does it parse into? O.o
Reply With Quote
  #3  
Old March 2nd, 2010, 01:17 AM
Jesus4Lyf Jesus4Lyf is offline
Good Idea™
 
Join Date: Jul 2007
Location: Australia
Posts: 3,857
Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)
Can we has [GALAXY] tagz nao?
They can has highlight native list.
Reply With Quote
  #4  
Old March 2nd, 2010, 02:32 AM
phyrex1an's Avatar
phyrex1an phyrex1an is offline
Staff Member and irregular helper
 
Join Date: Mar 2005
Location: Sweden
Posts: 3,776
phyrex1an has disabled reputation
Quote:
Originally Posted by Lyerae View Post
What exactly does it parse into? O.o
A haskell data structure. Check src/Galaxy/SyntaxTree.hs. As such, this doesn't really do that much. Think of it as a library for more useful tools.

Quote:
Originally Posted by Jesus4Lyf View Post
Can we has [GALAXY] tagz nao?
They can has highlight native list.
This is not really related to a syntax highlighter but yeah, it is coming.
__________________
Reply With Quote
  #5  
Old March 2nd, 2010, 10:21 AM
phyrex1an's Avatar
phyrex1an phyrex1an is offline
Staff Member and irregular helper
 
Join Date: Mar 2005
Location: Sweden
Posts: 3,776
phyrex1an has disabled reputation
Parser has been updated based on j4l's array example.

@Jesus4Lyf: Have you tried to get the parser running? It should function as a poor syntax checker (with plenty of false positives/negatives and somewhat cryptic error messages). I guess that you don't get any error reporting from sc2 itself so it should be an improvement
__________________
Reply With Quote
  #6  
Old March 2nd, 2010, 04:46 PM
Jesus4Lyf Jesus4Lyf is offline
Good Idea™
 
Join Date: Jul 2007
Location: Australia
Posts: 3,857
Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)
Quote:
Originally Posted by phyrex1an View Post
@Jesus4Lyf: Have you tried to get the parser running? It should function as a poor syntax checker (with plenty of false positives/negatives and somewhat cryptic error messages). I guess that you don't get any error reporting from sc2 itself so it should be an improvement
I can't be stuffed trying to compile it. >.<' (ie. I can't double click it, so I'm not sure what to do. )
So far I'm just writing in Notepad++, importing into a map with Ladik's, then having it run in SC2 BETA, and seeing if it works...
Reply With Quote
  #7  
Old March 2nd, 2010, 05:29 PM
phyrex1an's Avatar
phyrex1an phyrex1an is offline
Staff Member and irregular helper
 
Join Date: Mar 2005
Location: Sweden
Posts: 3,776
phyrex1an has disabled reputation
Quote:
Originally Posted by Jesus4Lyf View Post
I can't be stuffed trying to compile it. >.<' (ie. I can't double click it, so I'm not sure what to do. )
Well, I'm partly to blame since I forgot to include the example implementation

Anyway, perhaps more noob friendly: http://phyrex1an.net/galaxy.php
__________________
Reply With Quote
  #8  
Old March 2nd, 2010, 06:33 PM
Jesus4Lyf Jesus4Lyf is offline
Good Idea™
 
Join Date: Jul 2007
Location: Australia
Posts: 3,857
Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)
Failed to parse this:
Jass:
//==================================================================================================
// 
// Generated Map Script
// 
// Name:   First TD
// Author: Jesus4Lyf
// 
//==================================================================================================
include "TriggerLibs/NativeLib"
//include "TriggerLibs/natives"

//--------------------------------------------------------------------------------------------------
// Library Initialization
//--------------------------------------------------------------------------------------------------
void InitLibs () {
    libNtve_InitLib();
}

//--------------------------------------------------------------------------------------------------
// Snippets
//--------------------------------------------------------------------------------------------------
unitgroup PlayerUnits(int player){
	return AIFindUnits(player,null,Point(0,0),500000,c_noMaxCount);
}


//--------------------------------------------------------------------------------------------------
// Trigger Variables
//--------------------------------------------------------------------------------------------------
trigger gt_MeleeInitialization;

void testFunc(){
	unitgroup GG=PlayerUnits(1);
	UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(IntToString(UnitGroupCount(GG,c_unitCountAll))));
}

/////
// Super cool
bool gt_OnChat_Func (bool testConds, bool runActions) {
	int i=32;
	
	testFunc();
	
//	while (i>0){
//		i-=1;
//		UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(IntToString(i)));
//		UIDisplayMessage(PlayerGroupAll(), 3, StringToText(IntToString(i)));
//		Wait(0,0);
//	}
	
	return true;
}

//--------------------------------------------------------------------------------------------------
// Trigger: Melee Initialization
//--------------------------------------------------------------------------------------------------
bool gt_MeleeInitialization_Func (bool testConds, bool runActions) {
    // Actions
    if (runActions) {
        MeleeInitResources();
        MeleeInitUnits();
        MeleeInitAI();
        MeleeInitOptions();
    }
	gt_OnChat_Func(false,false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void gt_MeleeInitialization_Init () {
    gt_MeleeInitialization = TriggerCreate("gt_MeleeInitialization_Func");
    TriggerAddEventMapInit(gt_MeleeInitialization);
	
	TriggerAddEventChatMessage(TriggerCreate("gt_OnChat_Func"), 1, "", false);
	TriggerAddEventChatMessage(TriggerCreate("gt_OnChat_Func"), 1, "", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger Initialization
//--------------------------------------------------------------------------------------------------
void InitTriggers () {
    gt_MeleeInitialization_Init();
}

//--------------------------------------------------------------------------------------------------
// Map Initialization
//--------------------------------------------------------------------------------------------------
void InitMap () {
    InitLibs();
    InitTriggers();
}
(Just some demo code I'm working on, mindlessly. It compiles in SC2 beta.)
Reply With Quote
  #9  
Old March 2nd, 2010, 06:45 PM
Renendaru's Avatar
Renendaru Renendaru is offline
Swish swish, back and forth.
 
Join Date: Jun 2008
Location: ?
Posts: 3,965
Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)
Galaxy looks really promising, hopefully it follows through at release. :s
__________________
------------------
ekjdslkfjslkdfjlskdfjksdkf
-------------------

[14:43] <Vestras> I hate fags and jews
Reply With Quote
  #10  
Old March 2nd, 2010, 08:53 PM
Jesus4Lyf Jesus4Lyf is offline
Good Idea™
 
Join Date: Jul 2007
Location: Australia
Posts: 3,857
Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)
Umm.
Jass:
typedef int[3] ArrType;
Works.
Jass:
void readattwo (ArrType ar){
	UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(IntToString(ar[2])));
}
Works.
Jass:
void readattwo (int[3] ar){
	UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(IntToString(ar[2])));
}
Works.
Jass:
void readattwo (int[] ar){
	UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(IntToString(ar[2])));
}
Does not work.
Jass:
ArrType someVar;
readattwo(someVar);
Does not work. o.O

So I think it's half implemented.

Edit:
Holy crap, this compiles:
Jass:
typedef int[3] ArrType;
void readattwo (ArrType* ar){
	//UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(IntToString(ar[2])));
}

>Galaxy looks really promising
Does now.

Edit: WINNER!
Figured out pointer syntax.
Jass:
typedef int[3] ArrType;
ArrType testArr;
void readattwo (ArrType* ar){
	UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(IntToString((*ar)[2])));
}
bool testthings (bool testConds, bool runActions) {
	ArrType* someVar = &testArr;
	testArr[2]=7;
	testArr[1]=9;
	testArr[0]=3;
	readattwo(someVar);
    return true;
}
Compiles. This is getting cooler and cooler.

Whee. I'm the first person to use array pointers in SC2 and post about it online...

Last edited by Jesus4Lyf; March 2nd, 2010 at 09:05 PM.
Reply With Quote
  #11  
Old March 2nd, 2010, 09:39 PM
Lyerae Lyerae is offline
Hai.
 
Join Date: May 2009
Posts: 1,882
Lyerae seems to have the helping tendency (+150)Lyerae seems to have the helping tendency (+150)
What are pointers in Galaxy? They can't be like C ones... Can they? O.o
Reply With Quote
  #12  
Old March 2nd, 2010, 09:57 PM
Jesus4Lyf Jesus4Lyf is offline
Good Idea™
 
Join Date: Jul 2007
Location: Australia
Posts: 3,857
Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)
Well that prints "7", so... yea..
Reply With Quote
  #13  
Old March 2nd, 2010, 10:12 PM
Renendaru's Avatar
Renendaru Renendaru is offline
Swish swish, back and forth.
 
Join Date: Jun 2008
Location: ?
Posts: 3,965
Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)
Ooo.. Maybe I should start playing around with this.
__________________
------------------
ekjdslkfjslkdfjlskdfjksdkf
-------------------

[14:43] <Vestras> I hate fags and jews
Reply With Quote
  #14  
Old March 2nd, 2010, 10:17 PM
Lyerae Lyerae is offline
Hai.
 
Join Date: May 2009
Posts: 1,882
Lyerae seems to have the helping tendency (+150)Lyerae seems to have the helping tendency (+150)
Quote:
Originally Posted by Jesus4Lyf View Post
Well that prints "7", so... yea..
Wait, your saying they ARE like in C?
Reply With Quote
  #15  
Old March 2nd, 2010, 10:30 PM
Jesus4Lyf Jesus4Lyf is offline
Good Idea™
 
Join Date: Jul 2007
Location: Australia
Posts: 3,857
Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)
WIN
Jass:
struct murder {
    string means;
    string time;
};
murder[128] pool;
void apply(murder* attempt, string target){
    UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(target+" has died at "+attempt->time+" by: "+attempt->means+"."));
}
bool testthings (bool testConds, bool runActions) {
    murder* how=&(pool[0]);
    how->time="midnight";
    how->means="axe to the fricking face";
    apply(how,"A young boy");
    return true;
}
Compiles. The first example of structs in Galaxy! Just took 5 hours or so of sitting here trial and erroring.

Now I have to say... the learning curve is huge for newbies. People are gonna struggle.. =/

>Wait, your saying they ARE like in C?
Yes.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:50 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.