Browse Source

Created method getUri (#1554)

This is needed for the SCTUnitParser, so that some tests can be run
correctly.
jthoene 8 years ago
parent
commit
a3026fd599

+ 5 - 1
plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/expressions/STextExpressionParser.java

@@ -88,7 +88,7 @@ public class STextExpressionParser implements IExpressionParser {
 
 	public EObject parseExpression(String expression, String ruleName, String specification) {
 		StextResource resource = getResource();
-		resource.setURI(URI.createURI("path", true));
+		resource.setURI(URI.createURI(getUri(), true));
 		ParserRule parserRule = XtextFactory.eINSTANCE.createParserRule();
 		parserRule.setName(ruleName);
 		IParseResult result = parser.parse(parserRule, new StringReader(expression));
@@ -125,6 +125,10 @@ public class STextExpressionParser implements IExpressionParser {
 		return rootASTElement;
 	}
 
+	protected String getUri() {
+		return "path";
+	}
+
 	public Scope createInternalScope(String contextScope) {
 		ParserRule parserRule = XtextFactory.eINSTANCE.createParserRule();
 		parserRule.setName(InternalScope.class.getSimpleName());