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

OCL-based findOrCreate (#97) #108

Open
StephanErb opened this issue Aug 23, 2011 · 1 comment
Open

OCL-based findOrCreate (#97) #108

StephanErb opened this issue Aug 23, 2011 · 1 comment

Comments

@StephanErb
Copy link
Member

Parsing a correct syntax have to be error free. If not an error have to be generate as an Exception. In the modular version of FURCAS(Diplomarbeit) i have to parse a syntax that import a template in an another syntax. But a template has also keywords and symbols that have to be imported. Commenting the symbols in the imported syntax solve (first) the symbol problem but not the keyword problem.
To solve this problem, i have changed in EcoreModelElementFinder.java the exception given when the resultSet size > 1 to a simple System.error message. Just to have a workaround. A real solution would get rid of the createIfMissing construct currently used in TCS.tcs for the creation of keywords and replace it with an OCL based solution.

@StephanErb
Copy link
Member Author

Thomas Goldschmidt ([email protected]) wrote on 2011-02-22 12:47:10

What Christain actually wanted to express with this bug report is that we need to have something like "findOrCreate" as it is currently done using the autoCreate features also for a more OCL based version of the FURCAS mapping language. so that we can get rid of the autoCreate=IfMissing construct which currently relies on the odd "elements in context" stuff.
 
As an example see how keywords are handled in TCS.tcs:
template TCS::LiteralRef
                :
                        referredLiteral{refersTo = value, lookIn = #all, as = stringSymbol, autoCreate = ifmissing, createAs = FURCAS::TCS::Keyword}
                        {{ parentTemplate = lookIn("OCL:#context") }}
                ;

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

No branches or pull requests

1 participant