lex.reg.c
/*
 *
 * _regNeedOp -- determine if we add a connecting operator for this segment
 *
 */
- determine if we add a connecting operator for this segment
- determine if we add a connecting operator for this segment
static int _regNeedOp(int i, char *s) {
  int c;
  if( s && *s ){
    c = *s;
    switch(c){
    case '&':
    case '|':
    case '=':
    case '!':
    case '<':
    case '>':
      return 0;
    default:
      break;
    }
  }
  for(i=i-1; i>=0; i--){
    if( !seg[i] || !seg[i]->s ){
      continue;
    }
    if( strcmp(seg[i]->s, "(") && strcmp(seg[i]->s, ")") ){
      break;
    }
  }
  if( i >= 0 ){
    c = seg[i]->s[strlen(seg[i]->s)-1];
    switch(c){
    case '&':
    case '|':
    case '=':
    case '!':
    case '<':
    case '>':
      return 0;
    default:
      return 1;
    }
  } else {
    return 0;
  }
}
static int _regNeedOp ( int i , char * s ) { int c ; if ( s && * s ) { c = * s ; switch ( c ) { case ' ' : case ' ' : case ' ' : case ' ' : case ' ' : case ' ' : return 0 ; default : break ; } } for ( i = i - 1 ; i >= 0 ; i -- ) { if ( ! seg [ i ] || ! seg [ i ] -> s ) { continue ; } if ( strcmp ( seg [ i ] -> s , " " ) && strcmp ( seg [ i ] -> s , " " ) ) { break ; } } if ( i >= 0 ) { c = seg [ i ] -> s [ strlen ( seg [ i ] -> s ) - 1 ] ; switch ( c ) { case ' ' : case ' ' : case ' ' : case ' ' : case ' ' : case ' ' : return 0 ; default : return 1 ; } } else { return 0 ; } }
_regNeedOp -- determine if we add a connecting operator for this segment
_regNeedOp -- determine if we add a connecting operator for this segment
/* check for operator in current string */ /* not in this string check for operator in previous */