File Query Tool

After months of delay, I’ve finally produced something useful.  I’ve written the tool I mentioned in my previous post, and I implemented the usage in the same way I described (with a few modifications).

This is the usage instructions I provided with the application.  Note that “and” always has higher precedence than “or”, and there’s no way to change that.

usage: filesql.pl -d{delim} select where {CONDITIONGROUP}
usage: filesql.pl -d{delim} update set -f{number} = {TERMINAL} \
       [-f{number} = {TERMINAL} ...] [where {CONDITIONGROUP}]
usage: filesql.pl -d{delim} delete where {CONDITIONGROUP}

{CONDITIONGROUP} := {ANDGROUP} [or {ANDGROUP} ...]
{ANDGROUP}       := {CONDITION} [and {CONDITION} ...]
{CONDITION}      := {TERMINAL} {OPERATOR} {TERMINAL}
{TERMINAL}       := -f{number} | {constant}
{OPERATOR}       := -eq | -ne | -gt | -lt | -ge | -le

filesql.pl

Leave a Comment