Debian Codegraph @

documentation/manual/grammar/multiple.yo

raw
1 Most programs that use b() parse only one language and therefore only need one
2 b() parser. But what if you want to parse more than one language with the same
3 program? Since b() constructs a em(class) rather than a em(parsing function),
4 this problem can easily be solved: simply define your second (third, fourth,
5 ...) parser class, each having its own unique class-name, using the
6 tt(%class-name) directive, and construct parser objects of each of the defined
7 classes.
8
9 In multi-threaded programs each thread can create its own parser object, and
10 then call that object's tt(parse) function: b() does not use static data that
11 are modified by the generated parser. In multi-threaded programs, when the
12 parser uses polymorphic semantic values, the option tt(--thread-safe) or the
13 directive tt(%thread-safe) should be specified to ensure that the code
14 handling the polymorphic semantic data types accesses the error-counter data
15 member of their own parser object.
16