Is there any problem if absolute path is given as input while handling multiple inout files

"Vedpathak, Rameshwari IN BLR SISL" <[email protected]>
Newsgroups gmane.comp.lex.flex.general
Message-ID <4847DBE579D78B4A9C610E2EA77B463403BB480C@inblrk999msx.in002.siemens.net>
 
Hi all,
 
I have written a parser which gets all the function declarations present
in a C header file.
This parser should handle multiple input header files. i have wrriten a
code for this. it works perfectly if i give the inputs to it as just the
header filenames without the fule path i.e. in following way:
test.exe test1.h test2.h or test.exe test1.h
 
but the moment i give absolute path in below way, 
test.exe d:\tmp\out\test1.h
it does not scan the full file, it does not give error but does not scan
the file in proper way. And i am not able to debug why its is happening
like this.
 
It works if i run in normal way i.e. test.exe < d:\tmp\out\test1.h
below is the code which i have written to handle multiple input files.
 

	main(int argc, char *argv[])
	{ 
	 FILE  *inputFile;
	 char *tmpFile;
	 numOfFiles = argc - 1;
	 openFile();
	 fileList = argv+1;
	 currentFile = 0;
	  
	 if (argc == 2)
	 {
	  strcpy(tmpFile, argv[1]);
	  //inputFile = fopen(argv[1], "r");
	  printf("tmpFile: %s", tmpFile);
	  inputFile = fopen(tmpFile, "r");
	  yyin = inputFile;
	  currentFile = 1;
	 }
	 
	 if (argc > 2)
	 {
	  yywrap();
	 }
	 yyparse();
	 
	 closeFile();
	}
	 
	int yywrap()
	{
	 FILE  *inputFile;
	 strcpy(typeNames[0], "");
	 while(currentFile < numOfFiles)
	 { 
	  inputFile = fopen(fileList[currentFile], "r");
	  yyin = inputFile;
	  break;
	 }
	 if ((currentFile) == numOfFiles)
	  return 1;
	 else
	 { currentFile++;
	  return 0;
	 }
	}

 

Can anyone please help. 
If absolute path is given is there any probelm????
 
Regards,
Rameshwari

_______________________________________________
Help-flex mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-flex
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.