shaarli / netscape-bookmark-parser

PHP library to parse Netscape bookmark files
https://packagist.org/packages/shaarli/netscape-bookmark-parser
MIT License
22 stars 10 forks source link

Full rewrite with a lexer/parser grammar #41

Open virtualtam opened 7 years ago

virtualtam commented 7 years ago

It would be more elegant and maintainable to describe the Netscape variants as a grammar, and generate/write a corresponding tokenizer/lexer/parser to process data.

Inspired by:

See:

virtualtam commented 6 years ago

I've started experimenting with Hoa\Compiler, which is a PHP library to define grammars and generate the corresponding tokenizer/lexer/parser:

Documentation:

Example grammars:

virtualtam commented 6 years ago

Experiment code and notes can be found at https://github.com/virtualtam/hoa-netscape-bookmark-parser

virtualtam commented 6 years ago

Interesting use of the PHP DOMDocument API: