exte piramo
exte piramo

Reputation: 3

How to fix: cross references cannot be resolved on xtext

I have the following xtext grammar defined with cross references

// dsl.xtext file
Students:
    'student' studentID=ID fName=STRING lName=STRING (city=STRING)? (state=STRING)?
;
Payments:
    'payment' paymentID=ID studentID=[Students] amount=INT
;

//The syntax is:
student s1001 "first name" "last name"
student s1002 "first name" "last name"

payment p101 s1002  12

I am getting the following error message:

's1002' cannot be resolved.

How do I fix this?

Upvotes: 0

Views: 100

Answers (1)

user5158149
user5158149

Reputation:

Change studentID to name, cross-referencing must be done via name.

'student' name=ID fName=STRING lName=STRING (city=STRING)? (state=STRING)?

Upvotes: 1

Related Questions