[texhax] Little Languages and diaries

Gordon Haverland ghaverla at materialisations.com
Sat May 19 04:47:55 CEST 2018

On Sat, 19 May 2018 00:44:42 +0000
Mike Marchywka <marchywka at hotmail.com> wrote:

> I'm not entirely sure what little languages are but I have been using
> tex to create a diet diary that I later need to parse and graph.
> There is no money involved but vitamins coudl just as easily be
> money... So, I have to be consistent
> about my nominally free form entries. I enter them into a tex table
> rather than a csv file since that is my primary "lab notebook"
> document.  I ended up picking a simple adjective-noun restriction, a
> simple macro syntax and wrote c++ code to parse it but was curious if
> there is a general solution somewhere.  This has worked well compared
> to taking each day's meal notes and trying to use a GUI to put them
> into a DB and then get them back out etc. The c++ parse picks up
> entry errors as well as a GUI and has other benefits.  In theory I
> could enter them into a cell phone in the kitchen but I just use "vi"
> on a laptop. I think I asked about this on some other forum but got
> no responses.

I'm a number cruncher at heart.  But things like this, seem to involve
parsers like lex, flex, or the recursive descent parser in Perl
(CPAN).  The language that ledger speaks is quite restrictive, so I
would imagine that designing a language to speak that language would
not be too difficult.  The problem mostly revolves around the "name" of
the account an entry mentions.  Ledger has a lot of leniency in naming
accounts, and I expect that any sort of routine to pick ledger entries
out of a diary, has to first pick out the account names, and then look
to see if there are corrections to make in account names.

Maybe people have done this before?  So, I thought I would ask.

I hope that using a GUI to fix "corrections" isn't needed, as I am
horrible at writing GUI stuff.

But thanks for your ideas and feedback.


More information about the texhax mailing list