X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=blobdiff_plain;f=csrc%2Fparsergen.mdc;h=94c29df1d2c7665f61903d413918d0cbee44e720;hp=a236f83b6843337058ad097612e94b4a52feb432;hb=5107f51f1ba2b12dbffef31403ebfea30688b96b;hpb=744a59663bace6a4d9db58ec97c4cf9aa24082a9 diff --git a/csrc/parsergen.mdc b/csrc/parsergen.mdc index a236f83..94c29df 100644 --- a/csrc/parsergen.mdc +++ b/csrc/parsergen.mdc @@ -21,7 +21,6 @@ There are several distinct sections. `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 #include @@ -839,7 +838,6 @@ array like the productions. return sl->ss; } - ### Setting `nullable` We set `nullable` on the head symbol for any production for which all @@ -890,7 +888,6 @@ If a symbol cannot derive a NEWLINE, then it is only part of a line - 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 @@ -1659,7 +1656,6 @@ The LA sets which are (possibly) reported with each item: Then the go to sets: - static void report_goto(struct grammar *g, struct symset gt) { int i; @@ -1857,7 +1853,6 @@ include newlines as token. return cnt; } - ## Generating the parser The exported part of the parser is the `parse_XX` function, where the name @@ -1960,7 +1955,6 @@ The go to table is stored in a simple array of `sym` and corresponding short min_prefix; }; - ###### functions static void gen_goto(FILE *f, struct grammar *g)