public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Newbie to creating front ends to gcc
@ 2001-07-15 14:23 David Henningsson
  2001-07-16  3:40 ` Fergus Henderson
  0 siblings, 1 reply; 5+ messages in thread
From: David Henningsson @ 2001-07-15 14:23 UTC (permalink / raw)
  To: gcc

Right now I'm trying to understand that tree code.

I think I need a simple example of how to create a tree. How would I eg
create tree for this function?

int foofunc(int x)
{
  return 7+x-atoi("54"); 
}

something like:

int
yyparse(YYPARSE_PARAM_ARG)
     YYPARSE_PARAM_DECL
{
  tree Tfuncname = get_identifier('foofunc'); /* Is this symbol exported
now? */
	
  tree Tconstant7 = build_int_2(7,0);
  tree Tfuncres = makenode(INTEGER_TYPE);
  tree Tassign build1(MODIFY_EXPR, TFuncres, Tconstant7);
  tree Tfunction = build(FUNCTION_DECL);
  /* etc */
}

..well, that was as far as I came. And that is probably wrong. Could
someone please point me in the right direction?

(The final version of my program will of course parse a file...but I'm
not that far yet.)

I'm running GCC 2.95.3 at the moment as that is what goes with DJGPP.

Thanks in advance for your help!

// David

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Newbie to creating front ends to gcc
  2001-07-15 14:23 Newbie to creating front ends to gcc David Henningsson
@ 2001-07-16  3:40 ` Fergus Henderson
  2001-07-16 15:08   ` Newbie to creating front ends to gcc (and now also: trying to build gcc 3.0 under DJGPP) David Henningsson
  0 siblings, 1 reply; 5+ messages in thread
From: Fergus Henderson @ 2001-07-16  3:40 UTC (permalink / raw)
  To: David Henningsson; +Cc: gcc

On 15-Jul-2001, David Henningsson <a@davidh.df.lth.se> wrote:
> Right now I'm trying to understand that tree code.
> 
> I think I need a simple example of how to create a tree.

See < http://gcc.gnu.org/readings.html >,
in particular "Example and Toy compilers for current snapshot".

See also the "Writing a Compiler Front End" chapter of
"Using, Maintaining and Enhancing COBOL for the GNU Compiler
Collection (GCC)".

> I'm running GCC 2.95.3 at the moment as that is what goes with DJGPP.

That is quite out-of-date with respect to current sources, unfortunately.
To save yourself effort, I'd strongly recommend using GCC 3.0 or a recent
development snapshot.

If you're stuck with using Windows, that may make things a little more
difficult.  I don't know whether 3.0 or recent development snapshots
work with DJGPP, but I think they probably do work with Cygwin.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: < http://www.cs.mu.oz.au/~fjh >  |     -- the last words of T. S. Garp.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Newbie to creating front ends to gcc (and now also: trying to build gcc 3.0 under DJGPP)
  2001-07-16  3:40 ` Fergus Henderson
