help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bison for nlp


From: Akim Demaille
Subject: Re: bison for nlp
Date: Fri, 9 Nov 2018 05:59:39 +0100


> Le 8 nov. 2018 à 22:35, r0ller <address@hidden> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]