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

Formal grammar for EQL #2178

Open
homedirectory opened this issue Feb 7, 2024 · 0 comments
Open

Formal grammar for EQL #2178

homedirectory opened this issue Feb 7, 2024 · 0 comments

Comments

@homedirectory
Copy link
Contributor

homedirectory commented Feb 7, 2024

Description

It is proposed to describe a formal grammar for EQL to gain the following benefits:

  • Facilitation of informal reasoning during development of the parser. As of now the only reference point is the fluent API itself, which is difficult to view as the grammar's representation since it is, in fact, its product.
  • A better understanding of the state of EQL's fluent API can be gained by reverse engineering it into a formal grammar.

The Extended Backus-Naur form (EBNF) is a suitable notation candidate.

Fling is a fluent API generator that provides means of expressing a grammar in EBNF using Java. Fling can be used to write down the grammar of EQL. The resulting grammar will be represented as a Java object, meaning that it can be transformed into arbitraty other formats if necessary.

Expected outcome

A formal grammar for EQL expressed in a suitable notation.

@homedirectory homedirectory self-assigned this Feb 7, 2024
homedirectory added a commit that referenced this issue Feb 15, 2024
A canonical representation serves as a reference, thus it is written in
a human-readable form.
homedirectory added a commit that referenced this issue Feb 15, 2024
This also includes complex ones, such as caseWhen.
homedirectory added a commit that referenced this issue Feb 15, 2024
homedirectory added a commit that referenced this issue Feb 15, 2024
homedirectory added a commit that referenced this issue Feb 15, 2024
homedirectory added a commit that referenced this issue Feb 15, 2024
homedirectory added a commit that referenced this issue Feb 15, 2024
homedirectory added a commit that referenced this issue Feb 15, 2024
homedirectory added a commit that referenced this issue Feb 15, 2024
homedirectory added a commit that referenced this issue Feb 16, 2024
homedirectory added a commit that referenced this issue Feb 23, 2024
Introduce a separate rule for "like" operators and replace inheritance
relationship by alternation between quantified and comparison operators.
homedirectory added a commit that referenced this issue Feb 23, 2024
…building it

This gives us more control over the BNF representation which will assist
with the transformation into ANTLR grammar format (among other ones).
homedirectory added a commit that referenced this issue Feb 23, 2024
…) with grammar terms

This approach uses an external storage for metadata that is associated
with a particular BNF instance. Unlike with the previous approach,
original Term instances used in the grammar are preserved in their
original form. This has the benefit of correct comparison with equals().

For example, instead of providing a new wrapper type for each possible
kind of metadata (such as it had been the case with labels in the form
of LabeledTerm), it suffices to create a new metadata Key and provide a
corresponding method in BnfBuilder.
homedirectory added a commit that referenced this issue Feb 23, 2024
homedirectory added a commit that referenced this issue Mar 4, 2024
…yield operands

This allows the body of expressions to use yield operands, not just
single operands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants