I agree that writing the expression language using a lexer & parser is good.
I've been working toward this goal and I was planning on using JFlex and byacc/J. Which lexer & parser does LBEL use?
Tools such as ANTLR know how to automatically transform "natural" grammars to LL(k) or LR(k) form and then automatically generate a parser for the transformed grammar. However, once you have a grammar in LL(1), writing a top-down parser for it is almost a child's play. That's what I have done.
The hand crafted lexer is also quite simple (155 lines of Java).
The conversion to postfix doesn't prevent short-circuiting during evaluation (supported by AndRule, OrRule).
In postfix form you can only avoid the evaluation of the next node. LBEL skips whole branches several levels deep. Consider, the following expression.
true OR ((NOT false AND true) AND (true OR FALSE).
In postfix form it becomes:
true false NOT true AND true false OR AND OR
I don't see how the postfix form can avoid the evaluation of the whole expression. (Note how the first OR becomes the last operator in the postfix form.)
The point of my previous email is two parts: - I'd like to see LBEL implement actions by relying on rules in o.a.l.rule.
Unfortunatley, they depend on the stack to retrieve operands don't they?
- Where it makes sense (personal preference only), I'd like us to to keep as much of the existing operator and keywords as possible when issues like inconsistency and verbosity don't rule them out.
A few language-questions: - Are parens supported?
Of course.
- How are properties supported? prop.xxx, prop(x), or something else?
Not yet but that's easy to add.
- How is legitimate white space supported? (single ticks, quotes?)
Within single ticks or quotes, both forms are allowed.
- Spaces could show up in a property key...is that supported?
See previous answers.
I'm looking forward to seeing the results.
Since you asked, I just committed the skeleton code for your convenience. It is fairly straightforward code. More sophisticated version will follow within the next few hours.
Scott
-- Ceki G�lc�
The complete log4j manual: http://www.qos.ch/log4j/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
