public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Alexandre E. Kopilovitch" <aek@vib.usr.pu.ru>
To: gcc@gcc.gnu.org
Cc: goli@lucent.com, goli@optonline.net
Subject: Re: using GCC internal tree representation.
Date: Thu, 06 Dec 2001 06:57:00 -0000	[thread overview]
Message-ID: <Pnu7u3yugA@vib.usr.pu.ru> (raw)

>I am planning to use the gcc to parse my initial file and later walk through the
>internal TREE to dump the output as I need.
>
>I looked at the GCC  manual (TREEs usage), but I am not quite sure how can I
>get access to the internal TREE from my own program any pointers in this regard
>will be appreciated.

If you can build GCC 3.0 then it is quite simple to get access to the tree.
Put the following lines into your module:

void your_program(tree t);
void (*back_end_hook) PARAMS ((tree)) = &your_program;

That your_program starts after the GCC parse phase is completed. GCC calls
your_program automatically as back_end_hook function (from cp/decl2.c/finish_file
function) and passes the syntax tree root to it. No change in the GCC is needed
for the call (linking of that module is sufficient).
  It works for GCC 3.0, but I didn't look into GCC 3.0.1 and 3.0.2 .


Alexander Kopilovitch                      aek@vib.usr.pu.ru
Saint-Petersburg
Russia



             reply	other threads:[~2001-12-06 14:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-06  6:57 Alexandre E. Kopilovitch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-12-06  6:07 using GCC internal TREE representation Sri Sairam Goli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pnu7u3yugA@vib.usr.pu.ru \
    --to=aek@vib.usr.pu.ru \
    --cc=gcc@gcc.gnu.org \
    --cc=goli@lucent.com \
    --cc=goli@optonline.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).