Re: libcpp backtrack lexer

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

 



Ping ?

On Tue, Feb 25, 2014 at 12:55 AM, Prathamesh Kulkarni
<bilbotheelffriend@xxxxxxxxx> wrote:
> How do I backtrack the lexer to restart lexing from a particular token
> on the same
> line ?
> Shall this be correct: ?
> cpp_token *cur_token = pfile->cur_token;
> if (foo (pfile) == 0)  // foo advances pfile->cur_token
>   pfile->cur_token = cur_token; // restart lexing from cur_token
>
> foo does not advance pfile->cur_token beyond the same line, so I guess
> cur_token shall still be pointing to a valid token (since tokens on
> the same line are preserved) ?
>
> Thanks and Regards,
> Prathamesh




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux