Files
bison/examples/c/reccalc
Paul Eggert ef3adfa0fb Update URLs to prefer https: to http:
Also, fix a few http: URLs that were no longer working.
2021-01-30 07:32:03 +01:00
..
2019-10-23 23:09:56 +02:00
2021-01-30 07:32:03 +01:00
2021-01-30 07:32:03 +01:00
2021-01-23 15:02:49 +01:00
2021-01-30 07:32:03 +01:00

reccalc - recursive calculator with Flex and Bison

In this example the generated parser is pure and reentrant: it can be used concurrently in different threads, or recursively. As a proof of this reentrancy, expressions in parenthesis are tokenized as strings, and then recursively parsed from the parser:

exp: STR
  {
    result r = parse_string ($1);
    free ($1);
    if (r.nerrs)
      {
        res->nerrs += r.nerrs;
        YYERROR;
      }
    else
      $$ = r.value;
  }