Mirror of the Rel4tion website/wiki source, view at <http://rel4tion.org>

[[ 🗃 ^yEzqv rel4tion-wiki ]] :: [📥 Inbox] [📤 Outbox] [🐤 Followers] [🤝 Collaborators] [🛠 Commits]

Clone

HTTPS: git clone https://vervis.peers.community/repos/yEzqv

SSH: git clone USERNAME@vervis.peers.community:yEzqv

Branches

Tags

master :: projects / razom / architecture /

parsing.mdwn

Purpose

Design the file parser architecture from the bottom up.

Plan

Assume I have an event-driven sequential access YAML parser, like the SAX parser for XML.

On top of that, I implement a wrapper specific for my language here, which works in the same way: sequential access and callbacks.

On top of that, I implement a parser which reads a file into an in-memory structure, like a DOM parser for XML. It is implemented using the SAX-like parser, with callbacks that I write which gradually fill the structure and build a graph.

One of the above two is also then used as a basis for a parser which reads a file and writes into a semantic database.

The SAX-like process can be implemented in three levels:

  1. A class template, where callbacks are template parameters (can be lambdas, functors, function pointers, etc.)
  2. Callbacks are std::function (like slots in gtkmm/sigc++), can be an instantiation of the above template
  3. OOP wrapper where callbacks are virtual functions, like the SAX parser in libxml++

Summary

SAX-like parser for YAML
SAX-like parser for Idan
	Template with callbacks as parameters
	Callbacks are std::function slots
	OOP wrapper with callbacks as virtual functions
DOM-like parser which reads into in-memory model
Parser which reads file definitions into semantic database
[See repo JSON]