Re: Flex/Bison Scripts for C++

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

 



On 9 February 2017 at 15:56, Lakshay Garg wrote:
> Hello GCC
>
> I am taking a compilers course and trying to build a compiler for C++.
> I have been trying to find a reliable lex and yacc script (one which
> does not cause any conflicts) which I can build upon but haven't found
> anything yet. Could you please point me to a source where I can find
> these files.

You could try looking at an ancient version of GCC, version 3.3 or
older. Since version 3.4.0 GCC has used a hand-written C++ parser, not
one based on lex or yacc.

Obviously if you look at an ancient GCC then you'll only find
something that supports an ancient dialect of C++, and will have
several parsing bugs (that's one of the reasons GCC changed to a
hand-written parser).

Be aware that the C++ grammar contains ambiguities that can only be
resolved by rules that are not contained in the grammar.



[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