Page 1 of 1

text parser library

Posted: Fri Jun 14, 2019 8:52 am
by dponyatov@gmail.com
Good day

I don't see PLY in upip repositories. What lexer generator library (or PEG) can I use instead?

Re: text parser library

Posted: Fri Jun 14, 2019 10:36 am
by jimmo
You might find you can use an existing pure-Python library and run it directly. Have you tried running PLY directly in MicroPython? You might need to change a couple of things or provide some missing functions, but for the most part it's "just Python".

Lark might be another good option.

One of the main constraints is likely the RAM/ROM of the device you're running on. Which board/chip are you using?

Re: text parser library

Posted: Fri Jun 14, 2019 11:25 am
by dponyatov@gmail.com
I use embedded Linux starting from RT5350, and STM32 in plans.

For the current project, I found that making state machine in one-page hand-coded function looks much simpler than external libs (FORTH-like language for a few literal types). But maybe somebody in my team will want to use the more complex syntax. As a fallback variant, I has ragel and C module.