Section 3.1.1 User's Manual Question on $code require

2022-06-18 Thread slipbits
I've included my understanding of a few sections in the Bison User's Manual. What I am confused about is whether the declarations in %code require { declarations } are included in both the header file, if %header is given, and the source file (basename.). The text in the User's Manual, pg. 50 s

Language Versions

2022-06-10 Thread slipbits
Could you specify the language version of the generated parser code? This will help in specifying the correct compiler to use for the generated parser source code and headers.

3.7.11 A Pure (Reentrant) Parser

2022-06-08 Thread slipbits
The first sentence reads "A /reentrant/ program is one which does not alter in the course of execution; in other words, it consists entirely of /pure/ (read-only) code. " Some points which confuse me: 1. "alters" what? The object is not mentioned. Did you mean that it does not alter non-loc

Questions on 3.4.6 Actions

2022-06-08 Thread slipbits
In 3.4.6 Actions the format of a name, as in RULE[name}, not mentioned nor is the scope of the name, nor any constraint. For purposes of this discussion we define EBNF tag as the RULE name. Am I correct in assuming that: 1. A EBNF tag is composed of alphabetic, numeric characters and a dash

Where is $$ defined?

2022-06-07 Thread slipbits
In 3.7.6 Performing Actions before Parsing and 3.7.7 Freeing Discarded Symbols, $$ is referenced. I can't find any definition of this. I do find definitions of other $$ constructs, but not of tag. I assume that 'tag' has the same meaning as in 3.7.5 Syntax of Symbol Declarations. In particula

Token Syntax is confusing

2022-06-07 Thread slipbits
In 3.7.5 Syntax of Symbol Declarations   %token tag? ( id number? string? )+ ( tag ( id number? string? )+ )*  // is legal A few points (minor I admit): 1. The meaning of '+', '?', '*' is given. The meaning of '|' is not (see %type definition). 2. No mention of the meaning of a line feed,

Issuesin document

2022-06-07 Thread slipbits
Section 3.4.8.1 stmt: "let" '(' var ')' { $$ = push_context (); declare_variable ($3); } stmt { $$ = $5; pop_context ($5); } Shouldn't $$ = $6 be $$ = $3?, same for 3.4.6.2 There is no formal description of the Bison syntax. Given: %tokenOR

Enhancement requiest

2022-06-07 Thread slipbits
In 3.3.3 Recursive Rules you say: "...you should always use left recursion, because it can parse a sequence of any number of elements with bounded stack space. Right recursion uses up space on the Bison stack in proportion to the number of elements in the sequence ..." In ANTLR (an LL(1) par