Cross references [message #1862849] |
Tue, 02 January 2024 09:48 |
David Sun Messages: 45 Registered: July 2020 |
Member |
|
|
I defined a DSL A using xtext. This DSL is used to define user-defined types, such as struct types and array types.
STRUCT STUDENT
{
NAME:STRING,
AGE:INT
}
I've defined another DSL B. When a variable is defined in DSL B, the type of the variable can be a user-defined type (for example, a user-defined struct type) or a primitive type (for example, INT, STRING).
VAR ANDY:STUDENT;//The user-defined type STUDENT is used
VAR ROOMNUM:INT;//The primitive type INT is used
The rule I need to implement now is that in the DSL B grammar file, it is possible to define a rule that if the variable's data type is from a user-defined type, then it is cross-referenced, and if the variable's type is primitive, then no cross-reference is used.
Can you give me some advice?
Thanks a lot!
|
|
|
|
Powered by
FUDForum. Page generated in 0.02441 seconds