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
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.
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
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
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
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,
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
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