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).

/misc.h (ef54031bc60da0c344d170761eeea9fc1903212a) (3485 bytes) (mode 100644) (type blob)

// Jass2 parser for bison/yacc
// by Rudi Cilibrasi
// Sun Jun  8 00:51:53 CEST 2003
// thanks to Jeff Pang for the handy documentation that this was based
// on at http://jass.sourceforge.net
// Released under the BSD license
#include <stdio.h>
#include <limits.h>
#include <stdarg.h>
#define YYDEBUG 1

#define BUFSIZE 8192
#define MAYBE 0
#define NO 1
#define YES 2

struct typenode {
  char *typename;
  const struct typenode *superclass;
};

struct typeandname {
  const struct typenode *ty;
  const char *name;
  int isarray, isconst, lineno, fn;
  struct typeandname *next;
};

struct paramlist {
  struct typeandname *head;
  struct typeandname **tail;
};

struct funcdecl {
  char *name;
  int isconst;
  struct paramlist *p;
  struct typenode *ret;
};

union node {
  char *str;
  int ival;
  struct typenode *ty;
  struct paramlist *pl;
  struct funcdecl *fd;
  struct typeandname *tan;
};

struct hashnode {
  char *name;
  void *val;
};

struct hashtable {
  size_t size;
  size_t count;
  struct hashnode *bucket;
};

void getsuggestions(const char*, char*, int, int, ...);
void *lookup(struct hashtable *h, const char *name);
void put(struct hashtable *h, const char *name, void *val);
void clear(struct hashtable *h);
void init();

struct typenode *newtypenode(const char *typename, const struct typenode *superclass);
struct paramlist *newparamlist();
struct typeandname *newtypeandname(const struct typenode *ty, const char *name);
struct typeandname *newtypeandnamewithreturn(const struct typenode *ty, const char *name, int retbool);
const struct typenode *getPrimitiveAncestor(const struct typenode *cur);
int isDerivedFrom(const struct typenode *cur, const struct typenode *base);
void addParam(struct paramlist *tl, struct typeandname *tan);
struct funcdecl *newfuncdecl();
void showfuncdecl(struct funcdecl *fd);
struct typenode *binop(const struct typenode *a, const struct typenode *b);
int canconvert(const struct typenode *from, const struct typenode *to, const int linemod);
int canconvertreturn(const struct typenode *from, const struct typenode *to, const int linemod);
struct typenode* mkretty(struct typenode *ty, int ret);
struct typenode* getTypePtr(struct typenode *ty);
getTypeTag(struct typenode *ty);
int typeeq(struct typenode*, struct typenode*);
struct typenode *combinetype(struct typenode *n1, struct typenode *n2);
void checkParameters(const struct paramlist *func, const struct paramlist *inp);
void validateGlobalAssignment(const char *varname);
void checkcomparisonsimple(const struct typenode *a);
	
extern int fno, lineno, totlines, islinebreak, isconstant, inblock, inconstant, infunction;
extern int haderrors;
extern int ignorederrors;
extern int didparse;
extern int inloop;
extern int strict;
extern int returnbug;
extern int afterendglobals;
extern char *yytext;
extern const char *curfile;
extern int yydebug;
int *showerrorlevel;
extern struct hashtable functions, globals, locals, params, types, initialized, *curtab;
extern struct typenode *gInteger, *gReal, *gBoolean, *gString, *gCode, *gHandle, *gNothing, *gNull, *gAny, *gNone, *gEmpty;
extern struct funcdecl *fCurrent;
extern struct typenode *retval;
const struct typeandname *getVariable(const char *varname);
void isnumeric(const struct typenode *ty);
void checkcomparison(const struct typenode *a, const struct typenode *b);
void checkeqtest(const struct typenode *a, const struct typenode *b);
void init(int argc, char **argv);
void doparse(int argc, char **argv);


Mode Type Size Ref File
100644 blob 730 d833c0c2ee6b5aa377f4f30d3e678d0fcac569ee Makefile
100644 blob 439 04f5f4c52ea3055fd29ddd78ff091326ee1b4177 Makefile.Whatever
100644 blob 564 2da1e0352a6d6e6f5a956f60424e1ee391131e98 Makefile.cygwin
100644 blob 26295 840e539734c7a1c8fc53ab443c6403557594d1f7 grammar.y
100644 blob 21911 e65a6917aa023d32e5e15dc1e6d0491bf04e3c89 misc.c
100644 blob 3485 ef54031bc60da0c344d170761eeea9fc1903212a misc.h
100644 blob 1302 13d65e05aca85cddd2f539b14d98cfbf1c622752 notes.txt
100644 blob 744 c8efdbf329d07cba0543a81c2aa696108bb97080 pjass.res
100644 blob 764 270df8583e78c80f366a8ab431fab673d89446d5 readme.txt
100644 blob 6387 22ec4a6f71e40e38ca426fc3db474636a1990061 token.l
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