• 🏆 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!

How does the jasshelper work

Status
Not open for further replies.

Deleted member 219079

D

Deleted member 219079

What jasshelper actually does how did Vexorian make his own syntax. Could anybody do his own syntax if so what tools you'd need.
 
Level 23
Joined
Jan 1, 2009
Messages
1,608
Basically it's made out of a parser(with lexer) and then the translation to vanilla Jass.

JassHelper uses a very old version of the http://goldparser.org/ for pascal.

You can look into the source yourself, I would suggest cohadar's one tho, since in the original, the whole code is in one big file.

You could theoretically change the syntax slightly (based on vJass or ZinC) or just do it from scratch like here http://www.hiveworkshop.com/forums/...e-wurstscript-wurst-jass-compiler-ide-238522/

The inner workings of JassHelper are mostly search&replace in many different compilerphases.
Structs in vJass are simple integers from 1-8191 that are used as index when referring to a struct.
e.g.
JASS:
struct actor
    unit u
// Becomes:
unit array actor_u
// And
RemoveUnit(myStruct.u)
// Becomes:
RemoveUnit(actor_u[(int)myStruct])

When allocating a structinstance a free id is taken, e.g. from a Stack of free Ids.
When you destroy an instance, the id is put pack onto the stack and can be reused.

Due to the array-limit of 8191 possible indices you can have a maximum of 8190 instances at once (0 being equal no no instance or null) with using only one array.
 

Deleted member 219079

D

Deleted member 219079

Ah your wurstscript is made from scratch, cool!

Did you make in eclipse or what?
 

Deleted member 219079

D

Deleted member 219079

I tried to google JDT Eclipse and there was a bunch of nerd stuff but no download link.

...So I have no idea how I can download and use JDT Eclipse, but it sounds cool, is there any tutorials?
 
Level 23
Joined
Jan 1, 2009
Messages
1,608
First Google-links leads to a big DownloadButton:
ccRSc59.png

ZSLVR7E.png


JDT is just the Java Version of Eclipse

Java is a programming language based on the JavaVM
http://www.oracle.com/technetwork/java/javase/downloads/index.html?ssSourceSiteId=otnjp
 

Deleted member 219079

D

Deleted member 219079

Got it downloading, thanks.

Can eclipse compile stuff I make with it also?
 
Last edited by a moderator:

Deleted member 219079

D

Deleted member 219079

Another Wurst follower :"D

I like vJass. To be honest the indentation based syntax is not for me. But wurst is still nice project :)
 
Level 15
Joined
Aug 7, 2013
Messages
1,337
OP said:
Could anybody do his own syntax if so what tools you'd need.

Frotty said:
The inner workings of JassHelper are mostly search&replace in many different compilerphases.

If you have JASS / vJASS files managed like an actual project (multiple .j files), you can add in your own pre-compiler phases with your favorite scripting language.

Frotty said:
Luckily python is on the rise as beginner language

They use Java at my alma mater. Python is relegated to the NLP / computational linguistics courses, I believe because of NLTK (the Natural Language Toolkit), which is an amazing library written in Python, and also who wants to write a machine learning script or text processor in Java?

I use Python for adding additional keywords or syntax to vJASS. A Python script combs over all the files and basically does a search + replace. Relatively it's slow, though unless you have hundreds of files it shouldn't be that big of a problem.

This only works if you can write a script to process text files and you are not willing to modify the source of jasshelper and/or use Wurst. This would be the way to go if you don't have much of a background in programming / compiler theory / programming language theory, like me.
 
Status
Not open for further replies.
Top