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 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
*** empty log message *** c6a48acc98a4580e1dc9560b26b3adf579569319 cilibrar 2003-06-08 17:08:25
*** empty log message *** a9084c6a8897b38d209f2f3839ed9fd8c17a5eb4 cilibrar 2003-06-08 15:59:21
*** empty log message *** 594b07b664e8da134328e2099107f836c4783d22 cilibrar 2003-06-08 14:19:39
A makefile for cygwin. 7114936321546139b5512821e3d868b21c0b89f1 cilibrar 2003-06-08 10:38:31
Commit dcb319607e8bb35637f86918962610683ada2b08 - pjass 10h
Author: PitzerMike
Author date (UTC): 2007-09-13 23:49
Committer name: lep
Committer date (UTC): 2015-02-01 13:16
Parent(s): a5070a4d74abc627160481e592233fa26870d57a
Signer:
Signing key:
Signing status: N
Tree: d12e3c32e2f50b87ed80240919d55dd2bc7d610b
File Lines added Lines deleted
grammar.y 19 7
misc.c 10 3
misc.h 8 3
readme.txt 1 1
File grammar.y changed (mode: 100644) (index a196771..d443d63)
... ... int main(int argc, char **argv)
114 114 %token COMMA %token COMMA
115 115 %token AND %token AND
116 116 %token OR %token OR
117 %token NOT
118 %token COMMA
119 117 %token EQUALS %token EQUALS
120 118 %token TIMES %token TIMES
121 119 %token DIV %token DIV
 
... ... int main(int argc, char **argv)
135 133 %token INTLIT %token INTLIT
136 134 %token REALLIT %token REALLIT
137 135 %token UNITTYPEINT %token UNITTYPEINT
138 %token EQUALS
139 136
140 137 %right EQUALS %right EQUALS
141 138 %left AND OR %left AND OR
 
... ... expr: intexpr { $$.ty = gInteger; }
198 195 | realexpr { $$.ty = gReal; } | realexpr { $$.ty = gReal; }
199 196 | stringexpr { $$.ty = gString; } | stringexpr { $$.ty = gString; }
200 197 | boolexpr { $$.ty = gBoolean; } | boolexpr { $$.ty = gBoolean; }
201 | FUNCTION rid { if (lookup(&functions, $2.str) == NULL) {
198 | FUNCTION rid { struct funcdecl *fd = lookup(&functions, $2.str);
199 if (fd == NULL) {
202 200 char ebuf[1024]; char ebuf[1024];
203 201 sprintf(ebuf, "Undefined function %s", $2.str); sprintf(ebuf, "Undefined function %s", $2.str);
204 202 yyerrorex(3, ebuf); yyerrorex(3, ebuf);
203 $$.ty = gCode;
204 } else {
205 if (fd->p->head != NULL) {
206 char ebuf[1024];
207 sprintf(ebuf, "Function %s must not take any arguments when used as code", $2.str);
208 yyerrorex(3, ebuf);
209 }
210 if (fd->ret == gBoolean)
211 $$.ty = gCodeReturnsBoolean;
212 else
213 $$.ty = gCodeReturnsNoBoolean;
205 214 } }
206 $$.ty = gCode;
207 215 } }
208 216 | TNULL { $$.ty = gNull; } | TNULL { $$.ty = gNull; }
209 217 | expr LEQ expr { checkcomparison($1.ty, $3.ty); $$.ty = gBoolean; } | expr LEQ expr { checkcomparison($1.ty, $3.ty); $$.ty = gBoolean; }
 
... ... funccall: rid LPAREN exprlistcompl RPAREN {
285 293 sprintf(ebuf, "Call to non-constant function %s in constant function", $1.str); sprintf(ebuf, "Call to non-constant function %s in constant function", $1.str);
286 294 yyerrorex(3, ebuf); yyerrorex(3, ebuf);
287 295 } }
288 checkParameters(fd->p, $3.pl);
296 checkParameters(fd->p, $3.pl, (fd==fFilter || fd==fCondition));
289 297 $$.ty = fd->ret; $$.ty = fd->ret;
290 298 } }
291 299 } }
 
... ... funccall: rid LPAREN exprlistcompl RPAREN {
303 311 yyerrorex(3, ebuf); yyerrorex(3, ebuf);
304 312 $$.ty = gNull; $$.ty = gNull;
305 313 } else { } else {
306 checkParameters(fd->p, $3.pl);
314 checkParameters(fd->p, $3.pl, (fd==fFilter || fd==fCondition));
307 315 $$.ty = fd->ret; $$.ty = fd->ret;
308 316 } }
309 317 } }
 
... ... nativefuncdecl: NATIVE rid TAKES optparam_list RETURNS opttype
358 366 $$.fd->ret = $6.ty; $$.fd->ret = $6.ty;
359 367 //printf("***** %s = %s\n", $2.str, $$.fd->ret->typename); //printf("***** %s = %s\n", $2.str, $$.fd->ret->typename);
360 368 $$.fd->isconst = isconstant; $$.fd->isconst = isconstant;
369 if (strcmp($$.fd->name, "Filter") == 0)
370 fFilter = $$.fd;
371 if (strcmp($$.fd->name, "Condition") == 0)
372 fCondition = $$.fd;
361 373 put(&functions, $$.fd->name, $$.fd); put(&functions, $$.fd->name, $$.fd);
362 374 //showfuncdecl($$.fd); //showfuncdecl($$.fd);
363 375 } }
File misc.c changed (mode: 100644) (index 2f066ec..581850d)
11 11 #include "grammar.tab.h" #include "grammar.tab.h"
12 12 #include "misc.h" #include "misc.h"
13 13
14 #define VERSIONSTR "1.0g"
14 #define VERSIONSTR "1.0h"
15 15 #define ERRORLEVELNUM 4 #define ERRORLEVELNUM 4
16 16
17 17 int fno; int fno;
 
... ... struct hashtable functions, globals, locals, params, types;
34 34 struct hashtable *curtab; struct hashtable *curtab;
35 35 struct typenode *retval, *retcheck; struct typenode *retval, *retcheck;
36 36 char *curfile; char *curfile;
37 struct typenode *gInteger, *gReal, *gBoolean, *gString, *gCode, *gHandle, *gNothing, *gNull, *gAny, *gNone;
37 struct typenode *gInteger, *gReal, *gBoolean, *gString, *gCode, *gHandle, *gNothing, *gNull, *gAny, *gNone, *gCodeReturnsBoolean, *gCodeReturnsNoBoolean;
38 struct funcdecl *fFilter, *fCondition;
38 39
39 40 void addPrimitiveType(const char *name, struct typenode **toSave) void addPrimitiveType(const char *name, struct typenode **toSave)
40 41 { {
 
... ... void init(int argc, char **argv)
54 55 gNull = newtypenode("null", NULL); gNull = newtypenode("null", NULL);
55 56 gAny = newtypenode("any", NULL); gAny = newtypenode("any", NULL);
56 57 gNone = newtypenode("none", NULL); gNone = newtypenode("none", NULL);
58 gCodeReturnsBoolean = newtypenode("codereturnsboolean", gCode);
59 gCodeReturnsNoBoolean = newtypenode("codereturnsnoboolean", gCode);
57 60 curtab = &globals; curtab = &globals;
58 61 fno = 0; fno = 0;
59 62 strict = 0; strict = 0;
 
... ... struct typenode *combinetype(struct typenode *n1, struct typenode *n2) {
369 372 return gNone; return gNone;
370 373 } }
371 374
372 void checkParameters(const struct paramlist *func, const struct paramlist *inp)
375 void checkParameters(const struct paramlist *func, const struct paramlist *inp, const int mustretbool)
373 376 { {
374 377 const struct typeandname *fi = func->head; const struct typeandname *fi = func->head;
375 378 const struct typeandname *pi = inp->head; const struct typeandname *pi = inp->head;
 
... ... void checkParameters(const struct paramlist *func, const struct paramlist *inp)
386 389 return; return;
387 390 } }
388 391 canconvert(pi->ty, fi->ty, 0); canconvert(pi->ty, fi->ty, 0);
392 if (mustretbool && pi->ty != gCodeReturnsBoolean) {
393 yyerrorex(3, "Functions passed to Filter or Condition must return a boolean");
394 return;
395 }
389 396 pi = pi->next; pi = pi->next;
390 397 fi = fi->next; fi = fi->next;
391 398 } }
File misc.h changed (mode: 100644) (index 7cc4f38..95d8bb6)
8 8 #define YYDEBUG 1 #define YYDEBUG 1
9 9
10 10 #define BUFSIZE 8192 #define BUFSIZE 8192
11
11 #define MAYBE 0
12 #define NO 1
13 #define YES 2
12 14
13 15 struct typenode { struct typenode {
14 16 char *typename; char *typename;
17
15 18 const struct typenode *superclass; const struct typenode *superclass;
16 19 }; };
17 20
 
