Skip to content

Support for Xtext enum #1475

Answered by Yokozuna59
brsanthu asked this question in Q&A
Apr 28, 2024 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

I'd recommend you read this article: https://www.typefox.io/blog/xtext-to-langium/ and this discussion: #521.

But answering your question using the article approach, then it would be something like this:

Xtext:

enum ForLiterals: update | view | reference;

Langium:

type ForLiterals = 'update' | 'view' | 'reference';
ForLiterals returns ForLiterals:
	ForLiterals_Update | ForLiterals_View | ForLiterals_Reference
;
ForLiterals_Update returns string: 'update';
ForLiterals_View returns string: 'view';
ForLiterals_Reference returns string: 'reference';

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@msujew
Comment options

Answer selected by brsanthu
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants