Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Java application that parses text to model
Java application that parses text to model [message #655003] Thu, 17 February 2011 23:08
No real name is currently offline No real nameFriend
Messages: 1
Registered: February 2011
Junior Member
Hello,

I am trying to use xtext parser, for parsing files, in a eclipse java application (my intention is to parse end user files bases in mydsl grammar). With this code:


public static void main(String [] args){


String t = "files/mydsl.mydsl";

Injector sInjector;

ResourceSet rs = new ResourceSetImpl();

sInjector = new mydslStandaloneSetup().createInjectorAndDoEMFRegistration();


Resource resource = rs.getResource( URI.createURI(t),true);

EObject eobject = resource.getContents().get(0);

Model domainModel = (Model) eobject;
}

I get the error :


exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException: org.xml.sax.SAXParseException: Content is not allowed in prolog.




what does that mean?

any help ????
Previous Topic:an xtext project
Next Topic:getting reference to IXtextDocument and IDocumentEditor
Goto Forum:
  


Current Time: Fri Apr 26 00:23:22 GMT 2024

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

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

Back to the top