@ 2001-07-16 15:08   ` David Henningsson
  2001-07-17  9:22     ` Laurynas Biveinis
  2001-07-17 10:59     ` Newbie to creating front ends to gcc (and now also: trying tobuild " Andris Pavenis
  0 siblings, 2 replies; 5+ messages in thread
From: David Henningsson @ 2001-07-16 15:08 UTC (permalink / raw)
  To: Fergus Henderson; +Cc: gcc

> > Right now I'm trying to understand that tree code.
> >
> > I think I need a simple example of how to create a tree.
> See < http://gcc.gnu.org/readings.html >,
> in particular "Example and Toy compilers for current snapshot".

That one was a broken link...
 
> See also the "Writing a Compiler Front End" chapter of
> "Using, Maintaining and Enhancing COBOL for the GNU Compiler
> Collection (GCC)".

However, this seems very interesting. Thank you!
 
> > I'm running GCC 2.95.3 at the moment as that is what goes with DJGPP. 
> That is quite out-of-date with respect to current sources, unfortunately.
> To save yourself effort, I'd strongly recommend using GCC 3.0 or a recent
> development snapshot.

Maybe that will solve the "too many lines" debugging problem as well? 

> If you're stuck with using Windows, that may make things a little more
> difficult.  I don't know whether 3.0 or recent development snapshots
> work with DJGPP, but I think they probably do work with Cygwin.

Well, if they don't, someone should fix it, right? :) So I gave it a
try. Maybe we can solve this together... 

1) I copied the files to d:/Program/djgpp/gnu/gcc-3.0/. There is already
an installation of DJGPP in d:/program/djgpp. I picked them all from
www.djgpp.com 
2) I created the directory d:/program/djgpp/build, whereto I copied
djbuild.sh and djmake.sh from the gcc-2.953/build.djg directory.
3) I ran djbuild.sh. 
  During configure, I noticed this message:
"configure: warning: No program for building catalogs found -> building
disabled", however the configuration seemed to continue properly. (I
checked the script and it happened because both $MSGFMT and $GMSGFMT
were "msgfmt", but there was no explanation in the script of what
"msgfmt" is, so I gave up there.)
4) I ran djmake.sh. This is a screen dump of its last output:

make.exe[2]: Entering directory
`d:/Program/djgpp/gnu/gcc-3.0/build/gcc/intl'
\gcc -c -DIN_GCC -DLOCALEDIR=\"d:/program/djgpp/share/locale\"
-DGNULOCALEDIR=\"
d:/program/djgpp/share/locale\"
-DLOCALE_ALIAS_PATH=\"d:/program/djgpp/share/loc
ale:.\" -DHAVE_CONFIG_H -I.. -I. -I/Program/djgpp/gnu/gcc-3.0/gcc/intl
-I/Progra
m/djgpp/gnu/gcc-3.0/gcc/lib -I/Program/djgpp/gnu/gcc-3.0/gcc/intl/..
-I/Program/
djgpp/gnu/gcc-3.0/gcc/intl/../config
-I/Program/djgpp/gnu/gcc-3.0/gcc/intl/../..
/include  -g -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -
Wtraditional -pedantic -Wno-long-long 
/Program/djgpp/gnu/gcc-3.0/gcc/intl/intl-
compat.c
make.exe[2]: *** [intl-compat.o] Error -1
make.exe[2]: Leaving directory
`d:/Program/djgpp/gnu/gcc-3.0/build/gcc/intl'
make.exe[1]: *** [intl.all] Error 1
make.exe[1]: Leaving directory `d:/Program/djgpp/gnu/gcc-3.0/build/gcc'
make.exe: *** [all-gcc] Error 2
bash-2.04$

Do you have any idea of how I should continue?

// David

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Newbie to creating front ends to gcc (and now also: trying to build gcc 3.0 under DJGPP)
  2001-07-16 15:08   ` Newbie to creating front ends to gcc (and now also: trying to build gcc 3.0 under DJGPP) David Henningsson
@ 2001-07-17  9:22     ` Laurynas Biveinis
  2001-07-17 10:59     ` Newbie to creating front ends to gcc (and now also: trying tobuild " Andris Pavenis
  1 sibling, 0 replies; 5+ messages in thread
From: Laurynas Biveinis @ 2001-07-17  9:22 UTC (permalink / raw)
  To: David Henningsson; +Cc: Fergus Henderson, gcc

> > > I'm running GCC 2.95.3 at the moment as that is what goes with DJGPP. 
> > That is quite out-of-date with respect to current sources, unfortunately.
> > To save yourself effort, I'd strongly recommend using GCC 3.0 or a recent
> > development snapshot.
> 
> Maybe that will solve the "too many lines" debugging problem as well? 

You can solve it with 2.95 too, just use -gstabs instead of -g.

> > If you're stuck with using Windows, that may make things a little more
> > difficult.  I don't know whether 3.0 or recent development snapshots
> > work with DJGPP, but I think they probably do work with Cygwin.
> 
> Well, if they don't, someone should fix it, right? :) So I gave it a
> try. Maybe we can solve this together... 

[...]

You can save a great deal of time if you use a ready-made DJGPP source
distribution for 3.0. Get it from simtel, v2gnu/alphas/gcc30s.zip

Laurynas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Newbie to creating front ends to gcc (and now also: trying tobuild  gcc 3.0 under DJGPP)
  2001-07-16 15:08   ` Newbie to creating front ends to gcc (and now also: trying to build gcc 3.0 under DJGPP) David Henningsson
  2001-07-17  9:22     ` Laurynas Biveinis
@ 2001-07-17 10:59     ` Andris Pavenis
  1 sibling, 0 replies; 5+ messages in thread
