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

refersTo with as (#91) #102

Open
StephanErb opened this issue Aug 23, 2011 · 3 comments
Open

refersTo with as (#91) #102

StephanErb opened this issue Aug 23, 2011 · 3 comments

Comments

@StephanErb
Copy link
Member

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
Copy link
Member Author

Stephan Erb ([email protected]) 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
Copy link
Contributor

tgold commented Aug 24, 2011

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
Copy link
Member Author

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).

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

2 participants