Support for C++ syntax?

View: New views
4 Messages — Rating Filter:   Alert me  

Support for C++ syntax?

by Dov Grobgeld-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am using gob quite a lot with a Gtk+ and C++. Unfortunately gob barfs on some C++ syntax that it should just pass along to the cc and h files. Currently I'm able to work around this by introducing typedefs in the private-h section and then using them in the class definition, but I see no reason why the parser should not support them. The constructs in question are:

     private foo<bar> baz;
     private foo::bar baz;

Neither the <> nor the :: syntaxes are supported.

Any chance of getting this fixed?

Thanks,
Dov

On 29/01/2008, Jean-Yves Lefort <jylefort@...> wrote:
On Mon, 28 Jan 2008 18:10:20 +0100
Jean-Yves Lefort <jylefort@...> wrote:

> The attached patch allows to add GCC attributes to methods, using a
> syntax borrowed from C#.

There was a lexer conflict between array dimensions and
attributes. The fixed patches are attached.

--
Jean-Yves Lefort <jylefort@...>

--
to unsubscribe:
send mail to minimalist@... with "unsubscribe gob-list" in the subject




--
to unsubscribe:
send mail to minimalist@... with "unsubscribe gob-list" in the subject

Re: Support for C++ syntax?

by Jean-Yves Lefort :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 29 Jan 2008 08:24:42 +0200
"Dov Grobgeld" <dov.grobgeld@...> wrote:

> I am using gob quite a lot with a Gtk+ and C++. Unfortunately gob barfs on
> some C++ syntax that it should just pass along to the cc and h files.
> Currently I'm able to work around this by introducing typedefs in the
> private-h section and then using them in the class definition, but I see no
> reason why the parser should not support them. The constructs in question
> are:
>
>      private foo<bar> baz;
>      private foo::bar baz;
>
> Neither the <> nor the :: syntaxes are supported.
>
> Any chance of getting this fixed?
The namespace syntax is supported if you use the --for-cpp command
line option. The template syntax isn't. Supporting it properly would
involve moving the handling of C/C++ types from the lexer to the
parser, to be able to handle more complex types such as:

        A::B<C, D::E::F, G<H::I<J, K> > >

> On 29/01/2008, Jean-Yves Lefort <jylefort@...> wrote:
> >
> > On Mon, 28 Jan 2008 18:10:20 +0100
> > Jean-Yves Lefort <jylefort@...> wrote:
> >
> > > The attached patch allows to add GCC attributes to methods, using a
> > > syntax borrowed from C#.
> >
> > There was a lexer conflict between array dimensions and
> > attributes. The fixed patches are attached.
--
Jean-Yves Lefort <jylefort@...>


--
to unsubscribe:
send mail to minimalist@... with "unsubscribe gob-list" in the subject

attachment0 (196 bytes) Download Attachment

Re: Support for C++ syntax?

by Jiri Lebl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jan 29, 2008 at 12:01:44PM +0100, Jean-Yves Lefort wrote:
> The namespace syntax is supported if you use the --for-cpp command
> line option. The template syntax isn't. Supporting it properly would
> involve moving the handling of C/C++ types from the lexer to the
> parser, to be able to handle more complex types such as:
>
> A::B<C, D::E::F, G<H::I<J, K> > >

Perhaps supporting simple templates could be an easy option.  I mean
the example above is something to be avoided anyway I guess.

There is always the possibility of putting syntax that gob hates into
a separate file to include.  I know this is ugly, but even if support for
templates is done, then it would still require a new enough version
of gob.

George

PS: I know I have been kind of quiet on the submitted patches.  Fear not,
they are in my mailbox and are waiting for me to integrate them / test them /
make a release.

--
George <jirka@...>
   You can't say civilization isn't advancing: in every war they kill you
   in a new way.
                       -- Will Rogers



--
to unsubscribe:
send mail to minimalist@... with "unsubscribe gob-list" in the subject

Re: Support for C++ syntax?

by Jean-Yves Lefort :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 29 Jan 2008 16:55:54 -0600
George <jirka@...> wrote:

> On Tue, Jan 29, 2008 at 12:01:44PM +0100, Jean-Yves Lefort wrote:
> > The namespace syntax is supported if you use the --for-cpp command
> > line option. The template syntax isn't. Supporting it properly would
> > involve moving the handling of C/C++ types from the lexer to the
> > parser, to be able to handle more complex types such as:
> >
> > A::B<C, D::E::F, G<H::I<J, K> > >
>
> Perhaps supporting simple templates could be an easy option.  I mean
> the example above is something to be avoided anyway I guess.
Yes, I'd definitely avoid it.

> PS: I know I have been kind of quiet on the submitted patches.  Fear not,
> they are in my mailbox and are waiting for me to integrate them / test them /
> make a release.

I have no fear, since none of my previous patches have been ignored.

--
Jean-Yves Lefort <jylefort@...>


--
to unsubscribe:
send mail to minimalist@... with "unsubscribe gob-list" in the subject

attachment0 (196 bytes) Download Attachment