> On 23 Aug 2018, at 07:34, Akim Demaille <a...@lrde.epita.fr> wrote:
> 
>> Le 21 août 2018 à 10:46, Hans Åberg <haber...@telia.com> a écrit :
>> 
>> 
>>> On 19 Aug 2018, at 17:23, Akim Demaille <a...@lrde.epita.fr> wrote:
>>> 
>>>>> I would strongly suggest that you look at the examples/ in Bison, the C++
>>>>> calculator
>>>> 
>>>> I did look at it - this example scared me off c++ parsers :-(
>>> 
>>> Really???  Then I failed.  Can you be more specific?
>> 
>> I noticed: It does not have a Makefile, so one can’t just copy it and 
>> compile.
> 
> Why not adding one, indeed.
> 
>> The input file is broken.
> 
> You’ll have to be more specific, WFM.

It generates an error. You might have more than one, say error<k>.txt, and 
input<k>.txt.

>> And the location filename gets set to null.
> 
> Not clear enough, but elaborate.

The location you initialize in .yy is not the one the .ll uses, so it returns a 
location with filename set to null, which is then what is reported, that is 
nothing. I changed:

calc++.cc: make global
  extern calcxx_driver driver;

calc++-scanner.ll:
  calcxx_driver driver;

  // The location of the current token.
  static yy::location loc(&driver.file);



Reply via email to