Re: bison for nlp

Akim Demaille <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>

> Le 8 nov. 2018 à 22:35, r0ller <[email protected]> a écrit :
> 
> Hi Hans,
> 
> Wow, I did not know that feature. Is such a  string only used when creating an error message?

It also becomes an alias in the grammar file itself.  For instance with

%token PLUS "+"

in addition to

exp: exp PLUS exp

you can also write

exp: exp "+" exp

which I find much clearer.  It's probably not helpful in your
case though.  I would also recommend that you have a look at the
documentation of api.token.prefix.

> Will the token still have an integer assigned that can be used in the actions or do I get there the string as well instead of an integer?

No, it’s an alias, they have a single number.

> By the way, I’ll still get the error message as a string I guess, right?

Yes.  Some day we will work on improving error message generation,
there is much demand.
_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.