deps/kb_meme/meme-5.0.1/src/diagram.c
/* read an integer of single character from the buffer named "diagram" */
read an integer of single character from the buffer named "diagram"
read an integer of single character from the buffer named " diagram "
int yylex() {
  int c;
  int is_number = 0;
  int number = 0;
  while (((c = diagram[dptr++]) != '\0') && isdigit(c)) {
    number = 10*number + c-'0';
    is_number = 1;
  }
  if (is_number) {
    dptr--;			
    yylval = number;
    return NUMBER;
  } else if (c == '\0') {
    return DONE;
  } else {
    return c;
  }
}
int yylex ( ) { int c ; int is_number = 0 ; int number = 0 ; while ( ( ( c = diagram [ dptr ++ ] ) != ' \0 ' ) && isdigit ( c ) ) { number = 10 * number + c - ' ' ; is_number = 1 ; } if ( is_number ) { dptr -- ; yylval = number ; return NUMBER ; } else if ( c == ' \0 ' ) { return DONE ; } else { return c ; } }
read an integer of single character from the buffer named "diagram"
read an integer of single character from the buffer named " diagram "
/* parse the token */ /*printf("dptr %d c %c\n", dptr, c);*/ /* return the token */ /* put back non-number terminator */ /*printf("NUMBER: returning %d\n", number);*/ /*printf("DONE: returning %d\n", DONE);*/ /*printf("returning %d\n", c);*/