Summary
###########################################################################
File: caseless.icn
Subject: Procedures to perform caseless scanning
Author: Nevin J. Liber
Date: August 19, 1996
###########################################################################
This file is in the public domain.
###########################################################################
These procedures are analogous to the standard string-analysis
functions except that uppercase letters are considered equivalent to
lowercase letters.
anycl(c, s, i1, i2) succeeds and produces i1 + 1, provided
map(s[i1]) is in cset(map(c)) and i2 is
greater than i1. It fails otherwise.
balcl(c1, c2, c3, s, i1, i2) generates the sequence of integer
positions in s preceding a
character of cset(map(c1)) in
map(s[i1:i2]) that is balanced with
respect to characters in cset(map(c2))
and cset(map(c3)), but fails if there
is no such position.
findcl(s1, s2, i1, i2) generates the sequence of integer positions in
s2 at which map(s1) occurs as a substring
in map(s2[i1:i2]), but fails if there is no
such position.
manycl(c, s, i1, i2) succeeds and produces the position in s
after the longest initial sequence of
characters in cset(map(c)) within
map(s[i1:i2]). It fails if map(s[i1]) is not
in cset(map(c)).
matchcl(s1, s2, i1, i2) produces i1 + *s1 if
map(s1) == map(s2[i1+:=*s1]) but fails
otherwise.
uptocl(c, s, i1, i2) generates the sequence of integer positions in
s preceding a character of cset(map(c)) in
map(s[i1:i2]). It fails if there is no such
position.
Defaults: s, s2 &subject
i1 &pos if s or s2 is defaulted; otherwise 1
i2 0
c1 &cset
c2 '('
c3 ')'
Errors: 101 i1 or i2 not integer
103 s or s1 or s2 not string
104 c or c1 or c2 or c3 not cset
###############################################################################
Procedures:
anycl, balcl, findcl, manycl, matchcl, uptocl
This file is part of the (main) package.
Source code.
anycl(c, s, i1, i2)
: Caseless version of any()
balcl(c1, c2, c3, s, i1, i2)
: Caseless version of bal()
findcl(s1, s2, i1, i2)
: Caseless version of find()
manycl(c, s, i1, i2)
: Caseless version of many()
matchcl(s1, s2, i1, i2)
: Caseless version of match()
uptocl(c, s, i1, i2)
: Caseless version of upto()
This page produced by UniDoc on 2021/04/15 @ 23:59:54.