vrtc / pjass (public) (License: BSD) (since 2023-08-03) (hash sha1)
pjass is a free Jass scripting language parser. This repository is a fork of lep/pjass. The goal is to add Debian packaging. As of the time of this writing, it works for current stable, that is Debian 12 (bookworm).
List of commits:
Subject Hash Author Date (UTC)
pjass 10l 0c9161120896904b55b3cdd7b2f7430dd97f82e9 PitzerMike 2009-06-15 21:30:00
pjass 10k 43c1a8a167cdf2982af2c47056beeafcd1840537 Zoxc 2009-04-03 21:23:00
pjass 10j 16bbe625b7670a7affcf495e3370224c30582bca PitzerMike 2007-10-09 09:22:00
pjass 10i 1ecf3d1238619358a0aa9b1b919ed9ba97d36f84 PitzerMike 2007-09-29 11:57:00
pjass 10h dcb319607e8bb35637f86918962610683ada2b08 PitzerMike 2007-09-13 23:49:00
pjass 10g a5070a4d74abc627160481e592233fa26870d57a PitzerMike 2007-08-24 10:43:00
pjass 10f e6893a0480e2b1c9bb22f39a897a86e8d05123a6 PitzerMike 2007-04-28 08:26:00
Fake commit to cleanup the cvs-import of the pjass sourceforge repo. 7f2ea341ebf2ed939f99ec3b14403025446e25f5 lep 2017-01-11 14:07:30
Fixed some errors on Debian and removed some warnings. 28b8a48ff580cb1c06343b4f51194b9a18f0901c cilibrar 2004-08-15 07:15:22
Works under Linux, removed debug messages. 60be798cd6b6e8ad3432feecf3418c7d2662807f cilibrar 2004-08-15 07:10:44
*** empty log message *** e8d4118415a91b81e924c78fc26c9c48eddefd5f cilibrar 2004-08-15 07:07:53
Fixed -mno-cygwin option to work under just cygwin host_os 1190fdc75012f9b55c597cc46f9b1c814ca5b8c7 cilibrar 2004-08-15 07:06:56
More configuration guessing scripts. d738f380f0324e5ca4ecdde5b79af99e1a783f24 cilibrar 2004-08-15 07:03:34
More adjustments. 0e72fd7fb1af1faaea69beb731b3d675583c2d2f cilibrar 2004-08-15 07:02:02
Fixed options to compile under RedHat. 12c7b48712fcdd84a2b36ecd6f2d4979a19dc7be cilibrar 2004-08-15 06:38:26
Some boilerplate files. 3b14c4d0fd37d9b2d4ddd443a6f74a67793eb338 cilibrar 2004-08-15 06:19:21
Converted to autoconf, automake. 06b0d83604e6316c9e086af0ce08ac3f2d4e7b8a cilibrar 2004-08-15 06:13:25
*** empty log message *** 3a61644cba31faab849c60b0aaeba6e5ae6e0fbb cilibrar 2003-06-22 18:00:46
Fix error message for implicit redirection parameter. 547f94e18885bdb7d0a61908691268987ef03a0f cilibrar 2003-06-09 08:51:53
*** empty log message *** cef95bf6a7aec8b05ceaa325e0b7cafe0e0fb616 cilibrar 2003-06-08 22:13:41
Commit 0c9161120896904b55b3cdd7b2f7430dd97f82e9 - pjass 10l
Author: PitzerMike
Author date (UTC): 2009-06-15 21:30
Committer name: lep
Committer date (UTC): 2015-02-01 13:20
Parent(s): 43c1a8a167cdf2982af2c47056beeafcd1840537
Signer:
Signing key:
Signing status: N
Tree: 5bfef2700188293174434521028b265fe3e93c3f
File Lines added Lines deleted
Makefile 5 4
grammar.y 2 2
misc.c 39 23
misc.h 1 0
notes.txt 1 1
token.l 1 1
File Makefile changed (mode: 100644) (index 3bdeeba..bacb61f)
1 CC=C:\MinGW\bin\gcc.exe
2 RESHCK=D:\ResHacker\ResHacker.exe
1 CC=gcc.exe
2 RESHCK=ResHacker.exe
3 3
4 4 all: pjass all: pjass
5 5
 
... ... lex.yy.c: token.l
11 11 flex $< flex $<
12 12
13 13 grammar.tab.c: grammar.y grammar.tab.c: grammar.y
14 bison $<
14 bison -o grammar.tab.c $<
15 15
16 16 grammar.tab.h: grammar.y grammar.tab.h: grammar.y
17 bison -d $<
17 bison -d -o grammar.tab $<
18 18
19 19 %.o: %.c %.o: %.c
20 20 $(CC) $< -c $(CC) $< -c
 
