File: multiple.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 (16 lines) | stat: -rw-r--r-- 961 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Most programs that use b() parse only one language and therefore only need one
b() parser. But what if you want to parse more than one language with the same
program? Since b() constructs a em(class) rather than a em(parsing function),
this problem can easily be solved: simply define your second (third, fourth,
...) parser class, each having its own unique class-name, using the
tt(%class-name) directive, and construct parser objects of each of the defined
classes.

In multi-threaded programs each thread can create its own parser object, and
then call that object's tt(parse) function: b() does not use static data that
are modified by the generated parser. In multi-threaded programs, when the
parser uses polymorphic semantic values, the option tt(--thread-safe) or the
directive tt(%thread-safe) should be specified to ensure that the code
handling the polymorphic semantic data types accesses the error-counter data
member of their own parser object.