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 8907183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:50:49+00:00 2026-06-15T02:50:49+00:00

I have written this metamodel in a xText project: Screen: Screen name: name =

  • 0

I have written this metamodel in a xText project:

Screen:
"Screen name: " name = ID
    "Level: " level = STRING
    "End: " end = INT
    background = [Background]
    character = [Character]
    (enemies+=Enemy)*
    (elements+=Element)*

Background:
"Background{
    Id: " id = ID
    "Image: " image = [Image]
"}";
...

An all the metaclasses you see there (Background, Character, Enemy, etc) I haven´t had any problem creating the metamodel in ecore but when I try to define a specific model like this (using Ctrl+Space):

Screen name: s1
Level: "easy"
End: 1000

I get an error: mismatched INPUT expecting RULE_ID and I can’t keep on writing with Ctrl+Space. Any ideas why this is not working? Thank you.

  • 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-15T02:50:50+00:00Added an answer on June 15, 2026 at 2:50 am

    The problem with the grammar snippet is a misconception of cross references and containment references. You did not define a background somewhere in your sample file but the grammar expects a reference to a background. If you change the definition to something along these lines, it’ll work:

    Screen:
    "Screen name: " name = ID
        "Level: " level = STRING
        "End: " end = INT
        background = Background
        character = Character
        (enemies+=Enemy)*
        (elements+=Element)*
    
    Background:
    "Background{
        Id: " id = ID
        "Image: " image = [Image]
    "}";
    

    However, I expect that you actually wanted to use a cross reference instead of a contained background in a given screen. So you have to provide either your complete grammar or define a background prior to using it in a screen.

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

Sidebar

Related Questions

I have written this code outside all functions: int l, k; for (l =
i have written this structure: struct bmpheader { unsigned char magic[2]; unsigned int fsize;
I have written this simple C program that changes the rotation file name. Eg:
I have written this code: string _response = null; string _auth = Basic; Uri
I have written this public static void setIsolationLevel(Isolev level) { try{ switch(level){ case READ_UNCOMMITTED;
I have written this code which is simple #include <stdio.h> #include <string.h> void printLastLetter(char
have written this little class, which generates a UUID every time an object of
I have written this code inside a servlet to delete certain records from three
I have written this code in JavaScript and works perfectly fine when I include
I have written this function to auto correct gender to M or F from

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.