... ... clean:
23 23 del grammar.tab.h del grammar.tab.h
24 24 del grammar.tab.c del grammar.tab.c
25 25 del lex.yy.c del lex.yy.c
26 del misc.o
26 27 del pjass.exe del pjass.exe
27 28
28 29 t: t:
File grammar.y changed (mode: 100644) (index cdb9431..4ca41af)
... ... funcdefn: NEWLINE
384 384 | statement { yyerrorex(0, "Statement outside of function"); } | statement { yyerrorex(0, "Statement outside of function"); }
385 385 ; ;
386 386
387 funcdefncore: funcbegin localblock codeblock funcend { if(retval != gNothing) { if ($3.ty == gAny || $3.ty == gNone) yyerrorline(1, lineno - 1, "Missing return"); else canconvertreturn($3.ty, retval, -1); } }
387 funcdefncore: funcbegin localblock codeblock funcend { if(retval != gNothing) { if ($3.ty == gAny || $3.ty == gNone) yyerrorline(1, lineno - 1, "Missing return"); else if (returnbug) canconvertreturn($3.ty, retval, -1); } }
388 388 | funcbegin localblock codeblock {yyerrorex(0, "Missing endfunction"); clear(&params); clear(&locals); curtab = &globals;} | funcbegin localblock codeblock {yyerrorex(0, "Missing endfunction"); clear(&params); clear(&locals); curtab = &globals;}
389 389 ; ;
390 390
 
... ... statement: NEWLINE {$$.ty = gAny;}
513 513 | loopstart NEWLINE codeblock loopend NEWLINE {$$.ty = $3.ty;} | loopstart NEWLINE codeblock loopend NEWLINE {$$.ty = $3.ty;}
514 514 | loopstart NEWLINE codeblock {$$.ty = $3.ty; yyerrorex(0, "Missing endloop");} | loopstart NEWLINE codeblock {$$.ty = $3.ty; yyerrorex(0, "Missing endloop");}
515 515 | EXITWHEN expr NEWLINE { canconvert($2.ty, gBoolean, -1); if (!inloop) yyerrorline(0, lineno - 1, "Exitwhen outside of loop"); $$.ty = gNone;} | EXITWHEN expr NEWLINE { canconvert($2.ty, gBoolean, -1); if (!inloop) yyerrorline(0, lineno - 1, "Exitwhen outside of loop"); $$.ty = gNone;}
516 | RETURN expr NEWLINE { $$.ty = $2.ty; if(retval == gNothing) yyerrorline(1, lineno - 1, "Cannot return value from function that returns nothing");}
516 | RETURN expr NEWLINE { $$.ty = $2.ty; if(retval == gNothing) yyerrorline(1, lineno - 1, "Cannot return value from function that returns nothing"); else if (!returnbug) canconvertreturn($2.ty, retval, 0); }
517 517 | RETURN NEWLINE { if (retval != gNothing) yyerrorline(1, lineno - 1, "Return nothing in function that should return value"); $$.ty = gNone;} | RETURN NEWLINE { if (retval != gNothing) yyerrorline(1, lineno - 1, "Return nothing in function that should return value"); $$.ty = gNone;}
518 518 | DEBUG statement {$$.ty = gNone;} | DEBUG statement {$$.ty = gNone;}
519 519 | IF expr THEN NEWLINE codeblock elsifseq elseseq {canconvert($2.ty, gBoolean, 0); $$.ty = combinetype($6.ty!=gAny?combinetype($5.ty, $6.ty):$5.ty, $7.ty); yyerrorex(0, "Missing endif");} | IF expr THEN NEWLINE codeblock elsifseq elseseq {canconvert($2.ty, gBoolean, 0); $$.ty = combinetype($6.ty!=gAny?combinetype($5.ty, $6.ty):$5.ty, $7.ty); yyerrorex(0, "Missing endif");}
File misc.c changed (mode: 100644) (index 88df964..2d95c67)
11 11 #include "grammar.tab.h" #include "grammar.tab.h"
12 12 #include "misc.h" #include "misc.h"
13 13
14 #define VERSIONSTR "1.0j"
14 #define VERSIONSTR "1.0l"
15 15 #define ERRORLEVELNUM 4 #define ERRORLEVELNUM 4
16 16
17 17 int fno; int fno;
 
... ... int isconstant;
24 24 int inconstant; int inconstant;
25 25 int inblock; int inblock;
26 26 int strict; int strict;
27 int returnbug;
27 28 int didparse; int didparse;
28 29 int inloop; int inloop;
29 30 int afterendglobals; int afterendglobals;
 
... ... void init(int argc, char **argv)
60 61 curtab = &globals; curtab = &globals;
61 62 fno = 0; fno = 0;
62 63 strict = 0; strict = 0;
64 returnbug = 0;
63 65 haderrors = 0; haderrors = 0;
64 66 ignorederrors = 0; ignorederrors = 0;
65 67 islinebreak = 1; islinebreak = 1;
 
