`parsergen` program built from the C code in this file can extract
that grammar directly from this file and process it.
-
###### File: parsergen.c
#include <unistd.h>
#include <stdlib.h>
return sl->ss;
}
-
### Setting `nullable`
We set `nullable` on the head symbol for any production for which all
so is word-like. If it can derive a NEWLINE, then we consider it to
be like a line.
-
Clearly the `TK_newline` token can derive a NEWLINE. Any symbol which
is the head of a production that contains a line_like symbol is also a
line-like symbol. We use a new field `line_like` to record this
Then the go to sets:
-
static void report_goto(struct grammar *g, struct symset gt)
{
int i;
return cnt;
}
-
## Generating the parser
The exported part of the parser is the `parse_XX` function, where the name
short min_prefix;
};
-
###### functions
static void gen_goto(FILE *f, struct grammar *g)