Jump to page: 1 2
Thread overview
DMD parser hooked up
Jan 22, 2004
Ben Hinkle
Jan 23, 2004
Andy Friesen
Jan 23, 2004
Ben Hinkle
Jan 23, 2004
Stephan Wienczny
Jan 23, 2004
Ben Hinkle
Jan 23, 2004
Ilya Minkov
Jan 23, 2004
resistor
Jan 24, 2004
resistor
Jan 24, 2004
Ben Hinkle
Jan 25, 2004
Walter
Feb 01, 2004
resistor
Feb 01, 2004
Ben Hinkle
Feb 01, 2004
resistor
Feb 01, 2004
resistor
Feb 01, 2004
Ben Hinkle
Feb 01, 2004
resistor
Feb 01, 2004
Ben Hinkle
Feb 02, 2004
Walter
Feb 02, 2004
resistor
Feb 02, 2004
Walter
January 22, 2004
After messing with the lexer I took a deep breath and got the DMD parser hooked up and started transforming trees from DMD data structures to GCC data structures. I've done enough to get "hello world" back (for now that is my baseline - don't break things so much that "hello world" stops compiling).

Basically I got the OpenD code and updated it from DMD.36 to DMD .78 (yeah, I know, Walter released .79 today), hooked it up to the G++ front-end and started plugging in the pieces to translate back and forth. So the parsing and three semantic phases of the DMD src now run before it is turned over to GCC. It should be fairly possible to make good progress filling in these pieces until it gets hard again.

If anyone wants to try it out for themselves you can get the tarball from
the last link at
http://home.comcast.net/~benhinkle/index.html

I've only tried it on Linux and compiling "hello world".

-Ben

ps. Walter, could you remove the extra closing parenthesis on line 175 of
dmd/src/dmd/module.c?
 (((unsigned char *)p)[3] << 24));


January 23, 2004
Ben Hinkle wrote:
> After messing with the lexer I took a deep breath and got the DMD parser
> hooked up and started transforming trees from DMD data structures to GCC
> data structures. I've done enough to get "hello world" back (for now that is
> my baseline - don't break things so much that "hello world" stops
> compiling).

Simply amazing.  I took one look at the GCC documentation, and my brain exploded more or less instantly.

Well done!

 -- andy
January 23, 2004
"Andy Friesen" <andy@ikagames.com> wrote in message news:buq0u5$15vk$1@digitaldaemon.com...
> Ben Hinkle wrote:
> > After messing with the lexer I took a deep breath and got the DMD parser hooked up and started transforming trees from DMD data structures to GCC data structures. I've done enough to get "hello world" back (for now
that is
> > my baseline - don't break things so much that "hello world" stops compiling).
>
> Simply amazing.  I took one look at the GCC documentation, and my brain exploded more or less instantly.
>
> Well done!
>
>   -- andy

Glad you like it, though I don't understand 3/4 of the GCC internals either. That's why the G++ code is so useful - I can just call their function "finish_expr_stmt", for instance, instead of writing one myself. Probably at some point finish_expr_stmt will have to change but for now I just want to have a compiler than runs. It's too demoralizing to work on something that doesn't actually run. The main file to fiddle around with, if you want to take a look, is d-parse.c since it has all the routines that take D things and calls the G++ equivalents.

-Ben


January 23, 2004
Ben Hinkle wrote:
> "Andy Friesen" <andy@ikagames.com> wrote in message
> news:buq0u5$15vk$1@digitaldaemon.com...
> 
>>Ben Hinkle wrote:
>>
>>>After messing with the lexer I took a deep breath and got the DMD parser
>>>hooked up and started transforming trees from DMD data structures to GCC
>>>data structures. I've done enough to get "hello world" back (for now
> 
> that is
> 
>>>my baseline - don't break things so much that "hello world" stops
>>>compiling).
>>
>>Simply amazing.  I took one look at the GCC documentation, and my brain
>>exploded more or less instantly.
>>
>>Well done!
>>
>>  -- andy
> 
> 
> Glad you like it, though I don't understand 3/4 of the GCC internals either.
> That's why the G++ code is so useful - I can just call their function
> "finish_expr_stmt", for instance, instead of writing one myself. Probably at
> some point finish_expr_stmt will have to change but for now I just want to
> have a compiler than runs. It's too demoralizing to work on something that
> doesn't actually run. The main file to fiddle around with, if you want to
> take a look, is d-parse.c since it has all the routines that take D things
> and calls the G++ equivalents.
> 
> -Ben
> 
> 
Could you u/l it to a website?

