apaz-cli/pgen

Doesn't build because compilation errors

Closed this issue · 1 comments

Trying to build on Ubuntu 18.04 64bits I'm getting the output shown bellow (have you forgot to commit/push something ?):

./build
In file included from src/bootstrap.c:8:
src/tokparser.h: In function ‘tok_parse_num’:
src/tokparser.h:55:12: error: ‘bufsize’ undeclared (first use in this function)
   55 |   char ten[bufsize + 1];
      |            ^~~~~~~
src/tokparser.h:55:12: note: each undeclared identifier is reported only once for each function it appears in
src/tokparser.h:66:3: error: ‘errno’ undeclared (first use in this function)
   66 |   errno = 0;
      |   ^~~~~
src/tokparser.h:5:1: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
    4 | #include "pccast.h"
  +++ |+#include <errno.h>
    5 | 
src/tokparser.h:71:5: error: unknown type name ‘ptrdiff_t’
   71 |     ptrdiff_t diff = endptr - CURRENT();
      |     ^~~~~~~~~
src/tokparser.h:5:1: note: ‘ptrdiff_t’ is defined in header ‘<stddef.h>’; did you forget to ‘#include <stddef.h>’?
    4 | #include "pccast.h"
  +++ |+#include <stddef.h>
    5 | 
src/tokparser.h:71:22: warning: initialization of ‘int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
   71 |     ptrdiff_t diff = endptr - CURRENT();
      |                      ^~~~~~

It's not finished right now. Two days ago I came up with the language that describes the tokenizers. Right now I'm writing the parser for that language. After that I'll have to come up with the language for parsers and implement that too. Then comes symtab and code generation. Give it another month or two, and I should have something usable. That's the hope, anyway. Depends on how much time I have.

I don't know what your needs are. In the meantime though, if you're looking for a parser-generator that actually works, I would recommend packcc or antlr. I'm updating the readme with how pgen (will) differ from those options.