Posts in rough

QuickNote: Arpeggio

In this short QuickNote, we give a bit of info on Arpeggio; a python package to implement a (PEG) parser. Eventually, the parser is written in Castle – like all Workshop Tools. To kickstart, we use python and python-packages. Where arpeggio is one of the options.

As Arpeggio is quite well documented this is a short note. We also describe some differences with the Pegen package.

Read more ...

QuickNote: PEGEN

To implement CCastle we need a parser, as part of the compiler. Eventually, that parser will be written in Castle. For now, we kickstart it in python; which has several packages that can assist us. As we like to use a PEG one, there are a few options. Arpeggio is well known, and has some nice options – but can’t handle left recursion – like most PEG-parsers.

Recently python itself uses a PEG parser, that supports left recursion (which is a recent development). That parser is also available as a package: pegen; but hardly documented.

Read more ...

kwargs als argument

Elke python-programmeur kent het kwargs concept, waarmee een variabel aantal named- (of ‘keyword’) argumenten ontvangen kan worden in een functie. Soms wordt dit concept echter onhandig gebruikt.

Read more ...