File: features.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 (37 lines) | stat: -rw-r--r-- 1,513 bytes parent folder | download | duplicates (5)
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
Here is an overview of special syntactic constructions that may be used
inside action blocks:
    itemization(
    itt($$) and tt($i) notations represent semantic values of the nonterminal
defined by production rules and semantic values of components of production
rules. Different `dollar-notations' are available for different types (single,
union, or polymorphic) of semantic values. Refer to section ref(ACTIONS) for a
complete description.

    itt(@@) and tt(@n): Usually these represent plain old data (a bf(C)-type
structure) containing information about line numbers and column numbers that
is associated with, respectively, the rule's nonterminal and the production
rule's n+sups(th) component. The default structure is defined like this (see
also section ref(LSPNEEDED)):
           verb(
    struct LTYPE_
    {
        int timestamp;
        int first_line;
        int first_column;
        int last_line;
        int last_column;
        char *text;
    };
           )
    Thus, to get the starting line number of the third component, you would
use tt(@3.first_line).

    In order for the members of this structure to contain valid information,
you must make sure the lexical scanner supplies this information about each
token. If you need only certain fields, then the lexical scanner 
only has to provide those fields. 

    Be advised that using this or corresponding (custom-defined, see sections
ref(LTYPE) and ref(LOCSTRUCT)) constructions may somewhat slow down the
parsing process.
    )