Skip to content
Discussion options

You must be logged in to vote

Hey @Gilyermo

I believe it could be done with coordination of custom lexer and workspace manager, am I right?

No, unless you actually want to modify how certain tokens are parsed, you shouldn't need to touch the lexer at all (though indentation aware parsing like in Python requires special INDENT and DEDENT tokens). Import features are accomplished via scoping. See our langium grammar scope as an example.

How can I implement such things with Langium?

Through scoping as well. Generally, when the question is "How can I handle cross references to other elements in Langium", the answer is almost always scoping. More specifically, in both of these cases, you want to change how AST node des…

Replies: 1 comment

Comment options

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