[rules-dev] RFC: declaration syntax

Wolfgang Laun wolfgang.laun at gmail.com
Wed Jul 27 01:34:14 EDT 2011


On 26 July 2011 21:28, Edson Tirelli <ed.tirelli at gmail.com> wrote:


> QUESTION:
>    As we can see above, we will need several new constructs in order to
> support features in our roadmap. We have the choice of making them all top
> level constructs, making the error recovery in the parser a lot more
> complicated, or we can re-use our declare construct to define these new
> structures as I presented in the pseudo-code above. Any pros/cons you can
> see in such approach?
>
>
I doubt the "a lot more complicated". I'd much rather have a "natural
language" with a lean syntax than the cobol-ish agglomeration of keywords.
Structured/syntax assisted editing should take care of gross errors so that
recovery isn't as important as without these aids.

I vote for OPTION 2. I'm very much against OPTION 3.

Wolfgang


> OPTION 1 (more verbose, but simpler and more stable):
> <epDeclaration> ::= declare entry-point <epName> [, <epName]*
> <windowDeclaration> ::= declare window <windowName>
> <restOfTheWindowDeclaration> end
> <typeDeclaration> ::= declare [type] <typeName> <restOfTheTypeDeclaration>
> end
>
> OPTION 2 (makes error recovery harder, but it is less verbose):
> <epDeclaration> ::= entry-point <epName> [, <epName]*
> <windowDeclaration> ::= window <windowName> <restOfTheWindowDeclaration>
> end
> <typeDeclaration> ::= declare <typeName> <restOfTheTypeDeclaration> end
>
> OPTION 3:
> <epDeclaration> ::= someOtherKeyword entry-point <epName> [, <epName]*
> <windowDeclaration> ::= someOtherKeyword window <windowName>
> <restOfTheWindowDeclaration> end
> <typeDeclaration> ::= declare [type] <typeName> <restOfTheTypeDeclaration>
> end
>
>
>    Edson
>
> --
>   Edson Tirelli
>   JBoss Drools Core Development
>   JBoss by Red Hat @ www.jboss.com
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20110727/333fa104/attachment.html 


More information about the rules-dev mailing list