text parser library

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
User avatar
dponyatov@gmail.com
Posts: 5
Joined: Fri Jun 14, 2019 8:44 am

text parser library

Post by dponyatov@gmail.com » Fri Jun 14, 2019 8:52 am

Good day

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

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: text parser library

Post by jimmo » Fri Jun 14, 2019 10:36 am

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?

User avatar
dponyatov@gmail.com
Posts: 5
Joined: Fri Jun 14, 2019 8:44 am

Re: text parser library

Post by dponyatov@gmail.com » Fri Jun 14, 2019 11:25 am

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.

Post Reply