Bug 60732 - [Help Wanted][Parser] not working at all w/Lex & Yacc
Summary: [Help Wanted][Parser] not working at all w/Lex & Yacc
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2004-05-03 08:03 EDT by Toma-Julian Teves CLA
Modified: 2020-09-04 15:23 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Toma-Julian Teves CLA 2004-05-03 08:03:29 EDT
Hello,

I'm using Eclipse Platform: Version: 3.0.0, Build id: 200403261517 and CDT 2.0 
M8.

I have ecnountered problems with the refactoring functionality of CDT. Its not 
working at all.

I work with a small standard make C project( less 15 files ), created 
automatically from an existing directory. I'm using header files where I 
declare types and functions.

Renaming from the header file(function declaration):
- Error message which says that the C-file where the function is defined has 
syntax errors.

Renaming from the C file(function definition):
- Error message which says that the h-file where the function is declared has 
syntax errors.

The GCC compiler doesn't report any syntax errors or warnings for these files.

Renaming a type declaration:
- only the selected type is renamed, references are not renamed
Comment 1 John Camelon CLA 2004-05-03 11:16:19 EDT
Have you set up your include paths and preprocessor definitions for the 
project?  There is a property on Standard Make Projects that allow CDT to set 
these up for you.  

If you have set things up properly, I'd appreciate a code example that fails 
for you.  Thanks.
Comment 2 Toma-Julian Teves CLA 2004-05-05 03:42:25 EDT
Hello,

sorry for the delayed reply.

Yes, the paths are correct. But it still doesn't work.

Here an example:

In the root directory I have following header file:

--------------------------------------------
hlp_funcs.h ( only a part of it )

#ifndef HLP_FUNCS_H
#define HLP_FUNCS_H

...

void DBG_PRINTF(char *format, ...);

...

#endif
--------------------------------------------

and following source file:

--------------------------------------------
hlp_funcs.c

#include "hlp_funcs.h"
#include ...

...

void DBG_TRACE(char *format, ...)
{
  va_list ap;

  va_start(ap, format);
  vprintf(format, ap);
  va_end(ap);
  fflush(stdout);
}

...

---------------------------------------------

The behavoiur is as already described, I get messages with syntax errors while 
trying to rename e.g. the function "DBG_TRACE(...)".

Here the error messages for one attempt to rename the function( starting from 
src file):

"All resources have been excluded from refactoring. Cannot proceed"
"This refactoring cannot be performed correctly due to syntax errors in the 
translation unit. To perform this operation you will need to fix the errors."
"This refactoring cannot be performed correctly due to syntax errors in the 
translation unit. To perform this operation you will need to fix the errors."
"\Parser\hlp_funcs.c" has syntax errors. Content of that file will not be 
updated"
"\Parser\hlp_funcs.h" has syntax errors. Content of that file will not be 
updated"

For each error entry, there is no problem context available.


As I already mentioned, compiling the source code with gcc succeeds without 
warnings or errors.

Hope I could give you some more information,

Bye
Comment 3 John Camelon CLA 2004-05-05 12:21:14 EDT
Are DBG_TRACE and DBG_PRINTF supposed to reference one another?  

What appears to be happening is that somewhere there is a parse error and 
refactoring is using this as rationale to not continue on that particular 
file.  

Perhaps once we add some annotations (markers) to let you know what the 
problems encountered are we can figure out the defect better without having 
you mail me your entire source tree.  
Comment 4 Toma-Julian Teves CLA 2004-05-06 04:37:46 EDT
Hello,

sorry, I made a little mistake. I copied the wrong function prototype into the 
example section. Of course it's the same function "DBG_TRACE", in declaration 
and definition.

But the problem is always the same for each function I want to rename, it's not 
related one certain function.
Comment 5 Toma-Julian Teves CLA 2004-05-10 13:59:00 EDT
I do not exactly know if its relevant for your investigation on this problem, 
but I'm working on a simple ansi c parser. I'm using flex and yacc for the 
generation of the scanner and parser.

I have added the flex and yacc sources to the file association table, these 
sources are displayed as C source code. Beneath the regular flex or yacc 
syntax there is also C code in these source files, which I want to be 
displayed as C code. This is working very well.

Maybe the internal CDT parser has a problem with these files, because they 
contain non C tokens.
Comment 6 John Camelon CLA 2004-05-10 14:27:09 EDT
Yes, I would say that it is significant that you are using Lex and Yacc in 
your project.  I'll keep the defect open until we get annotations working so 
that refactoring can make better educated decisions as to whether or not to 
complete a transformation.  
Comment 7 John Camelon CLA 2004-09-08 16:37:30 EDT
These failures come up while testing Ethereal. 
Comment 8 Chris Recoskie CLA 2007-05-29 22:30:28 EDT
Nobody is currently looking at supporting Lex and YACC.  The community will have to step up if someone wants to see this addressed.
Comment 9 Doug Schaefer CLA 2007-08-21 10:56:20 EDT
Future means you commit to fix it in the Future. Inboxes can't make committments. Moving to '--'.