... ... struct typenode *binop(const struct typenode *a, const struct typenode *b)
279 281 return gReal; return gReal;
280 282 } }
281 283
284 // this is used for reducing expressions in many places (if/exitwhen conditions, assignments etc.)
282 285 int canconvert(const struct typenode *ufrom, const struct typenode *uto, const int linemod) int canconvert(const struct typenode *ufrom, const struct typenode *uto, const int linemod)
283 286 { {
284 287 const struct typenode *from = ufrom, *to = uto; const struct typenode *from = ufrom, *to = uto;
285 288 char ebuf[1024]; char ebuf[1024];
286
287 if (from == NULL || to == NULL) return 0;
288 if (from == gAny || to == gAny) return 1;
289 if (from == NULL || to == NULL)
290 return 0;
291 if (from == gAny || to == gAny)
292 return 1;
289 293 if (isDerivedFrom(from, to)) if (isDerivedFrom(from, to))
290 294 return 1; return 1;
291 //bug allows downcasting erroneously
292 295 //if (isDerivedFrom(to, from)) //if (isDerivedFrom(to, from))
293 // return 1;
294 if (from->typename == NULL || to->typename == NULL) return 0;
295 if (from == gNone || to == gNone) return 0;
296 // return 1; // blizzard bug allows downcasting erroneously, we don't support this though
297 if (from->typename == NULL || to->typename == NULL)
298 return 0;
299 if (from == gNone || to == gNone)
300 return 0;
296 301 from = getPrimitiveAncestor(from); from = getPrimitiveAncestor(from);
297 302 to = getPrimitiveAncestor(to); to = getPrimitiveAncestor(to);
298 303 if ((from == gNull) && (to != gInteger) && (to != gReal) && (to != gBoolean)) if ((from == gNull) && (to != gInteger) && (to != gReal) && (to != gBoolean))
 
... ... int canconvert(const struct typenode *ufrom, const struct typenode *uto, const i
313 318 yyerrorline(3, lineno + linemod, ebuf); yyerrorline(3, lineno + linemod, ebuf);
314 319 } }
315 320
321 // this is used for return statements only
316 322 int canconvertreturn(const struct typenode *ufrom, const struct typenode *uto, const int linemod) int canconvertreturn(const struct typenode *ufrom, const struct typenode *uto, const int linemod)
317 323 { {
318 324 const struct typenode *from = ufrom, *to = uto; const struct typenode *from = ufrom, *to = uto;
319 325 char ebuf[1024]; char ebuf[1024];
320 if (from == NULL || to == NULL) return 0;
321 if (from == gAny || to == gAny) return 1;
326 if (from == NULL || to == NULL)
327 return 0; // garbage
328 if (from == gAny || to == gAny)
329 return 1; // we don't care
322 330 if (isDerivedFrom(from, to)) if (isDerivedFrom(from, to))
323 return 1;
324 /* Blizzard bug: allows downcasting erroneously */
325 /* TODO: get Blizzard to fix this in Blizzard.j and the language */
326 // if (isDerivedFrom(to, from))
327 // return 1;
328 if (from->typename == NULL || to->typename == NULL) return 0;
329 if (from == gNone || to == gNone) return 0;
331 return 1; // eg. from = unit, to = handle
332 //if (isDerivedFrom(to, from))
333 // return 1; // blizzard bug allows downcasting erroneously, we don't support this though
334 if (from->typename == NULL || to->typename == NULL)
335 return 0; // garbage
336 if (from == gNone || to == gNone)
337 return 0; // garbage
338
330 339 from = getPrimitiveAncestor(from); from = getPrimitiveAncestor(from);
331 340 to = getPrimitiveAncestor(to); to = getPrimitiveAncestor(to);
332
333 // can't return integer when it expects a real (added 9.5.2005)
334 341 if ((to == gReal) && (from == gInteger)) { if ((to == gReal) && (from == gInteger)) {
342 // can't return integer when it expects a real (added 9.5.2005)
335 343 sprintf(ebuf, "Cannot convert returned value from %s to %s", from->typename, to->typename); sprintf(ebuf, "Cannot convert returned value from %s to %s", from->typename, to->typename);
336 344 yyerrorline(1, lineno + linemod, ebuf); yyerrorline(1, lineno + linemod, ebuf);
337 345 return 0; return 0;
338 346 } }
339
340 // can't return null when it expects integer, real or boolean (added 9.5.2005)
341 347 if ((from == gNull) && (to != gInteger) && (to != gReal) && (to != gBoolean)) if ((from == gNull) && (to != gInteger) && (to != gReal) && (to != gBoolean))
342 return 1;
348 return 1; // can't return null when it expects integer, real or boolean (added 9.5.2005)
343 349
344 350 if (strict) { if (strict) {
345 351 if (isDerivedFrom(uto, ufrom)) if (isDerivedFrom(uto, ufrom))
 
... ... struct typenode *combinetype(struct typenode *n1, struct typenode *n2) {
369 375 return gReal; return gReal;
370 376 if ((n1 == gReal) && (n2 == gInteger)) if ((n1 == gReal) && (n2 == gInteger))
371 377 return gInteger; return gInteger;
372 // printf("Cannot convert %s to %s", n1->typename, n2->typename);
378 // printf("Cannot convert %s to %s", n1->typename, n2->typename);
373 379 return gNone; return gNone;
374 380 } }
375 381
 
... ... printf(
498 504 "pjass +e2 Undo Ignore of error level 2\n" "pjass +e2 Undo Ignore of error level 2\n"
499 505 "pjass +s Enable strict downcast evaluation\n" "pjass +s Enable strict downcast evaluation\n"
500 506 "pjass -s Disable strict downcast evaluation\n" "pjass -s Disable strict downcast evaluation\n"
507 "pjass +rb Enable returnbug\n"
508 "pjass -rb Disable returnbug\n"
501 509 "pjass - Read from standard input (may appear in a list)\n" "pjass - Read from standard input (may appear in a list)\n"
502 510 ); );
503 511 exit(0); exit(0);
 
... ... printf(
516 524 strict = 0; strict = 0;
517 525 continue; continue;
518 526 } }
527 if (strcmp(argv[i], "+rb") == 0) {
528 returnbug = 1;
529 continue;
530 }
531 if (strcmp(argv[i], "-rb") == 0) {
532 returnbug = 0;
533 continue;
534 }
519 535 if (argv[i][0] == '-' && argv[i][1] == 'e' && argv[i][2] >= '0' && argv[i][2] < ('0' + ERRORLEVELNUM)) { if (argv[i][0] == '-' && argv[i][1] == 'e' && argv[i][2] >= '0' && argv[i][2] < ('0' + ERRORLEVELNUM)) {
520 536 showerrorlevel[argv[i][2]-'0'] = 0; showerrorlevel[argv[i][2]-'0'] = 0;
521 537 continue; continue;
File misc.h changed (mode: 100644) (index e6ba873..deac46b)
... ... extern int ignorederrors;
86 86 extern int didparse; extern int didparse;
87 87 extern int inloop; extern int inloop;
88 88 extern int strict; extern int strict;
89 extern int returnbug;
89 90 extern int afterendglobals; extern int afterendglobals;
90 91 extern char *yytext, *curfile; extern char *yytext, *curfile;
91 92 extern int yydebug; extern int yydebug;
File notes.txt changed (mode: 100644) (index 5eb7b7a..13d65e0)
... ... If you're not compiling under Windows, remove the following line from the makefi
18 18
19 19 $(RESHCK) -addskip $@.exe, $@.exe, resource.res ,,, $(RESHCK) -addskip $@.exe, $@.exe, resource.res ,,,
20 20
21 Current version is 1.0e, defined in pjass.res.
21 Current version is 1.0l, defined in pjass.res.
22 22
23 23 Additionally UPX is used to pack the executable. You can get it here: Additionally UPX is used to pack the executable. You can get it here:
24 24
File token.l changed (mode: 100644) (index 1cd087f..fa9d943)
... ... UNITTYPEINT (['][\x01-\x26\x29-\x5B\x5D-\x7F]([\x01-\x26\x29-\x5B\x5D-\x7F][\x01
68 68
69 69 {DIGIT}*"."{DIGIT}* return REALLIT; {DIGIT}*"."{DIGIT}* return REALLIT;
70 70 "0"({OCTDIGIT}*("8"|"9"){OCTDIGIT}*)+ yyerrorline(3, lineno, "Invalid digit in octal integer notation"); return INTLIT; "0"({OCTDIGIT}*("8"|"9"){OCTDIGIT}*)+ yyerrorline(3, lineno, "Invalid digit in octal integer notation"); return INTLIT;
71 ({DIGIT}+)|(("0x"|"$"){HEXDIGIT}+) return INTLIT;
71 ({DIGIT}+)|(("0x"|"$"){HEXDIGIT}+) return INTLIT;
72 72
73 73 "if" if (!islinebreak) yyerrorline(3, lineno, "Missing linebreak before if"); islinebreak=0; return IF; "if" if (!islinebreak) yyerrorline(3, lineno, "Missing linebreak before if"); islinebreak=0; return IF;
74 74 "not" return NOT; "not" return NOT;
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/vrtc/pjass

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/vrtc/pjass

Clone this repository using git:
git clone git://git.rocketgit.com/user/vrtc/pjass

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main