Stephan

January 23, 2004
try http://home.comcast.net/~benhinkle/gdmd.tar.gz

> Could you u/l it to a website?
>
> Stephan
>


January 23, 2004
Wooooohoooo!

Thanks a lot for your efforts! I will join you in about 3-4 weeks!

-eye

Ben Hinkle wrote:
> After messing with the lexer I took a deep breath and got the DMD parser
> hooked up and started transforming trees from DMD data structures to GCC
> data structures. I've done enough to get "hello world" back (for now that is
> my baseline - don't break things so much that "hello world" stops
> compiling).
> 
> Basically I got the OpenD code and updated it from DMD.36 to DMD .78 (yeah,
> I know, Walter released .79 today), hooked it up to the G++ front-end and
> started plugging in the pieces to translate back and forth. So the parsing
> and three semantic phases of the DMD src now run before it is turned over to
> GCC. It should be fairly possible to make good progress filling in these
> pieces until it gets hard again.
> 
> If anyone wants to try it out for themselves you can get the tarball from
> the last link at
> http://home.comcast.net/~benhinkle/index.html
> 
> I've only tried it on Linux and compiling "hello world".
> 
> -Ben
> 
> ps. Walter, could you remove the extra closing parenthesis on line 175 of
> dmd/src/dmd/module.c?
>  (((unsigned char *)p)[3] << 24));
> 
> 

January 23, 2004
Awesome!  I'm compiling it now on my Mac OS X box.  We'll see how it turns out...

Only problem I've had thus far is that libstdc++ only seems to exist on OS X as
a static library.  Do
I need to change anything to get it to work as such?

Thanks again,

Owen

In article <bupadt$16o$1@digitaldaemon.com>, Ben Hinkle says...
>
>After messing with the lexer I took a deep breath and got the DMD parser hooked up and started transforming trees from DMD data structures to GCC data structures. I've done enough to get "hello world" back (for now that is my baseline - don't break things so much that "hello world" stops compiling).
>
>Basically I got the OpenD code and updated it from DMD.36 to DMD .78 (yeah, I know, Walter released .79 today), hooked it up to the G++ front-end and started plugging in the pieces to translate back and forth. So the parsing and three semantic phases of the DMD src now run before it is turned over to GCC. It should be fairly possible to make good progress filling in these pieces until it gets hard again.
>
>If anyone wants to try it out for themselves you can get the tarball from
>the last link at
>http://home.comcast.net/~benhinkle/index.html
>
>I've only tried it on Linux and compiling "hello world".
>
>-Ben
>
>ps. Walter, could you remove the extra closing parenthesis on line 175 of dmd/src/dmd/module.c?
> (((unsigned char *)p)[3] << 24));
>
>


January 24, 2004
Well, no luck with that.  It failed with these errors.  Anything you can suggest to fix it?

stage1/xgcc -Bstage1/ -B/usr/local/powerpc-apple-darwin7.2.0/bin/ -c   -g -O2
-DIN_GCC   -W
-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic
-Wno-long-long
-Werror -Werror -fno-common   -DHAVE_CONFIG_H    -I. -Id -I../../gcc3/gcc
-I../../gcc3/gcc/d
-I../../gcc3/gcc/../include -I../intl ../../gcc3/gcc/d/call.c -o d/call.o
In file included from ../../gcc3/gcc/d/call.c:35:
./../gcc3/gcc/d/d-tree.h:1020: warning: bit-field 'is_lang_type_class' type
invalid in ISO C
./../gcc3/gcc/d/d-tree.h:1022: warning: bit-field 'has_type_conversion' type
invalid in ISO C
./../gcc3/gcc/d/d-tree.h:1023: warning: bit-field 'has_init_ref' type invalid
in ISO C
./../gcc3/gcc/d/d-tree.h:1024: warning: bit-field 'has_default_ctor' type
invalid in ISO C
./../gcc3/gcc/d/d-tree.h:1025: warning: bit-field 'uses_multiple_inheritance'
type invalid in ISO C
./../gcc3/gcc/d/d-tree.h:1026: warning: bit-field 'const_needs_init' type
invalid in ISO C
./../gcc3/gcc/d/d-tree.h:1027: warning: bit-field 'ref_needs_init' type invalid
in ISO C
./../gcc3/gcc/d/d-tree.h:1028: warning: bit-field 'has_const_assign_ref' type
invalid in ISO C
gnumake[2]: *** [d/call.o] Error 1
gnumake[1]: *** [stage2_build] Error 2
gnumake: *** [bootstrap] Error 2

