RE: Is there any problem if absolute path is given as input whilehandling multiple inout files

"Vedpathak, Rameshwari IN BLR SISL" <[email protected]>
Newsgroups gmane.comp.lex.flex.general
Message-ID <4847DBE579D78B4A9C610E2EA77B463403BB480F@inblrk999msx.in002.siemens.net>
I have tried with all the possible combinations of backslashes.
The main problem is that it does not give error message but it just does
not scan the file properly.
The output i get after running test.exe < test1.h is different from
test.exe d:\tmp\test1.h
 
 
Regards,
Rameshwari

________________________________

From: Thurn, Martin [mailto:[email protected]] 
Sent: Monday, October 17, 2005 6:30 PM
To: Vedpathak, Rameshwari IN BLR SISL
Subject: RE: Is there any problem if absolute path is given as input
whilehandling multiple inout files


  It probably has to do with the backslashes.  For starters, read the
man page for fopen, check for failure, check the error code.
 - - Martin


________________________________

	From: [email protected]
[mailto:[email protected]] On Behalf Of
Vedpathak, Rameshwari IN BLR SISL
	Sent: Monday, October 17, 2005 07:55
	To: [email protected]
	Subject: Is there any problem if absolute path is given as input
whilehandling multiple inout files
	
	
	 
	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.