Are terminal fragments supported? #365
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. |
Beta Was this translation helpful? Give feedback.
-
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 :)
Beta Was this translation helpful? Give feedback.
All reactions