<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: [CEDET-devel] CEDET - Semantic parsing problem...</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>Hello David. This does indeed fix the issue!! Thank =
you.</FONT>
</P>
<P><FONT SIZE=3D2> -------------</FONT>
<BR><FONT SIZE=3D2> Javier</FONT>
<BR><FONT SIZE=3D2> </FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: David PONCE [<A =
HREF=3D"mailto:david.ponce@...>=
] </FONT>
<BR><FONT SIZE=3D2>Sent: Tuesday, June 29, 2004 8:25 AM</FONT>
<BR><FONT SIZE=3D2>To: joviedo@...>
<BR><FONT SIZE=3D2>Cc: cedet-devel@...>
<BR><FONT SIZE=3D2>Subject: Re: [CEDET-devel] CEDET - Semantic parsing =
problem...</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Hi Javier,</FONT>
</P>
<P><FONT SIZE=3D2>I am sorry for the long delay to reply to your =
request.</FONT>
</P>
<P><FONT SIZE=3D2>[...]</FONT>
<BR><FONT SIZE=3D2>> I'm seeing a problem with a particular =
statement in a C-file. In it's </FONT>
<BR><FONT SIZE=3D2>> current form, the methods buffer in ecb does =
not show any functions </FONT>
<BR><FONT SIZE=3D2>> that are in the c-file. In the acual buffer I =
see those red underlines </FONT>
<BR><FONT SIZE=3D2>> everywhere in this buffer. From my =
understanding, those come from </FONT>
<BR><FONT SIZE=3D2>> semantic-show-unmatched-syntax-mode and this in =
turn causes the </FONT>
<BR><FONT SIZE=3D2>> methods buffer to not show any methods. I have =
narrowed it down to a </FONT>
<BR><FONT SIZE=3D2>> particular expression.</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> Currently there is the #ifdef expression shown =
immediately below. This </FONT>
<BR><FONT SIZE=3D2>> sits near the top of the file. This is a legal =
expression in C and the </FONT>
<BR><FONT SIZE=3D2>> compiler has no problems handling it. When I =
have this in the file, </FONT>
<BR><FONT SIZE=3D2>> semantic seems to now understand the syntax. =
#if ((SOME_POUND_DEFINE1 </FONT>
<BR><FONT SIZE=3D2>> * SOME_POUND_DEFINE2) > \</FONT>
<BR><FONT SIZE=3D2>> =
(SOME_POUND_DEFINE3))</FONT>
<BR><FONT SIZE=3D2>> # error We should never get here!!</FONT>
<BR><FONT SIZE=3D2>> #endif</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> If I now modify the #ifdef to look like this, =
semantic seems to like </FONT>
<BR><FONT SIZE=3D2>> it and the methods now appear in the ecb =
methods buffer. I do not see </FONT>
<BR><FONT SIZE=3D2>> any of those annoying red underlines. :-) #if =
((SOME_POUND_DEFINE1 * </FONT>
<BR><FONT SIZE=3D2>> SOME_POUND_DEFINE2) > (SOME_POUND_DEFINE3)) =
# error We should never </FONT>
<BR><FONT SIZE=3D2>> get here!! #endif</FONT>
<BR><FONT SIZE=3D2>> </FONT>
</P>
<P><FONT SIZE=3D2>I think the problem was in the semantic C lexer, that =
didn't correctly handle preprocessor statements.</FONT>
</P>
<P><FONT SIZE=3D2>Please could you try the following patch to =
semantic/bovine/semantic-c.el, and tell me if it solves the =
issue?</FONT>
</P>
<P><FONT SIZE=3D2>Regards.</FONT>
<BR><FONT SIZE=3D2>David</FONT>
</P>
<P><FONT SIZE=3D2>Index: semantic-c.el =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT>
<BR><FONT SIZE=3D2>RCS file: =
/cvsroot/cedet/cedet/semantic/bovine/semantic-c.el,v</FONT>
<BR><FONT SIZE=3D2>retrieving revision 1.30</FONT>
<BR><FONT SIZE=3D2>diff -c -r1.30 semantic-c.el</FONT>
<BR><FONT SIZE=3D2>*** =
semantic-c.el 5 Apr 2004 02:05:43 =
-0000 1.30</FONT>
<BR><FONT SIZE=3D2>--- =
semantic-c.el 29 Jun 2004 12:18:58 =
-0000</FONT>
<BR><FONT SIZE=3D2>***************</FONT>
<BR><FONT SIZE=3D2>*** 49,58 ****</FONT>
<BR><FONT SIZE=3D2> (setq semantic-lex-end-point =
(point))</FONT>
<BR><FONT SIZE=3D2> nil)</FONT>
<BR><FONT SIZE=3D2> </FONT>
<BR><FONT SIZE=3D2> (define-lex-regex-analyzer =
semantic-lex-c-if</FONT>
<BR><FONT SIZE=3D2> "Ignore various forms of =
#if/#else/#endif conditionals."</FONT>
<BR><FONT SIZE=3D2> =
"^#\\(if\\(def\\)?\\|el\\(if\\|se\\)\\|endif\\)"</FONT>
<BR><FONT SIZE=3D2>! (when (bolp) (end-of-line))</FONT>
<BR><FONT SIZE=3D2> (setq semantic-lex-end-point =
(point))</FONT>
<BR><FONT SIZE=3D2> nil)</FONT>
<BR><FONT SIZE=3D2> </FONT>
<BR><FONT SIZE=3D2>--- 49,77 ----</FONT>
<BR><FONT SIZE=3D2> (setq semantic-lex-end-point =
(point))</FONT>
<BR><FONT SIZE=3D2> nil)</FONT>
<BR><FONT SIZE=3D2> </FONT>
<BR><FONT SIZE=3D2>+ ;;; Compatibility</FONT>
<BR><FONT SIZE=3D2>+ ;;</FONT>
<BR><FONT SIZE=3D2>+ (if (fboundp 'c-end-of-macro)</FONT>
<BR><FONT SIZE=3D2>+ (defalias =
'semantic-c-end-of-macro 'c-end-of-macro)</FONT>
<BR><FONT SIZE=3D2>+ ;; From cc-mode 5.30</FONT>
<BR><FONT SIZE=3D2>+ (defun semantic-c-end-of-macro =
()</FONT>
<BR><FONT SIZE=3D2>+ "Go to the end of a =
preprocessor directive.</FONT>
<BR><FONT SIZE=3D2>+ More accurately, move point to the end of the =
closest following line </FONT>
<BR><FONT SIZE=3D2>+ that doesn't end with a line continuation =
backslash.</FONT>
<BR><FONT SIZE=3D2>+ </FONT>
<BR><FONT SIZE=3D2>+ This function does not do any hidden buffer =
changes."</FONT>
<BR><FONT SIZE=3D2>+ (while (progn</FONT>
<BR><FONT =
SIZE=3D2>+ &n=
bsp; (end-of-line)</FONT>
<BR><FONT =
SIZE=3D2>+ &n=
bsp; (when (and (eq (char-before) ?\\)</FONT>
<BR><FONT =
SIZE=3D2>+ &n=
bsp; &n=
bsp; (not (eobp)))</FONT>
<BR><FONT =
SIZE=3D2>+ &n=
bsp; (forward-char)</FONT>
<BR><FONT =
SIZE=3D2>+ &n=
bsp; t))))</FONT>
<BR><FONT SIZE=3D2>+ )</FONT>
<BR><FONT SIZE=3D2>+ </FONT>
<BR><FONT SIZE=3D2> (define-lex-regex-analyzer =
semantic-lex-c-if</FONT>
<BR><FONT SIZE=3D2> "Ignore various forms of =
#if/#else/#endif conditionals."</FONT>
<BR><FONT SIZE=3D2> =
"^#\\(if\\(def\\)?\\|el\\(if\\|se\\)\\|endif\\)"</FONT>
<BR><FONT SIZE=3D2>! (semantic-c-end-of-macro)</FONT>
<BR><FONT SIZE=3D2> (setq semantic-lex-end-point =
(point))</FONT>
<BR><FONT SIZE=3D2> nil)</FONT>
<BR><FONT SIZE=3D2> </FONT>
</P>
</BODY>
</HTML>
|