-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adl rules have no operator precedence #4
Comments
The parsing order of precedence should be correct now. |
Your fix for the parsing of operator precedence does not yet work. I fixed it in Archie. See the branch rule_evaluation of archie at https://github.com/nedap/archie/tree/rule_evaluation. I fixed operator precedence both for boolean and arithmetic expressions, with soms tests. I also implemented expression variables declarations in both the grammar and evaluation. I'll create a pull request for the grammar as soon as i have more of the grammar implemented, working and tested. Also, the ADL language spec is missing the modulo operator. The AOM spec does list it. |
For the latest rule grammar in archie, see the grammar in the master-branch of archie. That does not yet parse function calls and it has some simple changes to the language to fix some rather hard to fix ambiguity i mentioned on the mailing list. I'll respond to that mail soon :) |
My view on this at the moment is that its' better to wait until you get a (reasonably) complete working 'rules' section grammar that corresponds to the Expressions Language spec (where the latter might need some tweaks as well), and then when those two are in sync, I'll replace the current adl_rules.g4 with what you have. |
The operators in the rules section have no operator precedence. It's very useful to include this in the antlr grammar. Something along the lines of:
You can then simply walk the tree to evaluate expressions.
Useful both for arithmetic and boolean expressions.
The text was updated successfully, but these errors were encountered: