FURCAS-dev / FURCAS

A Eclipse Language Workbench for view-based textual modelling based on EMF
http://www.furcas.org
11 stars 2 forks source link

OCL-based findOrCreate (#97) #108

Open StephanErb opened 13 years ago

StephanErb commented 13 years ago

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 commented 13 years ago

Thomas Goldschmidt (mail@thomas-goldschmidt.de) 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") }}
                ;