/*
* Return the next lexical element in the string s.
* Passing NULL into s, will cause the lexer to read the next element out
* of the last string passed in.
*/
LexicalElement
nextElement(char *s) {
static char *ptr = 0x00;
LexicalElement result;
//handle pointer reset
if(s)
ptr=s;
//check for the end of the string
if(!ptr || !*ptr) {
goto EOS_REACHED;
}
//skip white space
while(*ptr && isspace(*ptr)) ptr++;
//check for the null terminator
if(!*ptr) {
goto EOS_REACHED;
}