Tool Galaxy parser

phyrex1an

Staff Member and irregular helper
Reaction score
447
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.

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.
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
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 :p
 

Jesus4Lyf

Good Idea™
Reaction score
397
@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 :p
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... :p
 

Jesus4Lyf

Good Idea™
Reaction score
397
Failed to parse this:
JASS:
//==================================================================================================
// 
// Generated Map Script
// 
// Name:   First TD
// Author: Jesus4Lyf
// 
//==================================================================================================
include &quot;TriggerLibs/NativeLib&quot;
//include &quot;TriggerLibs/natives&quot;

//--------------------------------------------------------------------------------------------------
// 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&gt;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(&quot;gt_MeleeInitialization_Func&quot;);
    TriggerAddEventMapInit(gt_MeleeInitialization);
	
	TriggerAddEventChatMessage(TriggerCreate(&quot;gt_OnChat_Func&quot;), 1, &quot;&quot;, false);
	TriggerAddEventChatMessage(TriggerCreate(&quot;gt_OnChat_Func&quot;), 1, &quot;&quot;, 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.)
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Galaxy looks really promising, hopefully it follows through at release. :s
 

Jesus4Lyf

Good Idea™
Reaction score
397
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])));
}

:D
>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 = &amp;testArr;
	testArr[2]=7;
	testArr[1]=9;
	testArr[0]=3;
	readattwo(someVar);
    return true;
}

Compiles. This is getting cooler and cooler. :D

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

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
What are pointers in Galaxy? They can't be like C ones... Can they? o_O
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Ooo.. Maybe I should start playing around with this.
 

Jesus4Lyf

Good Idea™
Reaction score
397
WIN
JASS:
struct murder {
    string means;
    string time;
};
murder[128] pool;
void apply(murder* attempt, string target){
    UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(target+&quot; has died at &quot;+attempt-&gt;time+&quot; by: &quot;+attempt-&gt;means+&quot;.&quot;));
}
bool testthings (bool testConds, bool runActions) {
    murder* how=&amp;(pool[0]);
    how-&gt;time=&quot;midnight&quot;;
    how-&gt;means=&quot;axe to the fricking face&quot;;
    apply(how,&quot;A young boy&quot;);
    return true;
}

Compiles. The first example of structs in Galaxy! Just took 5 hours or so of sitting here trial and erroring. :D

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.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Oh damn. I think we're going to have some fun with this.
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Jesus is the first coder. Watch he figures out bytecode all over again. That would be hilarious.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Jesus is the first coder. Watch he figures out bytecode all over again.
I'm already giving that a shot.
JASS:
int[128] byteCode;
bool testthings (bool testConds, bool runActions) {
    trigger t=TriggerCreate(&quot;byteCode&quot;);
    if (t!=null){
        UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(&quot;Problems.&quot;));
    }
    TriggerAddEventChatMessage(t, 1, &quot;&quot;, false);
    return true;
}

Amusingly enough, this spells problems. But it also throws a function not found error, so I'm not sure if something can be done with it..
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
How are you trying all this? Inserting the code into a map and running it?
 

Jesus4Lyf

Good Idea™
Reaction score
397
Inserting the code into a map and running it?
Yeah. Using Ladik's MPQ to import it into the galaxy mapscript of a map. It's kind of tedious... There's no syntax error messages, any syntax errors causes the entire script to be discarded. Actually, I found any XML errors cause the XML data files to be discarded, also, it seems...
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top