Parsing XBase in the inferrer [message #1758604] |
Thu, 30 March 2017 13:57 |
Rodrigo Ruiz Messages: 28 Registered: March 2017 |
Junior Member |
|
|
Hi,
i want to parse simple expressions in the inferrer rather than building them by hand. so far i have:
@Inject ParseHelper<XExpression> parseHelper
then in my code i simply call:
var variable=parseHelper.parse('''123''')
But the result is always null.
I've seen that in the unit test this works perfectly, i even created an injector in the plugin and added:
@InjectWith(CLangInjectorProvider)
But still is not working.
From the source code of ParseHelper:
public T parse(InputStream in, URI uriToUse, Map<?, ?> options, ResourceSet resourceSet) {
resourceHelper.setFileExtension(fileExtension);
Resource resource = resourceHelper.resource(in, uriToUse, options, resourceSet);
final T root = (T) (resource.getContents().isEmpty() ? null : resource.getContents().get(0));
return root;
}
i see that
resource.getContents().isEmpty()
is always true.
Is there a way to parse a String ans get an XExpression?
Thanks and regards!
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.24647 seconds