From: Andris Pavenis @ 2001-07-17 10:59 UTC (permalink / raw)
  To: David Henningsson; +Cc: Fergus Henderson, gcc

I suggest getting files from directory v2gnu/alphas in DJGPP distribution.
Port of gcc-3.0 for DJGPP is there.

Andris


On Tue, 17 Jul 2001, David Henningsson wrote:

> 1) I copied the files to d:/Program/djgpp/gnu/gcc-3.0/. There is already
> an installation of DJGPP in d:/program/djgpp. I picked them all from
> www.djgpp.com
> 2) I created the directory d:/program/djgpp/build, whereto I copied
> djbuild.sh and djmake.sh from the gcc-2.953/build.djg directory.
> 3) I ran djbuild.sh.
>   During configure, I noticed this message:
> "configure: warning: No program for building catalogs found -> building
> disabled", however the configuration seemed to continue properly. (I
> checked the script and it happened because both $MSGFMT and $GMSGFMT
> were "msgfmt", but there was no explanation in the script of what
> "msgfmt" is, so I gave up there.)
> 4) I ran djmake.sh. This is a screen dump of its last output:
>
> make.exe[2]: Entering directory
> `d:/Program/djgpp/gnu/gcc-3.0/build/gcc/intl'
> \gcc -c -DIN_GCC -DLOCALEDIR=\"d:/program/djgpp/share/locale\"
> -DGNULOCALEDIR=\"
> d:/program/djgpp/share/locale\"
> -DLOCALE_ALIAS_PATH=\"d:/program/djgpp/share/loc
> ale:.\" -DHAVE_CONFIG_H -I.. -I. -I/Program/djgpp/gnu/gcc-3.0/gcc/intl
> -I/Progra
> m/djgpp/gnu/gcc-3.0/gcc/lib -I/Program/djgpp/gnu/gcc-3.0/gcc/intl/..
> -I/Program/
> djgpp/gnu/gcc-3.0/gcc/intl/../config
> -I/Program/djgpp/gnu/gcc-3.0/gcc/intl/../..
> /include  -g -W -Wall -Wwrite-strings -Wstrict-prototypes
> -Wmissing-prototypes -
> Wtraditional -pedantic -Wno-long-long
> /Program/djgpp/gnu/gcc-3.0/gcc/intl/intl-
> compat.c
> make.exe[2]: *** [intl-compat.o] Error -1
> make.exe[2]: Leaving directory
> `d:/Program/djgpp/gnu/gcc-3.0/build/gcc/intl'
> make.exe[1]: *** [intl.all] Error 1
> make.exe[1]: Leaving directory `d:/Program/djgpp/gnu/gcc-3.0/build/gcc'
> make.exe: *** [all-gcc] Error 2
> bash-2.04$
>
> Do you have any idea of how I should continue?
>
> // David
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-07-17 10:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-15 14:23 Newbie to creating front ends to gcc David Henningsson
2001-07-16  3:40 ` Fergus Henderson
2001-07-16 15:08   ` Newbie to creating front ends to gcc (and now also: trying to build gcc 3.0 under DJGPP) David Henningsson
2001-07-17  9:22     ` Laurynas Biveinis
2001-07-17 10:59     ` Newbie to creating front ends to gcc (and now also: trying tobuild " Andris Pavenis

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).