DEV Community

Discussion on: What are you working on?

Collapse
 
vimmer9 profile image
Damir Franusic

Personal growth in context of psychology; to better take care od myself and learn to ignore what should be considered a background noise. I'm also doing some Abstract Syntax Tree parser in Bison/Flex.

Collapse
 
deleteman123 profile image
Fernando Doglio

Congrats man, taking care of one's own mental health is definitely something everyone should be doing.
As for your AST parser, do you have it published somewhere? If you do, share the link!

Collapse
 
vimmer9 profile image
Damir Franusic • Edited

Not yet, I'll have to check with the company that hired me. It's licensed under Apache license so I assume it will become public when it's done. It's just a config parser but anyway, I am preparing an article about writing parsers using Flex as lexical analyser/tokeniser and Bison for parser generation based on BNF rules. Most examples don't handle the creation of AST but I find this to be crucial and most useful feature of any parser. I've done numerous parsers for DSLs(Domain Specific Languages) and configuration files and have some experience in that field. Of course you can, to some extent, produce similar results with string splitting and regexes, but sooner or later you will have to face the BNF syntax and use some form of parser generator. I prefer Flex/Bison combo since it's quite mature and used everywhere, even in Linux kernel. That's just my preference, some people prefer different tools like ANTLR for example.

Thread Thread
 
deleteman123 profile image
Fernando Doglio

Awesome! Looking forward to that article! Building parsers has always been in my To-Learn list, I've always wanted to build my own language. Maybe someday! Thanks for sharing :)