Quantcast

Suppressing "inline" nodes

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Suppressing "inline" nodes

Gunnar
Hi,

Is there a way to suppress nodes from the parse tree which are specified "inline" within a rule method. E.g. in the following rule:

    public Rule Foo() {
        return ZeroOrMore( Bar() );
    }

I would like to suppress the ZeroOrMore node, while keeping the Bar node(s). How could I do this?

Thanks,

--Gunnar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Suppressing "inline" nodes

mathias
Administrator
This should do it:

    public Rule Foo() {
        return ZeroOrMore(Bar()).skipNode();
    }
   
Cheers,
Mathias

---
[hidden email]
http://www.parboiled.org

On 27 May 2014, at 16:20, Gunnar [via parboiled users] <[hidden email]> wrote:

> Hi,
>
> Is there a way to suppress nodes from the parse tree which are specified "inline" within a rule method. E.g. in the following rule:
>
>     public Rule Foo() {
>         return ZeroOrMore( Bar() );
>     }
>
> I would like to suppress the ZeroOrMore node, while keeping the Bar node(s). How could I do this?
>
> Thanks,
>
> --Gunnar
>
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/Suppressing-inline-nodes-tp4024335.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, click here.
> NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Suppressing "inline" nodes

Gunnar
Ah, this was exactly what I was looking for. Thanks!

--Gunnar
Loading...