• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Tool] GalaxyParser

Status
Not open for further replies.
Level 16
Joined
Feb 22, 2006
Messages
960
(Hope it's the correct Forum, since no script/tool forum for sc2)

Hey guys,

I want to present a small project I'm working on, for all u guys who don't like working with the SC2 Script-Editor etc.

First I should present my plan:

It consists of 3 steps:

  • Step1: Programm a proper GalaxyParser (This is the step I'm currently working at)
  • Step2: Programm a properGalaxyXParser (GalaxyX is the custom language I'm working on, but priority is the GalaxyParser) http://userpage.fu-berlin.de/timoh1991/manual.html (Sorry, only my userpage provided by my university)
  • Step3: Releasing a all mighty Galaxy IDE (EditorX...the part where I assume to need help).
So since I'm at step 1, I can present to you the first version of the GalaxyParser (0.1.0)!



What the parser actually does:
  • SyntaxCheck/SemantikCheck
  • Includes the includes if wanted (see in How-To)
  • Information about allocated Memory

The whole thing is written in Java with the help of ANTLR (www.antlr.org).

FAQ:
How do I use the parser?
  • U need the current Java JRE to be able to run this programm.
  • use commandline: java -jar "path of parser" "path of galaxy file" "options"
  • current available options:
    -o doesn't close commandprompt instantly
    -i imports the includes (File-Directories are currently not supported)
  • be happy!

How can I help?

What else can I do?
  • If u have tipps/wishes, post them . I try to add them.


v0.3.0
- Added a new feature which informs the user about the total memory his script allocated (Used by Variables)
- If there is only 10% of memory left the parser will start throw a warning that the user is close to the limit

v0.2.1
- fixed a bug with the TreeParser (Struct variable types, couldn't be obtained when struct was saved in a an array)
- debug text polished for putting functions/variables into the HashMap

v0.2.0
- full type checking added
- debug stuff is now shown with "DEBUG:" prefix
- Parser now works slightly different: before it was like: lexer -> Parser -> Type checking
Now it's more like a real compiler: Lexer -> Parser -> AST -> TreeParser -> Type Checking
- the contained native galaxy files are slightly different then the original (only so that the parser has less to do, I've written a
small programm which cleans the lib_ntv file and the AI file... to get rid of function bodies and marking them as natives

v0.1.1
- added new parser option (-d for debug: parser shows some stuff ONLY PARSER DEBUG:
e.g. when a local variable or global is created (text in german))
- added first variable check (checks if a variable is allready defined, if so it throws an error.)
(DOES NOT CHECK IF A VARIABLE IS DEFINED, for variable assignment or expressions, this will be the next step in 0.1.2)
- due to variable check, performance dropped a bit, but still good :)...meh


v0.1.0

- first release
 

Attachments

  • GalaxyParser0.3.0.7z
    2 MB · Views: 61
Last edited:
Level 16
Joined
Feb 22, 2006
Messages
960
new version 0.2.0

v0.2.0
- full type checking added
- debug stuff is now shown with "DEBUG:" prefix
- Parser now works slightly different: before it was like: lexer -> Parser -> Type checking
Now it's more like a real compiler: Lexer -> Parser -> AST -> TreeParser -> Type Checking
- the contained native galaxy files are slightly different then the original (only so that the parser has less to do, I've written a
small programm which cleans the lib_ntv file and the AI file... to get rid of function bodies and marking them as natives
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Too bad you need to paste the script into the galaxy editor. That still limits you to 2 functions before the computational time needed exceedes a super computer due to bad highlighting code.

Unless you do some complex include thing which would affect maintainability.
 
Level 16
Joined
Feb 22, 2006
Messages
960
That's true. A solution could be generating a MapScript.galaxy file, which could replace the original.

At the moment the 'include' tag can be used for custom scripts, at least I hope so... didn't test it

Edit: Btw. the actual Agenda for GalaxyX can be found here: http://userpage.fu-berlin.de/timoh1991/manual.html (Sorry, only my userpage provided by my university)
 
Last edited:
Level 16
Joined
Feb 22, 2006
Messages
960
I wanted to track the memory allocated by global/local variables, but didn't thought about a warning :D

thanks for the tip

Edit: the limit for script was 2^21 bytes, but during the time they changed some stuff, so I don't really know the limit. Have to test it^^
 
Status
Not open for further replies.
Top