HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

About vJASS parser

03-13-2009, 04:13 PM#1
Belphegor666
This is directed to anyone who has any knowledge of parsers but its main focus is Vex. Reason this isn't a PM is because other might be very interested.
1. What did you do to make a vJASS parser? Did you use an existing parser like lex, jflex or did you made one yourself.
2. Does pJASS takes into consideration non-vJASS code, checking its validity or does it leave vJASS checking to regular JASS parser.
3. In what language was pJASS written?
03-13-2009, 04:39 PM#2
Zoxc
The compiler is called JassHelper, not vJass. PJASS which you seem to mix up with vJass is a syntax checker for JASS.

1. He made his own and used GOLD parser system for some parts in functions.
2. PJASS checks for valid JASS syntax. vJass-only syntax will be reported as errors. JassHelper only converts vJass parts into JASS.
3. PJASS was generated by Lex/Yacc and is in C. JassHelper is written in Delphi/Object Pascal.

I'm currently playing with some JASS syntax checker which I might expand to a vJass syntax checker. If you are interested you should drop by the wc3c IRC server.

There is some good online material about parsers and compilers. Here is a nice collection: http://www.freetechbooks.com/compile...ction-f14.html

I personally like Crenshaw's tutorials. They go straight to the point and you'll be able to make simple compilers after reading it. Assuming you don't get lost or something :)
You'll find them here: http://compilers.iecc.com/crenshaw/
03-13-2009, 06:34 PM#3
PipeDream
I've written lex/yacc style parsers for ocaml (ocamllex/ocamlyacc) and haskell (alex/happy). Lexing/parsing with lex/yacc parsers is equally painful in all languages, but doing the rest of the compiler stages goes 10x faster in a modern language.
03-17-2009, 06:13 PM#4
Belphegor666
Funny that you say that we had some classes with half built (we did some modificiations to existing scanner.l and yy.tab.c if I remember correctly; the stack, tables and other assembler generator functions were pre-made) lex/yacc parser in classes this semester and it was a piece of cake.

Anyway I was thinking taking JFlex and Cup/ByaccJ and toying around trying to do some language extension like vJASS. It would be a welcome excercise in case sc2 ever needs an extension.
03-25-2009, 09:59 PM#5
gekko
i already played with the thought of extending vJASS to use the damn friend keyword as I need it and Vex doesn't seem to like it...
03-27-2009, 04:19 PM#6
PitzerMike
PJass source code is available here by the way: http://www.wc3c.net/showthread.php?t=75239