This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: newbie : modifying C++ grammar


Suresh Shukla wrote:
I have downloaded and built gcc-core and gcc-g++ (both
4.1.1).


I am not able to locate the yacc file for C++. I want to experiment with some grammar changes.

All parsers in GCC, but the Java parser, are hand written. The C++ parser is in gcc/cp/parser.c and was rewritten for 3.4. It is a backtracking recursive-descent parser (Fortran is one too; C does not need backtracking). Though there are examples of C++ grammars written using Yacc, C++ and Fortran are so complex (and C comes close when you add OpenMP for example) that using Yacc only adds complexity.


Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]