Click here to Skip to main content
15,891,529 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: TextBox->ResetText () question??? Pin
toxcct20-May-05 0:56
toxcct20-May-05 0:56 
GeneralRe: TextBox->ResetText () question??? Pin
ThatsAlok20-May-05 0:57
ThatsAlok20-May-05 0:57 
GeneralRichEdit Control Problem! Pin
Waleed Eissa20-May-05 0:12
Waleed Eissa20-May-05 0:12 
GeneralRe: RichEdit Control Problem! Pin
Luis Mejia20-May-05 5:18
Luis Mejia20-May-05 5:18 
GeneralRe: RichEdit Control Problem! Pin
Waleed Eissa21-May-05 12:40
Waleed Eissa21-May-05 12:40 
GeneralDocking ControlBars Pin
stevy8219-May-05 23:04
stevy8219-May-05 23:04 
GeneralRe: Docking ControlBars Pin
stevy8226-May-05 22:23
stevy8226-May-05 22:23 
Generallexx/flexx question Pin
Maxime Labelle19-May-05 21:55
Maxime Labelle19-May-05 21:55 
Hi,

Please, forgive me to post to this specific forum. If that is not appropriate, could you point me to some more relevant place?

I'm a complete newbie in using lexx/yacc -like tools in order to build a syntax highlighter add-on to Visual Studio .NET. The thing that is bugging me is that:

each time the lexer recognizes a token, I cannot reliably retrieve the starting position of the matched text in the input string. I'm using something like this that fails for alternate start states in the lexer :

<br />
		std::string line;<br />
		...<br />
		int a_token;<br />
		int a_pos = 0;<br />
<br />
		while ((a_token = m_lexer.yylex()) != 0) {<br />
<br />
			int pos = line.find(m_lexer.YYText(), a_pos);<br />
			int end = pos + m_lexer.YYLeng();<br />
<br />
			a_pos = end + 1;<br />


The code works almost correctly most of the time (although it doesn't seem right). But it crashes for the input grammar :

<br />
%x single_quotes_string<br />
single_quote		''<br />
%%<br />
'                          { BEGIN(single_quotes_string); }<br />
<br />
<single_quotes_string>{<br />
  [^'\n]*|{single_quote}*  /* eat quotes, interpret doubled quotes */<br />
  '                        BEGIN(INITIAL); return TK_STRING; }<br />
  \n                       { BEGIN(INITIAL); return TK_STRING; }<br />
}<br />
%%<br />
<br />




--
Maxime Labelle
maxime.labelle@freesurf.fr
GeneralRegCreateKeyEx Pin
Its due when19-May-05 21:06
Its due when19-May-05 21:06 
GeneralRe: RegCreateKeyEx Pin
GDavy19-May-05 21:52
GDavy19-May-05 21:52 
GeneralAccessing to parent view Pin
doctorpi19-May-05 21:02
doctorpi19-May-05 21:02 
GeneralRe: Accessing to parent view Pin
GDavy19-May-05 21:12
GDavy19-May-05 21:12 
GeneralRe: Accessing to parent view Pin
doctorpi19-May-05 22:26
doctorpi19-May-05 22:26 
GeneralRe: Accessing to parent view Pin
GDavy19-May-05 22:29
GDavy19-May-05 22:29 
GeneralRe: Accessing to parent view Pin
Tom Archer20-May-05 17:08
Tom Archer20-May-05 17:08 
GeneralC++ Client for Microsoft Excel Pin
AnuradhaCpp19-May-05 20:11
AnuradhaCpp19-May-05 20:11 
GeneralRe: C++ Client for Microsoft Excel Pin
David Crow20-May-05 2:04
David Crow20-May-05 2:04 
QuestionHow to show the Application's icon in the Local disk Pin
wwwht19-May-05 20:06
wwwht19-May-05 20:06 
GeneralCFile::UnlockRange () exception problem Pin
NeoHobbit19-May-05 19:44
NeoHobbit19-May-05 19:44 
GeneralCommunication Pin
usmanmir19-May-05 18:43
usmanmir19-May-05 18:43 
GeneralRe: Communication Pin
Christian Graus19-May-05 18:49
protectorChristian Graus19-May-05 18:49 
GeneralRe: Communication Pin
ThatsAlok19-May-05 19:01
ThatsAlok19-May-05 19:01 
GeneralRe: Communication Pin
Michael Dunn19-May-05 19:58
sitebuilderMichael Dunn19-May-05 19:58 
GeneralRe: Communication Pin
ThatsAlok19-May-05 20:03
ThatsAlok19-May-05 20:03 
GeneralRe: Communication Pin
usmanmir19-May-05 19:02
usmanmir19-May-05 19:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.