define switch function r-expression
as
    do scan #current-input
        match "+" term r-expression
        match "-" term r-expression
    done
    ;if not matched above, accept the empty string
    return true

Example 7: Right-recursive pattern function.

Back to Article