> On 25 Aug 2018, at 07:54, Akim Demaille <[email protected]> wrote:
>
>> Le 23 août 2018 à 14:24, Hans Åberg <[email protected]> a écrit :
>>
>> [The examples]
>> It might be good with a self-contained calc++ directory, with some input
>> files, so that one can copy it, and start experimenting. An idea might be to
>> add comments to the lexer, so that they can be added to the input files.
>> Nothing advanced, just a little more than what is now.
>
> I don’t understand what you mean with « add comments to the lexer,
> so that they can be added to the input files ».
>
> I’m not convinced that an input file would be needed, but a README
> in calc++/, with examples, would be useful, indeed.
>
> FTR, the scanner looks like this currently:
>
> <scanner.ll>
I was thinking of adding something like
"#".*\n { yylloc.lines(1); yylloc.step(); }
Then the example file could have comments like:
# Run calc++ <this file>
# Causes a deliberate error. Should report ...
The idea is that coming new to bison copies the calc++ directory, compiles it,
sees there are some example files to run, and ready to start experimenting.