void main(){
printf("Input target code path ===> ");
scanf("%s", &input);
openFile = fopen(input, "r");

if(!openFile) printf("FILE NOT FOUND!!!\n");
else {
printf("PARSER MADE BY TAMKANG STUDENT (490196127)\n");
printf("===============================================================\n");

while(fgets(buffer, ARRAY_SIZE, openFile)!=NULL){
token = strtok(buffer, " ");


memset(temp, '\0',ARRAY_SIZE);
for(i=0; i<=strlen(token); i++){

nextTok = token[i+1];
nextTwo = token[i+2];

if(isspace(token[i])) continue;

else if(ispunct(token[i]) && !(token[i]=='+' || token[i]=='-' ||
token[i]=='(' || token[i]==')' || token[i]==':' ||
token[i]=='=' || token[i]==',' || token[i]==';' || token[i]=='$')){
printf("SYNTAX ERROR!\n");
fclose(openFile);
}

else if(token[i]=='(' || token[i]==')' || token[i]==';'){
if(!LParenFlag && !RParenFlag) printf("Rule 9 : <primary> ::= ( <expression> )\n");
if(token[i]=='('){
printf(" LPAREN(() is matched\n");
expressionFlag = false;
LParenFlag=true;
}
else if(token[i]==')'){
printf(" RPAREN ()) is matched\n");
RParenFlag=true;
}
else if(token[i]==';'){
printf(" SEMICOLON (;) is matched\n");
assignOpFlag=false;
LParenFlag=false;
readFlag=false;
expressionFlag=false;
}
}

else if(isalnum(token[i]) || ispunct(token[i])){
if(token[i]=='-' && nextTok=='-' &&
(isalnum(nextTwo) || ispunct(nextTwo))){
break;
}

else if(isdigit(token[i]) && isdigit(nextTok)){
temp[s]=token[i];
s++;
}

else if(isdigit(token[i]) && !isdigit(nextTok) && readFlag==false && assignOpFlag==true){
temp[s]=token[i];
s=0;
expression(temp);
memset(temp, '\0',ARRAY_SIZE);
}

else if(isalpha(token[i]) && isalpha(nextTok)){
temp[s]=token[i];
s++;
}

else if(isalpha(token[i]) && !isalpha(nextTok) && readFlag==false && assignOpFlag==false){
temp[s]=token[i];
s=0;
program(temp);
memset(temp, '\0',ARRAY_SIZE);
}

else if(isalpha(token[i]) && !isalpha(nextTok) && assignOpFlag==true){
temp[s]=token[i];
s=0;
expression(temp);
memset(temp, '\0',ARRAY_SIZE);
}

else if(isalpha(token[i]) && !isalpha(nextTok) && readFlag==true){
temp[s]=token[i];
s=0;
id_list(temp);
memset(temp, '\0',ARRAY_SIZE);
}
}
}
}
}
}

this is a micro compiler program, the idea is to read a source code (example.mic) and process the output. my program can run IF the input is a nonspace string (like "read(A);") but can't run if the input have a white space("read ( A ) ;").
how to clear all the white spaces? help please...

PS: the complete source code ==>http://guni.adsldns.org/index.htm