On 26 July 2011 21:28, Edson Tirelli <ed.tirelli(a)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(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev