[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bison for nlp
From: |
r0ller |
Subject: |
Re: bison for nlp |
Date: |
Thu, 8 Nov 2018 22:35:28 +0100 (CET) |
Hi Hans,
Wow, I did not know that feature. Is such a string only used when creating an
error message? 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? By
the way, I'll still get the error message as a string I guess, right?
Best regards,
r0ller
-------- Eredeti levél --------
Feladó: Hans Åberg < address@hidden (Link -> mailto:address@hidden) >
Dátum: 2018 november 8 21:25:03
Tárgy: Re: bison for nlp
Címzett: r0ller < address@hidden (Link -> mailto:address@hidden) >
> On 8 Nov 2018, at 20:48, r0ller <address@hidden> wrote:
>
> Sorry, I don't really get it:( What do you mean by replacing tokens by
> strings? How can that be done?
Write
%token t_ENG_Adv "English adverb"
Then, in error message, the Bison parser will write "English adverb", and you
can also use it in the grammar instead of t_ENG_Adv.
> -------- Eredeti levél --------
> Feladó: Hans Åberg < address@hidden (Link -> mailto:address@hidden) >
> Dátum: 2018 november 8 14:28:03
> Tárgy: Re: bison for nlp
> Címzett: r0ller < address@hidden (Link -> mailto:address@hidden) >
>
> > On 7 Nov 2018, at 10:09, r0ller <address@hidden> wrote:
> >
> > Numbering tokens was introduced in the very beginning and has been
> > questioned by myself quite a many times if it's still needed. I didn't give
> > a hard try to get rid of it mainly due to one reason: I want to have an
> > error handling that tells in case of an error which symbols could be
> > accepted instead of the erroneous one just as bison itself does it but in a
> > structured way (as bison returns that info in an error message string).
> > Though, I could not come up with any better idea when it comes to remapping
> > a token to a symbol.
>
> If the token numbers are replaced by strings "…", the Bison parser will print
> those, and they can also be used in the grammar. Would that suffice?
>
- bison for nlp, r0ller, 2018/11/06
- Re: bison for nlp, Akim Demaille, 2018/11/07
- Re: bison for nlp, r0ller, 2018/11/07
- Re: bison for nlp, Hans Åberg, 2018/11/08
- Re: bison for nlp, r0ller, 2018/11/08
- Re: bison for nlp, Hans Åberg, 2018/11/08
- Re: bison for nlp,
r0ller <=
- Re: bison for nlp, Akim Demaille, 2018/11/08
- Re: bison for nlp, Hans Åberg, 2018/11/09
- Re: bison for nlp, Akim Demaille, 2018/11/09
- Re: bison for nlp, Hans Åberg, 2018/11/09
- improving error message (was: bison for nlp), Akim Demaille, 2018/11/10
- Re: improving error message (was: bison for nlp), Hans Åberg, 2018/11/10
- Re: improving error message (was: bison for nlp), Akim Demaille, 2018/11/10
- Re: improving error message, Hans Åberg, 2018/11/10
- Re: bison for nlp, Akim Demaille, 2018/11/09
- Re: bison for nlp, r0ller, 2018/11/12