File: intro.yo

package info (click to toggle)
bisonc%2B%2B 6.09.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,984 kB
  • sloc: cpp: 9,375; ansic: 1,505; fortran: 1,134; makefile: 1,062; sh: 526; yacc: 84; lex: 60
file content (54 lines) | stat: -rw-r--r-- 2,560 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
The declaration section of a grammar file defines the symbols used in
formulating the production rules and the data types of semantic values. See
section ref(SYMBOLS).

All token names (except for single-character literal tokens such as '+' and
'*') must be declared. If data types must be associated with semantic values
of symbols (see sections ref(SEMANTICS)) then those symbols must also be
declared.

By default the first rule in the rule section specifies the grammar's em(start
symbol). The tt(%start) directive can be used to specify another rule (see
section ref(LANGUAGES)).

This section covers all of b()'s declarations. Some have already been
mentioned, but several more are available. Some define how the grammar parses
its input (like tt(%left, %right)); other directives define, e.g., the name of
the parsing function, or the name(s) of the files b() generates.

In particular readers familiar with Bison (or Bison++) should read this
section thoroughly, since b()'s directives are more extensive and different
from the `declarations' offered by Bison, and the macros defined by Bison++.

Several directives expect file- or pathname arguments. File- or pathnames must
be provided on the same line as the directive itself, starting at the first
non-blank character after the directive. File- or pathnames may contain escape
sequences (e.g., if you must: use `tt(\ )' to include a blank in a filename),
and continue until encountering the next blank character. Alternatively, file-
or pathnames may be surrounded by double quotes (tt("...")) or pointed
brackets (tt(<...>)). Pointed brackets surrounding file- or path-names merely
function to delimit filenames. They do not refer to, e.g., bf(C++)'s include
path. No escape sequences are required for blanks within delimited file- or
path-names.

Directives accepting a `filename' do not accept path names, i.e., they cannot
contain directory separators (tt(/)); directives accepting a 'pathname' may
contain directory separators.


Sometimes directives have analogous command-line options. In those cases
command-line options take priority over directives.

Some directives may generate errors. This happens when a directive
conflicts with the contents of a file bic() cannot modify (e.g., a
parser class header file exists, but doesn't define a namespace, but a
tt(%namespace) directive was provided). 

To solve such errore the offending directive could be omitted, the existing
file could be removed, or the existing file could be hand-edited according to
the directive's specification.