HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Some JASS Tools

12-12-2009, 08:23 PM#1
Nestharus
Working on a variety of JASS tools-

Resource Manager-
Can connect to an online library of resources to make browsing online submitted things easy. Downloaded resources are stored in an encrypted library. The resources in the library can also be retrieved via the resource browser, making management of all your resources easy (so they aren't scattered across maps or aren't in a huge "resource" map as I like to call it). All resources you download are auto updated if they are out of data (kept to the latest version). Will feature filters for JASS language specific resources (JASS, vJASS, Zinc, cJASS).


Documentation Editor-
Write good documentation (API etc) for your resources. It will put JASS into colorful XHTML, hyperlink various pages, put it in something of a book format, and do other nifty things all in a WYSIWYG editor.


Better JASS Parser/Highlighter-
I'm not too thrilled with any JASS Parser atm... all of the forum parsers/highlighters fail and the one in WE NewGen fails. Well, I made one that actually works ><. It will be used for documentation editing and resource browsing : ).

Thus far, only mine has been able to parse this-
Collapse JASS:
/*hi//hihi//hi*//*/*hi*/hi

As you can see, the hi should be black =). I just learned of nesting comments, which all the jass forums seem to do... odd to me considering I'd never heard of that before. I know VS doesn't do it -.-.

The chomper portion of my parser splits that line into this-
/*hi//hihi//hi*/
/*/*hi*/
hi

Which is correct

My Parser is still in the works though (optimizing it). My parser is the first step to all of the above and all of the below : ).


Resource Editor-
Wouldn't it be cool if you could sort of have an editor for JASS spells? Or an editor for JASS units? Or a JASS framework? Or a JASS something ??

Well, that's what I'm attempting to do here ; ). You put in the parameters, extend upon it with custom code, and link up fields (text boxes, checkboxes, radio buttons etc) with the custom code in the background thus forming up an editor with objects like spells that can be extended on all the while forming the most optimal code for your map possible and making it GUI user friendly as well as super JASS expert friendly ^_^.




All of these editors are completely dynamic, so they work on any language with any setting. The parser is also completely dynamic, it's just working off of an ini file that happens to be the JASS language ^_^.


The ini file syntax is-

!!
Comment, end comment (this stuff is ignored, good for notes in the ini file)

^^T#
^^ refers to a new category
T refers to the type of category
# refers to whether the category stuff stays in the code or is taken out (if you want custom ini comments within your actual code, the ini comment !! doesn't go through the code).

>< refers to XHTML tags, or the formatting
Each category can have unlimited XHTML tags. When a new tag is introduced, the formatting of the stuff changes.
<strong></strong>
Everything is bold
<oblique></oblique>
Now the stuff is no longer bold, but italic

While you may have a category like functions, functions may be colored differently whether they are a native or an actual function, making this useful. I only personally see the need for four categories (possible 5) for the four different types of processing.


T so far includes-
>
To the end of the line, or //
+
Start to end, or strings and /* */
F
Filtered words (endloop can't have [a-z][A-Z]_[0-9] for example)
U
Unfiltered words (operators like +, -, =, and stuff like [, ], {, })

# is only-
0- keep out of code
1- keep in code

So far everything in the ini file is ofc a 1 ^_^, but you could have some private source only comments o-o.



So as you can see, the ini file can be suited to literally any language ^_-.



So... what's done in all of this thus far?
My chomper for JASS Parsing ^_^, but as I said I'm optimizing it : o. The ini file is also done and ofc ini file processing, otherwise my chomper wouldn't be working : P.

The language this is written in at the moment is PERL, but I'll be moving it over to c#. PERL version will be done within the next week or so I'm hoping and c# written tool set (remember works on all languages, but best suited for game design) will be released around June (going to be working on it in conjunction with an adv programming class ^^).



What have I learned thus far? language is as hard as a 600-700 level college class (class on compilers), making it about one of the hardest things you can do ><. I happen to agree that if you've never done it before, figuring out how to do it without even knowing wth people are talking about when they say tokens is insanity o-o. I happened to do the research after finishing all the chomping (which I learned from my research was the tokenizing, lol).


So apparently I'm doing everything right so far : ), but I've yet to see any actual code on examples of how to do proper parsing ^_^.


Also, the PERL version is going to be.. slow... It took a few seconds for it to parse 1000 of the nightmare line I showed above-
/*hi//hihi//hi*//*/*hi*/hi

That's it again : p.


I waited for about 5 minutes with 10k lines of that nightmare line and shut it down because I was tired of waiting. This is what I mean when I say I need to optimize the dern thing ><.

c# version will ofc be a LOAD faster ^_^. c# and PERL don't even compare in speed, well, they do, but we don't talk about it : ), well, we do, but still : p.



Oh... and I was thinking of making a full blown compiler, you know, language to language compiler or something along those lines so that it could be used in any scenario on any language with ofc as easy to use ini files as what i have atm (easier to use than the million XML tag files and ofc faster because of less tags).


Oh yea, so all these guys doing the compilers and what not, what they are doing is considered some of the hardest possible things to do in the world of programming ><. It's like the super advanced programming classes. Of course, harder would probably be a full blown AI which nobody has been able to do yet.... I happen to need one for a game I'm working on, so you can imagine what I'll make after I get all of this stuff done. If mine happens to be the first working full blown AI in the world, so be it ^_^.

But yea my point is, Vexorian, ADOLF, Artificial, Van Damm (or however you spell his name), PitzerMike, and so on have done a hell of a job so far : ). /clap, you guys all rock and you are doing what Master's Level and PhD college students work on for their major class projects : D. I don't think a lot of people realize that and I know I didn't realize it ^_^.
12-12-2009, 08:56 PM#2
TriggerHappy
If you don't like TESH, then use jEdit or something. But there is a better TESH out there which supports nested comments and multi-line strings.

