06.01.2015 Views

Manual

Manual

Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

114 Bison 2.3<br />

%token START_FOO START_BAR;<br />

%start start;<br />

start: START_FOO foo<br />

| START_BAR bar;<br />

These tokens prevents the introduction of new conflicts. As far as the parser goes, that<br />

is all that is needed.<br />

Now the difficult part is ensuring that the scanner will send these tokens first. If your<br />

scanner is hand-written, that should be straightforward. If your scanner is generated by<br />

Lex, them there is simple means to do it: recall that anything between ‘%{ ... %}’ after the<br />

first %% is copied verbatim in the top of the generated yylex function. Make sure a variable<br />

start_token is available in the scanner (e.g., a global variable or using %lex-param etc.),<br />

and use the following:<br />

/* Prologue. */<br />

%%<br />

%{<br />

if (start_token)<br />

{<br />

int t = start_token;<br />

start_token = 0;<br />

return t;<br />

}<br />

%}<br />

/* The rules. */<br />

11.6 Secure Conform<br />

Is Bison secure Does it conform to POSIX<br />

If you’re looking for a guarantee or certification, we don’t provide it. However, Bison is<br />

intended to be a reliable program that conforms to the POSIX specification for Yacc. If you<br />

run into problems, please send us a bug report.<br />

11.7 I can’t build Bison<br />

I can’t build Bison because make complains that<br />

msgfmt is not found.<br />

What should I do<br />

Like most GNU packages with internationalization support, that feature is turned<br />

on by default. If you have problems building in the ‘po’ subdirectory, it indicates<br />

that your system’s internationalization support is lacking. You can re-configure Bison<br />

with ‘--disable-nls’ to turn off this support, or you can install GNU gettext from<br />

ftp://ftp.gnu.org/gnu/gettext/ and re-configure Bison. See the file ‘ABOUT-NLS’ for<br />

more information.<br />

11.8 Where can I find help<br />

I’m having trouble using Bison. Where can I find help

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!