Saturday, June 10, 2017

Parsing Expression Grammars

Parsing Expressions Grammar PEG are a (no longer so) new approach to parsing. Clibutl offers a set of functions to write parsers in C without having to use an external "parser generator". Rather than a dry list of functions, I'll present here a short tutorial on how to build a simple parser. The...

Thursday, January 19, 2017

Exceptions Handling - Mechanics

I've posted (quite some time ago) a description of the try/catch blocks provided by clibutl. I guess it's now the time to look under the hood and see at the implementation. Below is the code, we'll go through it in the following sections. typedef struct utl_jb_s { jmp_buf jmp; struct...

Saturday, January 14, 2017

Tracing Tests

Having read an interesting blog article by Kartik Agaram about using traces for testing, I decided to add this capability to c-libutl. On top of the existing logging functions: logerror() for messages that report about critical failures; logwarning() for messages that report about potential issues...