... ... void init();
63 66 struct typenode *newtypenode(const char *typename, const struct typenode *superclass); struct typenode *newtypenode(const char *typename, const struct typenode *superclass);
64 67 struct paramlist *newparamlist(); struct paramlist *newparamlist();
65 68 struct typeandname *newtypeandname(const struct typenode *ty, const char *name); struct typeandname *newtypeandname(const struct typenode *ty, const char *name);
69 struct typeandname *newtypeandnamewithreturn(const struct typenode *ty, const char *name, int retbool);
66 70 const struct typenode *getPrimitiveAncestor(const struct typenode *cur); const struct typenode *getPrimitiveAncestor(const struct typenode *cur);
67 71 int isDerivedFrom(const struct typenode *cur, const struct typenode *base); int isDerivedFrom(const struct typenode *cur, const struct typenode *base);
68 72 void addParam(struct paramlist *tl, struct typeandname *tan); void addParam(struct paramlist *tl, struct typeandname *tan);
 
... ... struct typenode *binop(const struct typenode *a, const struct typenode *b);
72 76 int canconvert(const struct typenode *from, const struct typenode *to, const int linemod); int canconvert(const struct typenode *from, const struct typenode *to, const int linemod);
73 77 int canconvertreturn(const struct typenode *from, const struct typenode *to, const int linemod); int canconvertreturn(const struct typenode *from, const struct typenode *to, const int linemod);
74 78 struct typenode *combinetype(struct typenode *n1, struct typenode *n2); struct typenode *combinetype(struct typenode *n1, struct typenode *n2);
75 void checkParameters(const struct paramlist *func, const struct paramlist *inp);
79 void checkParameters(const struct paramlist *func, const struct paramlist *inp, const int mustretbool);
76 80 void validateGlobalAssignment(const char *varname); void validateGlobalAssignment(const char *varname);
77 81 void checkcomparisonsimple(const struct typenode *a); void checkcomparisonsimple(const struct typenode *a);
78 82
 
... ... extern char *yytext, *curfile;
87 91 extern int yydebug; extern int yydebug;
88 92 int *showerrorlevel; int *showerrorlevel;
89 93 extern struct hashtable functions, globals, locals, params, types, *curtab; extern struct hashtable functions, globals, locals, params, types, *curtab;
90 extern struct typenode *gInteger, *gReal, *gBoolean, *gString, *gCode, *gHandle, *gNothing, *gNull, *gAny, *gNone;
94 extern struct typenode *gInteger, *gReal, *gBoolean, *gString, *gCode, *gHandle, *gNothing, *gNull, *gAny, *gNone, *gCodeReturnsBoolean, *gCodeReturnsNoBoolean;
95 extern struct funcdecl *fFilter, *fCondition;
91 96 extern struct typenode *retval; extern struct typenode *retval;
92 97 const struct typeandname *getVariable(const char *varname); const struct typeandname *getVariable(const char *varname);
93 98 void isnumeric(const struct typenode *ty); void isnumeric(const struct typenode *ty);
File readme.txt changed (mode: 100644) (index 85b935f..4b9d8ec)
1 pjass 17.01.2007 (v 1.0g)
1 pjass 14.09.2007 (v 1.0h)
2 2 A lightweight and fast Jass2 parser for bison/yacc A lightweight and fast Jass2 parser for bison/yacc
3 3 by Rudi Cilibrasi by Rudi Cilibrasi
4 4 Sun Jun 8 00:51:53 CEST 2003 Sun Jun 8 00:51:53 CEST 2003
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