In article <bus9vc$1v9b$1@digitaldaemon.com>, resistor@mac.com says...
>
>Awesome!  I'm compiling it now on my Mac OS X box.  We'll see how it turns out...
>
>Only problem I've had thus far is that libstdc++ only seems to exist on OS X as
>a static library.  Do
>I need to change anything to get it to work as such?
>
>Thanks again,
>
>Owen


January 24, 2004
Googling for the error gives these thread:

http://gcc.gnu.org/ml/gcc/2003-04/msg00102.html

http://gcc.gnu.org/ml/gcc-patches/2003-04/msg00175.html

It seems like the second one has a solution as a patch file. If you feel
like experimenting try using different C compilers for bootstrapping or
maybe strip out the -pendantic flag or something.
Good luck,
-Ben

<resistor@mac.com> wrote in message news:busk3q$2f5k$1@digitaldaemon.com...
> Well, no luck with that.  It failed with these errors.  Anything you can
suggest
> to fix it?
>
>
stage1/xgcc -Bstage1/ -B/usr/local/powerpc-apple-darwin7.2.0/bin/ -c   -g -O 2
> -DIN_GCC   -W
> -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic
> -Wno-long-long
> -Werror -Werror -fno-common   -DHAVE_CONFIG_H    -I. -Id -I../../gcc3/gcc
> -I../../gcc3/gcc/d
> -I../../gcc3/gcc/../include -I../intl ../../gcc3/gcc/d/call.c -o d/call.o
> In file included from ../../gcc3/gcc/d/call.c:35:
> ./../gcc3/gcc/d/d-tree.h:1020: warning: bit-field 'is_lang_type_class'
type
> invalid in ISO C
> ./../gcc3/gcc/d/d-tree.h:1022: warning: bit-field 'has_type_conversion'
type
> invalid in ISO C
> ./../gcc3/gcc/d/d-tree.h:1023: warning: bit-field 'has_init_ref' type
invalid
> in ISO C
> ./../gcc3/gcc/d/d-tree.h:1024: warning: bit-field 'has_default_ctor' type
> invalid in ISO C
> ./../gcc3/gcc/d/d-tree.h:1025: warning: bit-field
'uses_multiple_inheritance'
> type invalid in ISO C
> ./../gcc3/gcc/d/d-tree.h:1026: warning: bit-field 'const_needs_init' type
> invalid in ISO C
> ./../gcc3/gcc/d/d-tree.h:1027: warning: bit-field 'ref_needs_init' type
invalid
> in ISO C
> ./../gcc3/gcc/d/d-tree.h:1028: warning: bit-field 'has_const_assign_ref'
type
> invalid in ISO C
> gnumake[2]: *** [d/call.o] Error 1
> gnumake[1]: *** [stage2_build] Error 2
> gnumake: *** [bootstrap] Error 2
>
> In article <bus9vc$1v9b$1@digitaldaemon.com>, resistor@mac.com says...
> >
> >Awesome!  I'm compiling it now on my Mac OS X box.  We'll see how it
turns
> >out...
> >
> >Only problem I've had thus far is that libstdc++ only seems to exist on
OS X as
> >a static library.  Do
> >I need to change anything to get it to work as such?
> >
> >Thanks again,
> >
> >Owen
>
>


January 25, 2004
"Ben Hinkle" <bhinkle4@juno.com> wrote in message news:bupadt$16o$1@digitaldaemon.com...
> After messing with the lexer I took a deep breath and got the DMD parser hooked up and started transforming trees from DMD data structures to GCC data structures. I've done enough to get "hello world" back (for now that
is
> my baseline - don't break things so much that "hello world" stops compiling).

Great!

> ps. Walter, could you remove the extra closing parenthesis on line 175 of
> dmd/src/dmd/module.c?
>  (((unsigned char *)p)[3] << 24));

Done.


« First   ‹ Prev
1 2