And what's wrong thehelper's parser?
12-12-2009, 09:13 PM#3
Skater
Quote:
Originally Posted by Nestharus
Thus far, only mine has been able to parse this-
Collapse JASS:
/*hi//hihi//hi*//*/*hi*/hi

As you can see, the hi should be black =). I just learned of nesting comments, which all the jass forums seem to do... odd to me considering I'd never heard of that before. I know VS doesn't do it -.-.
Nono, /* are stacking.
You need as many closing as opening.

e: or did i missunderstood you? the text is a bit confusing.
12-12-2009, 09:44 PM#4
Nestharus
Quote:
Originally Posted by Skater
Nono, /* are stacking.
You need as many closing as opening.

e: or did i missunderstood you? the text is a bit confusing.


Quote:
I just learned of nesting comments, which all the jass forums seem to do... odd to me considering I'd never heard of that before. I know VS doesn't do it -.-.


Anyhow, I think I'm porting this into Haskell. The Perl version is just too slow for me : |... I'd do it in C, but I really don't want to ^_^


Nobody has commented on anything but the parser so far : \.

Also when look at nested comments, I'm not sure if I want to support them or not in this... me, coming from a C world, am not used to nested comments and have never had a need for them : \. People say there is a use for them, like commenting out a block of code with blocks of code inside of it commented out, then uncommenting out the full section and continuing to uncomment for debug reasons, so I don't know, we'll see : ).


Anyhow, the idea is that this parser easily works on any language with a very easy to use/simple ini file that only takes a second to learn and setup compared to your normal XML ini files.


Edit
Updated ini file. I'm still working at it ><-
Code:
!!
	ini tokenizer language
	
	This is a comment section
	
	^^ refers to processing
	It is followed by a type, arguments (), and a boolean. The type refers to what kind of process it is and the boolean refers to whether it goes into the output or not.
	^^T()B
	
	Group- Complete nesting, just organize it into a group using the container, like a function or a class
	No Nesting- Everything within is treated like a single tag that is the container, like a string or a line comment
	Strict Nesting- Only nest certain things, like some languages do nested comments 0/*1/*2*/1*/0. If strict, include further processing.
	Types are-
		<
			To the start of the line with option of group or not.
			^^<()
			^^<(0).
		>
			To end of line with option of group or not.
			^^>()
			^^>(0)
		+
			Start and end. No nesting-0, a strict nesting-1, group nesting-2.
			^^+()
			^^+(0)
			^^+(1(/*~~*/),("~~"))
		C
			Chars with possible filtered boundaries (regex). The char can be a set of chars or a single char.
			^^C()
			^^C([A-Z][a-z]_[0-9)
		
	Each process must have a type and a boolean as well as required arguments in () if any-
		^^>(0)1
		^^C([A-Z][a-z]_[0-9)1
		^^+(0)1
		
	All white space outside of characters is ignored-
				hello
				
	This white space would not be ignored-
	hello hello
	
	Formatting options start with ~~.
	
	To tell the processor where to place the text in the formatting, use another ~~
	
	^^+(0)1
		~~<strong>~~</strong>
		
	There must be at least one type of format and one type of process within the file or nothing will happen.
	
	Processes with 0 do not do any formatting.
	
	Formatting does not have to go below a process: it can go above it too.
	
	From here, things that are tokenized are put into one big long list. In the case the + process type, characters are done in pairs.
		"
		"
		/*
		*/
	
	Would change into this in the background-
		" "
		/* */
	
	The first character refers to the opening and the second character refers to the closing. Everything in between the characters are not processed
	as the actual token is everything from the start tag to the end tag (" ").
	
	Doing nest tokens within tokens is a possibility, but as of now I probably won't
!!
12-13-2009, 03:44 PM#5
midiway
Loved the idea of a widgetized interface to configure spells, how will you present it? embedded in WE or a separated editor? I could help you in this part since I'm working in a editor that could be adapted to it
12-13-2009, 07:35 PM#6
Nestharus
sep editor =)