On my input I have stream of characters which are not separated by any delimiter, like this:
input = "150001"
I want to make parser(using JISON), which tokenize based on position and length, this should be my tokens:
15 - system id (first 2 numbers)
0001 - order num (4 numbers after)
Can you give me some advice how can I accomplish this, I tried to add my tokens like this:
%lex
%%
[0-9]{2} return "SYSTEM_ID"
[0-9]{4} return "ORDER_NUM"
\lex
%%
But as expected this is not working :)
Is there some way to parse this kind of inputs, where you parse by length of characters ?