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

refersTo with as (#91) #102

Open StephanErb opened 13 years ago

StephanErb commented 13 years ago

TCS.tcs currently contains a few occurrences of "as" with refersTo, leading to appropriate warnings:

WARNING: As only possible without refersTo WARNING: As only possible without refersTo WARNING: As only possible without refersTo

I found:

    template TCS::LiteralRef
            :
                    referredLiteral{refersTo = value, lookIn = #all, as = stringSymbol, autoCreate = ifmissing, createAs = FURCAS::TCS::Keyword}
                    {{ parentTemplate = lookIn("OCL:#context") }}
            ;

    template TCS::PropertyReference 
        :
        -- for reference, need to look in metareference modelElement of the template this property belongs to       
              (isDefined(strucfeature) ? 
              strucfeature{
                    refersTo = name, 
                    query = "OCL:let c:ecore::EClass = #context.oclAsType(FURCAS::TCS::Template).metaReference.oclAsType(ecore::EClass) in
                                 let result:ecore::EStructuralFeature = c.getEStructuralFeature(?) in
                                     if (not result.oclIsInvalid()) then
                                             Bag{result}     
                                     else    
                                            Bag{}
                                     endif",
                    filter = "", invert = "name", as = identifierOrKeyword}
              : "->" name{as = identifierOrKeyword})
        ;

    template TCS::Operator addToContext
            :       (postfix ? "postfix") name "="
                    (isDefined(literal) ? [[
                            literal{refersTo = name}
                    |
                            literal{refersTo = value, lookIn = #all, as = stringSymbol, autoCreate = ifmissing, createAs = FURCAS::TCS::Keyword}
                    ]])
                    "," arity ";"
            ;
StephanErb commented 13 years ago

Stephan Erb (stephan@dev.static-void.de) wrote on 2011-01-06 13:24:39

What is the overall status of refersTo? Are we ready to deprecate it or is it still crucial in some usecases?

tgold commented 13 years ago

I think the TCS.tcs may be the only one (if at all, maybe it is alrteady fixed but I just can't remember) that uses refersTo. Also there are of course some tests that use it. From my point of view we could go on deprecating "refersTo".

StephanErb commented 13 years ago

TCS.tcs still makes use of createIfMissing when resolving keywords and symbols. Looks like we need a proper replacement for that (see #91 and #108).