• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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: 67
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
 
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