help-bison
[Top][All Lists]
Advanced

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

Re: c++ bison, flex, having yylex return parser::symbol_type and take in


From: Akim Demaille
Subject: Re: c++ bison, flex, having yylex return parser::symbol_type and take in arguments (parser::semantic_type, parser::location_type)
Date: Sat, 8 May 2021 06:56:29 +0200

Hi Scott,

> Le 7 mai 2021 à 21:26, Scott Lorberbaum <ugascottl@gmail.com> a écrit :
> 
> [...]
> i've played around with having the param turned on and either full %param,
> or %lex %parse specific. I've turned on and off token.raw and
> token.constructor but it doesn't seem to work.
> the translate_ function still seems to want to accept an (int) from yylex
> but should it be used if api.token.raw is turned on? Maybe i'm thinking the
> translate_ function is used differently. Let me know if you need more code.
> Thank you in advance.

AFAICT, you did not exactly state what your problem is.  

The fact that yytranslate still exists with token.raw is not
(expected to be) a problem: its implementation is then trivial.

  inline
  parser::symbol_kind_type
  parser::yytranslate_ (int t)
  {
    return static_cast<symbol_kind_type> (t);
  }


Please show exactly your problem, for instance show the compiler
errors.  And if that's something relating to the communication
between the scanner and the parser, it would be most useful to
include (i) bits of your scanner where you actually return a token,
and (ii) details about "#define yylex compiler.lexer.yylex".

Cheers!


reply via email to

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