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

Questions regarding Semantic Predicates #369

Closed
tobixdev opened this issue Mar 1, 2021 · 3 comments
Closed

Questions regarding Semantic Predicates #369

tobixdev opened this issue Mar 1, 2021 · 3 comments

Comments

@tobixdev
Copy link

tobixdev commented Mar 1, 2021

Hi!

I hope it is ok to open an issue here just to ask a question.

We have an existing Xtext project for which we want to make the DSL more conscise. For this reason we would need semantic predicates which Xtext does unfortunately not support. After being pointed to your repository by @knutwannheden (thanks again) I came across the PR which introduced semantic predicates in the dsl-devkit.

I have some questions before starting to introduce the semantic predicates in our project. It would be really helpful if someone could help me out.

Firstly, I am a little bit concerned as to how Xtext will handle these newly introduced predicates. Are there any major changes required in Xtext itself, or will it work perfectly fine with the new ANTLR grammars? And if it will work, which limitations are introduced. I already saw the issue mentioning semantic coloring and content assist.

Secondly, I read in a forum post that there are problems with predicate hoisting. Did you find a nice solution to this issue?

I know its much to ask, but it would help me alot if someone could share his/her experience regarding this topic. Thanks! 😃

@gerdleon
Copy link
Collaborator

gerdleon commented Mar 29, 2021

Hi,
Sorry for the late reply.
Tomorrow, I will check with the team here at Avaloq regarding semantic predicates to give a better answer than my initial "try to avoid them/use them only as a last resort" :-) . In the end it you will have to implement custom behaviors for things that (more or less) come out of the box: content assist, colouring and formatting (I think this is the ugly one).
Please stay tuned.

@rubenporras
Copy link
Member

Hi @tobixdev,

sorry for the very late reply, I guess you are no longer interested in an answer, but I still would like to give you one, even not very thorough.

The semantic predicates work quite well with Xtext, provided you have our extensions, we use it extensively to model very complex languages, like PL/SQL. It is though not complete, as it cannot handle some complex grammar rules, this means that typically one need to inspect the generated ANTLR code or test if the predicate is called, and if it is not the expected, fix the DDK extension to handle the case and inject the predicate at the right place.

Systax coloring works quite well (at least I never noticed a probrem), but it is true that some features like coding completion or serialization do have problems with it. We did not implement that part.

Regards

@rubenporras
Copy link
Member

Hi @tobixdev , I will close the issue. Please, reopen again if you still have questions.

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

3 participants