nikodemus/esrap — pull request #18 by scymtym (2013-01-21 02:26:17+00:00)
Title: add EXPRESSION-CASE; simplify expression processing

In the "grammar object" branch, I forgot to handle the new ``CHARACTER-RANGES`` in ``VALIDATE-EXPRESSION`` . Rather than just fixing that, I tried to address the problem of changing expression constructors more generally. The idea is using the ``EXPRESSION-CASE`` macro whenever dispatch based on expression constructors is needed. This way, we can check that all constructors are handled. It also simplifies the code.

Commit message:
```
add EXPRESSION-CASE; simplify expression processing

* EXPRESSION-CASE is a bit like CL:TYPECASE but clauses correspond to
Esrap expression constructors. EXPRESSION-CASE ensures that all
expression constructors are handled (unless there is a
catch-all-clause) and that processed expressions are valid.

* INVALID-EXPRESSION-ERROR is a new error condition which is signaled
when an invalid expression is encountered.

* CHARACTER-RANGE is a new type which simplifies validation of
CHARACTER-RANGES expressions.

* *EXPRESSION-KINDS* is a new global variable which stores all
available expression constructors and the corresponding types.

* Rename VALIDATE-EXPRESSION -> CHECK-EXPRESSION since it acts like
CL:CHECK-TYPE. Unused function VALIDATE-CHARACTER-RANGE has
been removed.

* In addition, use EXPRESSION-CASE in %EXPRESSION-DEPENDENCIES,
%EXPRESSION-DIRECT-DEPENDENCIES, EVAL-EXPRESSION and
COMPILE-EXPRESSION

* New tests: DEFRULE.CHECK-EXPRESSION, PARSE.STRING and
PARSE.CASE-INSENSITIVE
```