Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem with context in Xbase Interpreter(Xbase Interpreter)
Problem with context in Xbase Interpreter [message #1059402] Sat, 18 May 2013 01:33 Go to next message
Yoandri Saavedra is currently offline Yoandri SaavedraFriend
Messages: 24
Registered: February 2013
Junior Member

Hi all, I have my
GOInterpreter extends XbaseInterpreter
.. and I write my
 protected Object _evaluateMyVariableDeclaration(MyVariable..... ){

      context.newValue(QualifiedName.create(dv.getName()), val);
      return null;
  }
 
 protected Object _evaluateGetMyVariable(GetMy......){
    //   :blush:  this return null
    return context.getValue(QualifiedName.create(dv.getName()));
  }


etc.. but when I try get my variable for the context in other function.. this say no exist.. I no create context... I only say

  for  (XExpression decl : model.getExpressions()) {
        MyInterpreter.evaluate(decl);
  }

.. You look any error???... Razz


Re: Problem with context in Xbase Interpreter [message #1059444 is a reply to message #1059402] Sat, 18 May 2013 16:06 Go to previous message
Yoandri Saavedra is currently offline Yoandri SaavedraFriend
Messages: 24
Registered: February 2013
Junior Member

Resolve with 10.5.2. Using the Xbase Interpreter in Xtext documentation.. now ..this

 IEvaluationContext evaluationContext = contextProvider.get();		
	for  (XExpression decl : mymodel.getExpressions()) {	
	   try {
				
	     MyInterpreter.evaluate(decl, evaluationContext, CancelIndicator.NullImpl);
					
				} catch (Exception e) {
					// TODO: handle exception
				}
				
		}


I use one context for every internal evaluation. The solution... Laughing
Previous Topic:formating with Xtend
Next Topic:Mixing up XEpressions and my custom expressions
Goto Forum:
  


Current Time: Fri Apr 26 18:04:58 GMT 2024

Powered by FUDForum. Page generated in 0.03526 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top