Are terminal fragments supported? #365
paulfrench
started this conversation in
General
Replies: 1 comment 2 replies
|
Hi @paulfrench First of all, compared to Antlr, our lexing/parsing library Chevrotain does not take the longest match while tokenizing. Therefore, terminal order in your grammar is really important. I assume that you use Secondly, EBNF style syntax for terminals and terminal fragments will be supported when 0.3 lands. I implemented this in #288. In our first draft we oriented ourselves at how Chevrotain accepts token definitions, which is in Regex format. |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Langium seems to accept them but I don't know if I can use them. Also they seem to mess up the parser anyhow.
e.g.
My terminal NUMBER no longer works if I introduce the fragment but the grammar generates fine?
I've only just realized Langium is using regular expressions for it's terminals and XText uses Extended Backus-Naur Form-like (EBNF) expressions.
I keep learning :)
All reactions