|
The lexical analyser achieves the
is by matching the input data to a set of regular expressions (rules). When it finds a match to a specific rule it executes some action code written by the programmer and then returns a token to the parser indicating which rule was matched. It may also return some data associated with the rule. For example, the regular expression. I browsed the URL {http://www.monmouth.com/~wstreett/lex-yacc/flex_1.html}
Lex201, Lex202, Lex203, Lex204 and lex205 are the lexical
analysers which i found from the above URL. Again This project was developed using Parser Generator from http://www.bumblebeesoftware.com which has versions of lex and yacc (actually called alex and ayacc) that can generate c++ classes. I don't expect that classical lex and yacc or flex and bison or flex++ or bison++ will be able to compile the source files. However, Bumble-bee Software provide a 30 day evaluation of Parser Generator program.
I browsed http://www.codeproject.com/cpp/introlexyacc.asp.
also, http://www.codeproject.com/cpp/lexyacc2.asp
I used the lexyacc.zip downloaded from the URL from
and did not find the "ylmtd.lib" for pre-compiling
CLexRC.l and CParse.y resouces.
PannetComp
|
|
|
|
|
Guys,
I'm a beginner with ATL and I have a few questions...
I wrote an ATL addin for MS word and found that its click event did not work with all open documents. I mean if i have multiple Word documents open, the click event only work with the first document.
I then checked the article provided by Microsoft and also Amit Dey's article on Outlook, all of them fail when multiple windows ofthe same application is open.
Any ideas on how to make an addin that will work under these conditions??????
|
|
|
|
|
[Message Deleted due to spam]
|
|
|
|
|
Are you building and registering the Proxy/Stub DLL correctly?
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
[Message Deleted due to spam]
|
|
|
|
|
That all sounds right.
What are the errors you are getting?
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hi
I am trying to write a Context Menu extension and I'm having some problems with it. I need it to have MFC support as well. The extension works fine without the MFC support but everytime I include it, it just stops working. There are no errors, the registration works fine, all regkeys are set.
But the menu does not appear when I right-click on an item. However it did appear without the MFC support...
I have initialized MFC manually whenever I use an exported function. I don't know what the problem could be...
I would appreciate any kind of help.
Thx Zs.
|
|
|
|
|
Hi
how to access the public data members of ATL class in another class in same project
Best Regards
jhon
|
|
|
|
|
look for CComObject template class!!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Here is my problem :
I have a MainFrame (declared like any other WTL main frame). This
mainframe is creating child windows depending on user input (so at
runtime). There is nothing wrong then.
As far as I understand the child windows shares the same message loop
as the main frame (and I can verify this by printing the Thread ID in
any message handler).
It is becoming a little bit tricky now. Because I have too many child
window, the message processing takes ages to be done. So far so good,
I can create separate thread for the child windows.
So the mainframe's thread add its stack created the message loop to
the _module and run it.
The child windows' thread add their stack created message loop too and run it.
Great, it works, as long as I don't leave. When I quit the app, the
child are never destructed, and the main frame exists before the
childs (then, Winmain exits, etc)...
I don't want to add another thread just to handle the mainframe, so
how can I be sure that the child windows are stopped ?
I've thought about posting a message when a child windows exits the
loop, but this will not work as the main frame might already have
leaved its message loop.
Then I've thought about creating an event in the child window, and
setting it when the child window exits, but then again, this will not
work as the mainframe will not receive windows messages (if any
remaining) while waiting for events. Said differently, if the
mainframe miss a child window destruction, then the corresponding
event will be deleted, and the mainframe will wait indefinitively for
a never occuring event.
The only solution I could think of, would be to create a child window
event array in the main frame, and then spend some time to monitor the
events, and maintain the map.
I guess there is a easier way, but I can't figure it out.
|
|
|
|
|
Just don't do it....keep all your windows on the same thread....
X-Ryl669 wrote:
the message processing takes ages to be done
What are you doing in your message handlers???? How many windows have you got???? Make use of worker threads to do non-UI work, but please keep all windows on the same thread...
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Stuart Dootson wrote:
, but please keep all windows on the same thread...
now, where's the fun in that?
--
<gassho rei="">Oneigaishimasu!
I blog too now[^]
|
|
|
|
|
Why are you saying this ?
Is there a reason for this or simply a "used to be said" rule ?
I can't create worker thread for non UI work, as it would require too many synchronization objects, etc...
|
|
|
|
|
Consider this....
Window A, owned by thread 1
Window B, owned by thread 2
In Windows A, you need to set a property of Window B, so you call SendMessage(WindowB, ....). In handling that message, Window B needs information from Window A. This translates to SendMessage(WindowA, ....). Result? can be deadlock, can be OK
You might think multi-threading with synchronisation objects is tricky. However, multi-threading with windows uses many *hidden* synchronisation points, so you can have latent bugs that are very difficult to detect. This link[^] highlights some of the pitfalls.
All I'm saying is that multiple windows owned by different threads are in general not the best design choice...
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
I need some kind of a "slim" combobox control. I want to use it for local edit in a listview control. Standard Windows' combobox cannot be resized beyond some minimum size.
WBR, Mahoney.
|
|
|
|
|
hi!
i have written an activex control for MS Word that stores some binary data. now when after placing my control into word doc i store binary data (vary
between 25KB to 10MB). control persists it. when i close it and reopen the
document it is there. but when i place another control and store data into
it, the data stored into the first control is truncated, not the whole data
but only few KBs. i m using BSTR to store binary data using SysAllocStringByteLen. I tried to find out the reason but couldn't. Is there any
Guru to give me a hand. I am in too much tension about this problem.
Plz help me.
Thanks in advance.
Ahmad Jalil Qarshi
|
|
|
|
|
I am writing Browser Helper Object. I want to access and make change to the URL in the address bar on the NavigateComplete event. I can get the URL but cannot make change to it (the URL in the address bar does not reflect the change). Could you help me to solve this problem?
Thanks.
|
|
|
|
|
I using vc++ to create a console project that codes below:
The codes is according to some conditions:
1. sort elements count greater than SORT_MAX.
2. all elements is equal.
2. predicate 'greater' overriden pair of brackets to compare two elements, when two elements are equal that returns true.
#include "stdafx.h"
#include <afxwin.h>
#include <algorithm>
using namespace std;
class greater {
public:
greater()
{
}
bool operator ()(int x1, int x2)
{
ASSERT(x1 == 12); // There is aim to assert pointer over
if (x1 > x2)
return false;
return true;
}
};
int main(int argc, char* argv[])
{
// UINT arr[] = {12, 14, 31, 9, 6, 30, 11, 65, 30
// };
UINT arr[] = {12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12
};
int nSize = sizeof(arr)/sizeof(UINT);
greater gt;
sort(arr, arr+nSize, gt);
for (int i = 0; i < nSize; i++)
printf("%d\n", arr[i]);
return 0;
}
//////////////////////////////////////////////////////////////////////////////
// i'm debugging into for(;_P(*_F, _Piv);++_F) which in template function _Unguarded_partition, Why is infinite cycle here?
// i guess the problem has associated with above 1. 2. conditions.
template<class _ri,="" class="" _ty,="" _pr=""> inline
_RI _Unguarded_partition(_RI _F, _RI _L, _Ty _Piv, _Pr _P)
{for (; ; ++_F)
{for (; _P(*_F, _Piv); ++_F)
;
for (; _P(_Piv, *--_L); )
;
if (_L <= _F)
return (_F);
iter_swap(_F, _L); }}
|
|
|
|
|
2. predicate 'greater' overriden pair of brackets to compare two elements, when two elements are equal that returns true.
This is the problem. std::sort expects a comparison predicate that implements what in techical terms is called a strict weak ordering[^]: your class greater violates (at least) the irreflexivity condition, i.e. when comparing an element against itself it returns true when it should return false. As you don't play nice with std::sort , this routine won't work.
In less technical terms, the comparison predicate must behave like the numerical < or > relationships do. In your case you have two options:Hope this helps.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Thanks for lot of helps, Ya that is strict weaking ordering function!
|
|
|
|
|
I have gotten _Document pointer from withing my ActiveX control using GetContainer() function. it works fine for _Document object. now i want to access _Application pointer from this _Document pointer but couldn't. i am using following code.
CComQIPtr<MSWord::_Document> spDoc(pContainer);
ATLASSERT(spDoc);
MSWord::_ApplicationPtr spApp = spDoc->GetApplication();
ATLASSERT(spApp);
where pContainer is IOleContainer pointer which i got through GetContainer.
plz help me.
Thanks in advance
Ahmad Jalil Qarshi
|
|
|
|
|
|
Hi
I wrote code using MS Visual C++ 6.0 and used different kinds of containers and algorithms from the STL. Can I take my code to be compiled and run in Unix without fuss?
Thanks!
|
|
|
|
|
|
Why not download GCC (which includes STL, IIRC) from here[^] and try it GCC is the most widely used compiler on Linux/Unix, so this Windows version is the easiest to try!
You may have some problems - some parts of MSVC6 STL (and MSVC for that matter!) aren't compliant with the C++ standard. There's a few things in std::string that aren't right and all the member template functionss defined in the standard aren't member template functions in MSVC STL. However, there shouldn't be too many
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|