[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Parse input string and input file with same buffer state
From: |
Hans Åberg |
Subject: |
Re: Parse input string and input file with same buffer state |
Date: |
Thu, 7 Dec 2017 20:47:25 +0100 |
> On 7 Dec 2017, at 18:59, Harsha Sharma <address@hidden> wrote:
>
> I'm looking for a way to parse input string and input file (pushing
> buffer state created with yy_scan_string to buffer state created with
> yy_create_buffer to parse input file). It either causes segmentation
> fault or parses either the string or the input file.
The string pointed to (in a lexer generated by Flex) must be copied before
passed on elsewhere, as it is just a pointer in a buffer, temporarily
null-terminated.