-
Hi!, First, thanks for this great initiative, it will be great to see how evolves this tool and I will provide as much as feed-back I could in my learning process. The case is that I'm trying to build a DSL to define requirements over data with this tool, and I've not previous experience with Xtext, so maybe I missing some point. The problem: In the code above, at the "Requeriments" declaration, the cross-referece reporter[Author] works, but desname=[Instance|QualifiedName] don't. The qualified name of the reference will be [The Dataset ID].[The Instance ID], d'ont? Also, I want to reference attributes, which I really need [The Dataset NAME].[The Instance NAME].[The Attribute NAME]
Thanks!! and another time, congratulation for the work!! pd: I've attach a example of my DSL. :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @JoanGi, thank you for your question and the compliments :) One major difference to our scoping implementation compared to Xtext is that we left the default implementation mostly empty. Like you noticed it works in a local scope, but there's no fully qualified name referencing mechanism. We opted for this mostly for two reasons, 1. its easier ;) 2. with Xtext the most popular use case was building programming languages, which use fully qualified names only in selected scenarios, usually relying on the local and global scope otherwise. Anyway, you can take a look at the domainmodel example scoping, if you want to achieve fully qualified name scoping behavior. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick answer!. Finally I've get it working with my grammar. I've faced some problems to solve, so I want to share my thought, maybe are helpful. There is no fully qualified names referencing mechanism, but the default implementation also do not reference elements out of the scope by its name. In domain model example index the example fix it using the function StreamAllContent() instead of StreamContent(). I've been looking at the DefaultAstNodeDescriptionProvider and I've tried to change it, solving this issue. I've been trying for unwanted behaviors, cross-file reference still works. In my case, it was a need, maybe for other cases this could behave in an unexpected manner. Maybe developing a way to express in the grammar if the scope of the reference is local or global could be a solution. Thanks!! |
Beta Was this translation helpful? Give feedback.
Hi @JoanGi, thank you for your question and the compliments :)
One major difference to our scoping implementation compared to Xtext is that we left the default implementation mostly empty. Like you noticed it works in a local scope, but there's no fully qualified name referencing mechanism. We opted for this mostly for two reasons, 1. its easier ;) 2. with Xtext the most popular use case was building programming languages, which use fully qualified names only in selected scenarios, usually relying on the local and global scope otherwise.
Anyway, you can take a look at the domainmodel example scoping, if you want to achieve fully qualified name scoping behavior.