<<< Quotes     Table Of Contents     quote(RL,RM,RR) generic quote >>>

Common Text Transformation Library http://cttl.sourceforge.net/

Quote evaluation rules

  1. If RL, RM, and RR represent opening, interior, and closing syntactic units of a quote

        quote( RL, RM, RR )

    then input symbols, corresponding to RL and RR sides, must be balanced, in order for the quote evaluation algorithm to succeed.

  2. Quote implements repeatable balanced search algorithm, alternating repeatable search evaluation between the expressions RL and RR.

  3. To keep the search for left and right symbols in balance,

  4. The parseable substring, visible by syntactic unit RM, represents the interior of the quote. As such, the interior substring is limited to the inner boundaries of the tokens matching RL and RR.

  5. The expression RM is evaluated only once. If balance between left and right expressions is never found, the evaluation of the quote fails, and the expression RM is never evaluated.

  6. Middle expression RM is not required to consume the entire parseable substring. As such, the expression RM is ungreedy. In order to complete successful evaluation of the quote grammar, it is sufficient for RM to match only the beginning part of the interior substring.

  7. The RM expression is evaluated by match evaluation algorithm. Failed RM result causes the quote evaluation to fail, as well.


Copyright © 1997-2009 Igor Kholodov mailto:cttl@users.sourceforge.net.

Permission to copy and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.



<<< Quotes     Table Of Contents     quote(RL,RM,RR) generic quote >>>