This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
C parser modification & questions
- From: Nikola Ikonic <nikola dot ikonic at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 19 Jan 2010 16:15:02 +0100
- Subject: C parser modification & questions
Hello,
I am working on a modification of C parser and I need some help since
I am having difficulties understanding some issues (I am complete
newbie on GCC). Long story short, I am trying to add a new attribute
to function types (similar to "inline", for example). Let's say that
this new keyword is _Something.
So, my new parser should be able to parse c function declared/defined like this:
_Something int Function_Name(unsigned a, int b);
Of course, I need to add new keyword "_Something", but that is the easiest part.
I am having difficulties understanding c-parser.c code. I tried to
debug cc1 (c-parser.c file) to see where the function declarator is
parsed (I used simple code which has main() and Hi_World() functions).
I have several questions about debugging:
1. Which part of code parses "Hi_World" string?
2. How can I see the tree which contains "Hi_World" string (during debugging)?
3. Which part of code parses parameters of "Hi_World"? (In general,
which part of code parses function parameters)
4. If Hi_World has parameters a and b, how can I see the tree nodes
which contain values/names of these parameters?
(As it's obvious I have problem understanding/viewing data during
debugging parser).
5. In which part of code I need to add parsing of my new reserved word
_Something?
I would be very grateful if someone could answer any of these
questions. Thank you in advance!
Best regards,
Nikola