NAME
Logic::Expr - logical expression parsing and related routines
SYNOPSIS
use Logic::Expr::Parser;
# Parser::MGC also supports "from_file"
my $le = Logic::Expr::Parser->new->from_string('Xv~Y');
# and then see Logic::Expr for uses of the $le object
DESCRIPTION
This module parses logic expressions and returns a Logic::Expr object, which in turn has various methods for acting on the expression thus parsed.
Parser::MGC is the parent class used to parse the expressions; from_string and from_file are the most relevant methods.
SYNTAX SANS EBNF
The usual atomic letters (X
, Y
, etc) are extended to include words in captial letters to allow for more than 26 atoms, or at least more descriptive names.
Operators include !
or ~
for negation of the subsequent atom or parenthesized term, and the binary operators
| v or TTTF lojban .a
& and TFFF lojban .e
-> conditional TFTT lojban .a with first term negated
== biconditional TFFT lojban .o
which taken together allow for such expressions as
X&!Y
X|~Y
GILBERT&SULLIVAN
(CATvDOG)->FISH
ETC
MINUTIAE
- on_parse_end
-
Internal Parser::MGC hook function.
- on_parse_start
-
Internal Parser::MGC hook function.
- parse
-
Internal Parser::MGC function.
- parse_term
-
Called by the internal Parser::MGC function.
BUGS
None known.
COPYRIGHT AND LICENSE
Copyright 2022 Jeremy Mates
This program is distributed under the (Revised) BSD License: https://opensource.org/licenses/BSD-3-Clause