Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8383747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:14:22+00:00 2026-06-09T17:14:22+00:00

I need to programmatically turn a text conform to an XText grammar into an

  • 0

I need to programmatically turn a text conform to an XText grammar into an AST conform to an Ecore meta-model generated by XText from the same grammar.

I know XText also generate the Java classes implementing such parser but I don’t know either where they are and how to use it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:14:24+00:00Added an answer on June 9, 2026 at 5:14 pm

    A complete answer to this question can be found on the Xtext page of the Eclipse wiki.

     new org.eclipse.emf.mwe.utils.StandaloneSetup().setPlatformUri("../");
     Injector injector = new MyDslStandaloneSetup().createInjectorAndDoEMFRegistration();
     XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class);
     resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);
     Resource resource = resourceSet.createResource(URI.createURI("dummy:/example.mydsl"));
     InputStream in = new ByteArrayInputStream("type foo type bar".getBytes());
     resource.load(in, resourceSet.getLoadOptions());
     Model model = (Model) resource.getContents().get(0);
    

    Change the file extension (mydsl) to your own language extension.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to programmatically set text into TextBox and catch event when text was
My site is hosted on Azure. I need to programmatically turn off Internet Explorer's
I have a combobox from which i need to programmatically disable items depending on
I need to programmatically insert a row into an Excel Spreadsheet multiple times. I
I need to programmatically remove a button from a window in Cocoa but the
In C# when I programmatically need to get a specific control from a GridView
I need to programmatically extract method definition/implementation from Java source file, could you recommend
Need to programmatically click an html button from a login event (code behind? the
I need to programmatically add a new user to a Django setup from a
I need to programmatically install (In Ubuntu) few hundreds of fonts for my application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.