149 for(ind=this->
progsize; ind-- != 0;)
151 this->startp[0] = rxp.
startp[0];
152 this->endp[0] = rxp.
endp[0];
197 this->endp[0] == rxp.
endp[0]);
266 #define END 0 // no End of program. 267 #define BOL 1 // no Match "" at beginning of line. 268 #define EOL 2 // no Match "" at end of line. 269 #define ANY 3 // no Match any one character. 270 #define ANYOF 4 // str Match any character in this string. 271 #define ANYBUT 5 // str Match any character not in this 273 #define BRANCH 6 // node Match this alternative, or the 275 #define BACK 7 // no Match "", "next" ptr points backward. 276 #define EXACTLY 8 // str Match this string. 277 #define NOTHING 9 // no Match empty string. 278 #define STAR 10 // node Match this (simple) thing 0 or more 280 #define PLUS 11 // node Match this (simple) thing 1 or more 282 #define OPEN 20 // no Mark this point in input as start of 285 #define CLOSE 30 // no Analogous to OPEN. 321 #define NEXT(p) (((*((p)+1)&0377)<<8) + (*((p)+2)&0377)) 322 #define OPERAND(p) ((p) + 3) 329 #define UCHARAT(p) ((const unsigned char*)(p))[0] 332 #define FAIL(m) { regerror(m); return(NULL); } 333 #define ISMULT(c) ((c) == '*' || (c) == '+' || (c) == '?') 334 #define META "^$.[()|?+*\\" 340 #define HASWIDTH 01 // Known never to match null string. 341 #define SIMPLE 02 // Simple enough to be STAR/PLUS operand. 342 #define SPSTART 04 // Starts with * or +. 343 #define WORST 0 // Worst case. 413 printf (
"ossimRegExp::compile(): No expression supplied.\n");
425 printf (
"ossimRegExp::compile(): Error in compile.\n");
433 printf (
"ossimRegExp::compile(): Expression too big.\n");
446 printf (
"ossimRegExp::compile(): Out of memory.\n");
469 else if (
OP(scan) ==
BOL)
483 for (; scan != NULL; scan =
regnext(scan))
486 len = (
unsigned long)strlen(
OPERAND(scan));
517 printf (
"ossimRegExp::compile(): Too many parentheses.\n");
554 for (br = ret; br != NULL; br =
regnext(br))
560 printf (
"ossimRegExp::compile(): Unmatched parentheses.\n");
563 else if (!paren && *
regparse !=
'\0') {
566 printf (
"ossimRegExp::compile(): Unmatched parentheses.\n");
571 printf (
"ossimRegExp::compile(): Internal error.\n");
638 if (!(flags &
HASWIDTH) && op !=
'?') {
640 printf (
"ossimRegExp::compile() : *+ operand could be empty.\n");
645 if (op ==
'*' && (flags &
SIMPLE))
647 else if (op ==
'*') {
655 else if (op ==
'+' && (flags &
SIMPLE))
657 else if (op ==
'+') {
665 else if (op ==
'?') {
676 printf (
"ossimRegExp::compile(): Nested *?+.\n");
728 if (rxpclass > rxpclassend + 1) {
730 printf (
"ossimRegExp::compile(): Invalid range in [].\n");
733 for (; rxpclass <= rxpclassend; rxpclass++)
744 printf (
"ossimRegExp::compile(): Unmatched [].\n");
752 ret =
reg(1, &flags);
761 printf (
"ossimRegExp::compile(): Internal error.\n");
767 printf (
"ossimRegExp::compile(): ?+* follows nothing.\n");
772 printf (
"ossimRegExp::compile(): Trailing backslash.\n");
788 printf (
"ossimRegExp::compile(): Internal error.\n");
792 if (len > 1 &&
ISMULT(ender))
894 offset = (
const char*)scan - val;
897 *(scan + 1) = (offset >> 8) & 0377;
898 *(scan + 2) = offset & 0377;
951 if(!
string)
return false;
957 printf (
"ossimRegExp::find(): Compiled regular expression corrupted.\n");
964 while ((s = strchr(s, this->
regmust[0])) != NULL) {
984 while ((s = strchr(s, this->
regstart)) != NULL) {
995 }
while (*s++ !=
'\0');
1007 const char* *end,
const char* prog) {
1018 for (i =
NSUBEXP; i > 0; i--) {
1049 while (scan != NULL) {
1075 len = (int)strlen(opnd);
1076 if (len > 1 && strncmp(opnd,
reginput, len) != 0)
1166 }
while (scan != NULL &&
OP(scan) ==
BRANCH);
1186 min_no = (
OP(scan) ==
STAR) ? 0 : 1;
1189 while (no >= min_no) {
1191 if (nextch ==
'\0' || *
reginput == nextch)
1206 printf (
"ossimRegExp::find(): Internal error -- memory corrupted.\n");
1217 printf (
"ossimRegExp::find(): Internal error -- corrupted pointers.\n");
1234 count = (int)strlen(scan);
1238 while (*opnd == *scan) {
1244 while (*scan !=
'\0' && strchr(opnd, *scan) != NULL) {
1250 while (*scan !=
'\0' && strchr(opnd, *scan) == NULL) {
1257 printf (
"ossimRegExp::find(): Internal error.\n");
1279 return (p - offset);
1281 return (p + offset);
1296 return (p - offset);
1298 return (p + offset);
void regtail(char *, const char *)
int regtry(const char *, const char **, const char **, const char *)
int regmatch(const char *)
void regoptail(char *, const char *)
const char * regnext(const char *)
int regrepeat(const char *)
const char * startp[NSUBEXP]
const unsigned char MAGIC
bool operator==(const ossimRegExp &) const
unsigned int ossim_uint32
void compile(const char *)
ossim_uint32 start() const
void reginsert(char, char *)
const char * searchstring
bool deep_equal(const ossimRegExp &) const
const char * endp[NSUBEXP]