| Summary: | [EGL] Illegal assignment to variable 't'. Expected Template and found org.eclipse.epsilon.egl.EglTemplate | ||
|---|---|---|---|
| Product: | [Modeling] Epsilon | Reporter: | Louis Rose <louis> |
| Component: | Core | Assignee: | Dimitris Kolovos <dkolovos> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
This is a bug, caused by EglComplexType mandating that Template variables are of type EglFileGeneratingTemplate. I've changed EglComplexType to type-check Template variables against EglTemplate instead. I've checked a fix into SVN. Assigning to Dimitris for build integration - thanks! Fixed in 0.9.0. |
When invoking EGL from Java, assignments to a template variable fail with the following error: Illegal assignment to variable 't'. Expected Template and found org.eclipse.epsilon.egl.EglTemplate Exemplar client code: public static void main(String[] args) { EglTemplateFactory tf = new EglTemplateFactory(); EglTemplate template = null; try { File f = FileUtil.getFile("absolute.egl", Runner.class); template = tf.load(f); } catch (Exception e) { e.printStackTrace(); } try { String output = template.process(); System.out.println(output); } catch (EolRuntimeException r) { r.printStackTrace(); } } Contents of EGL template: [% var t : Template := TemplateFactory.load('file:///Users/louis/Code/eclipse/workspaces/helios/epsilon-user/egl.problem/src/problem/simple.egl'); %] [%=t.process()%]