[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-devel
Subject:    Re: new PHP Parser
From:       Jakob Petsovits <jpetso () gmx ! at>
Date:       2008-06-08 20:39:37
Message-ID: 200806082239.38008.jpetso () gmx ! at
[Download RAW message or body]

On Sunday, 8. June 2008, Niko Sams wrote:
> On Saturday, 7. June 2008, Jakob Petsovits wrote:
> > On Saturday, 7. June 2008, New PHP Parser wrote:
> > >     parameter=functionCallParameterListElement @ COMMA | 0
> > >  -> functionCallParameterList ;;
> >
> > (and similar rules)
> >
> > I found it a good idea to not have any rules that may be empty (except
> > for pseudo data processing rules), as that makes stuff more predictable
> > and slightly easier to debug. Most importantly, it prevents you from
> > having the optional zero both in the caller rule and in the called rule.
>
> you mean I should remove the "| 0" from the rule, for example:
> #parameters=functionCallParameterListElement @ COMMA ->
> functionCallParameterList ;;
> LPAREN (parameterList=functionCallParameterList | 0) RPAREN -> foo;
> instead of:
> #parameters=functionCallParameterListElement @ COMMA | 0 ->
> functionCallParameterList ;;
> LPAREN parameterList=functionCallParameterList RPAREN -> foo;

That's what I meant, yes. I didn't say you should do it that way,
I just said that I found it a good idea to put it that way.
Whether you agree with that is up to you :P

Oh, and I forgot another point for moving up the "| 0": one AST node less
in the tree for each parameter list (or for other rules working the same way).

Have fun,
  Jakob

_______________________________________________
KDevelop-devel mailing list
KDevelop-devel@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic