grammatica-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Grammatica-users] Grammar for "Nesting"


From: Patrick M Gremo
Subject: Re: [Grammatica-users] Grammar for "Nesting"
Date: Mon, 25 Jul 2005 12:45:25 -0500

This is close.



But I think what I need is something like:

Message = [Object | Message] MethodCall

But this gives me an infinite loop.

I think I can describe it as:

A Message can have an Object OR another Message coupled with a MethodCall.










I think a production for Message could look like this:

Message = MethodCall Message?
| Object Message? ;

This will allow an infinite list of method calls and
objects mixed together. If the Object production can
only be placed at the end, you'd write the production
like this:

Message = MessageCall Message?
| Object ;

Cheers,

/Per

On sun, 2005-07-24 at 19:40 -0500, Patrick M Gremo wrote:
>
> I'm trying to create a kind of "reverse" call stack type of thing. It
> sounds easy but for some reason I just can't figure it out.
>
> I have this:
>
> (object | methodCall) methodCall methodCall methodCall ...
>
>
> I want a tree like:
>
> message
> |-methodCall
> |-message
> |-methodCall
> |-message
> |-methodCall
> |-message
> |-object | methodCall
>
>
>
>
> _______________________________________________
> Grammatica-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/grammatica-users
>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]