Skip to content
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

Ambiguity problem with FEEL #615

Open
al66 opened this issue May 1, 2022 · 0 comments
Open

Ambiguity problem with FEEL #615

al66 opened this issue May 1, 2022 · 0 comments

Comments

@al66
Copy link

al66 commented May 1, 2022

I'm writing a interpreter for the FEEL expression language used in DMN (imicros-feel-interpreter).
Everything is fine beside the problem with the foreseen ambiguity in the language.
Unfortunately I have no idea, how to solve this problem with nearley.

FEEL allows names like Profit and loss
Dependent on the scope they can be a name Profit and loss or the logical expression Profit and loss.
(This is only an example - FEEL also allow other operators in the names - like ./+-*).

The grammer is simplified something like this:

Expression -> Logical
        | Name

Name -> %word (%whitespace %word):*

Logical -> Expression %and Expression

If I allow keywords in names, I will get two results. With the postprocessing I can check, if the name "Profit and loss" is in the context and accept or reject. But I have no idea how I can eliminate the logical result, when there is a valid name.

Any idea is welcome.

(The full grammar I'm using can be found in the package under lib/feel.grammar.ne)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant