|
thank you Reply my question
i want to make a compiler to analyse specify format(the format is i
define include the reserved keyword and other operations) files
but i don't have any ideas so write this for some help
|
|
|
|
|
I suppose you've to choose between them.
Would you start developing your first interpreter or your first compiler (Well, of course you can develp both, but you've to start with one of the two...)?
Roughly speaking developing a compiler is most difficult than an intepreter so you can start with the latter, if develpment difficulty is a factor.
Do you know that's Google matter [^]. There is also an article series, here at CP [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Are you sure this is really what you want to do ? As the other pointed out, that's a difficult task. You need to ask yourself two questions:
1) Do you really need to be able to execute code from a text file at runtime ? Can't you 'simplify' your task into something like a condition and an action (that's more or less your example) ? If you design it cleverly, it could simplify a lot your code.
2) If that's not possible, are you sure you want to write your own interpreted ? Can't you use an existing scripting language instead of rewriting it yourself. If they exist, this is for a specific reason. If you already looked at this and found it too difficult, well think again because doing it yourself is gonna be way more complicated than that...
|
|
|
|
|
i accept your advice and then how could i do.could you give me more details
thank you very much
|
|
|
|
|
jeansea wrote: could you give me more details
That will be very difficult, since you didn't provide a lot of details on what you want to achieve...
|
|
|
|
|
Become very familiar with the dragon book or facsimile thereof.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Just in case of confusion to later readers.
But the original replies did point you at some scripting resources, so I suggest you read them.
Also read the articles here: http://www.codeproject.com/KB/recipes/#Parsers[^]. It may take you some time...
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Could you tell us why you want to make a compiler? What do you intend to use it for?
Do you intend to use it in some larger program? If that is so, you'll be better off to use some existing scripting language.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Have a look at this compiler construction tutorial[^]. Then you can make a better decision as to whether you want to drop yourself into a world of pain (which is what writing a compiler mostly is, if it's going to do much).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Dear All,
I want to display items in a CListCtrl but by default the Horizontal scroll bar is appearing if I add more items in the list.
But I need to display only Vertical bars if I add more items. I use like below :
<pre> m_List.EnableScrollBar(SB_VERT, true);
m_List.EnableScrollBar(SB_HORZ,false);
The above works only if the list is having minimum items, when it exceeds the client area then only Horizontal bar is working and Vertical bar is shown but not working.
|
|
|
|
|
Possibly you need to use the LVS_REPORT style.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
When I use Report Style, even I cannot add the items in the list.
m_List.EnableScrollBar(SB_VERT, true);
m_List.EnableScrollBar(SB_HORZ,false);
CString strText;
int nColumnCount = 0;
for (int i=0;i < 20;i++)
{
strText.Format(TEXT("item %d"), i);
m_List.InsertItem(i, strText);
}
|
|
|
|
|
bhanu_8509 wrote: m_List.EnableScrollBar(SB_VERT, true);
m_List.EnableScrollBar(SB_HORZ,false);
You don't need the above lines.
bhanu_8509 wrote: When I use Report Style, even I cannot add the items in the list
What does it mean?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
When I use the CListCtrl using LVS_REPORT, I cannot populate the list with the items.
CString strText;
int nColumnCount = 0;
for (int i=0;i < 20;i++)
{
strText.Format(TEXT("item %d"), i);
m_List.InsertItem(i, strText);
}
|
|
|
|
|
I am sorry, I forget to Insert the column. Now I changed it and it is working fine. Thanks for your help.
|
|
|
|
|
I am sorry, I forget to Insert the column. Now I changed it and it is working fine. Thanks for your help.
Topic closed...
|
|
|
|
|
Hello,
I want to use a function from .lib file(which is built on VC 8.0 and VC 7.0) and my application is built in VC 6.0.
On calling function (from .lib) i get large number of linker errors.
I beleive this is because one of the one of the linker warning
"warning LNK4078: multiple ".CRT" sections found with different attributes (40300040)"
Please advice.
Thanks in Advance!
|
|
|
|
|
tony_udz wrote: I want to use a function from .lib file(which is built on VC 8.0 and VC 7.0) and my application is built in VC 6.0.
You can't use static libraries built with VC 7.0/8.0 with VC 6.0. Full stop. There are no workarounds, it just doesn't work - they're incompatible.
Of course, if you could make DLLs out of your static library code, you might get a bit further - but there's lots of different issues there as well.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi all,
i m using excel like this its works fine.
For example:
Start Excel
Excel::_ApplicationPtr pApplication;
if ( FAILED( pApplication.CreateInstance( _T("Excel.Application") ) ) )
{
Errorf( _T("Failed to initialize Excel::_Application!") );
return;
}
Load an Excel workbook
_variant_t varOption( (long) DISP_E_PARAMNOTFOUND, VT_ERROR );
Excel::_WorkbookPtr pBook = pApplication->Workbooks->Open( dlgFile.m_szFileName, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption );
Get the first worksheet
Excel::_WorksheetPtr pSheet = pBook->Sheets->Item[ 1 ];
i want to know how many rows have data in sheet.
please tell me how can i get rows count.
thanks in advance
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
pSheet->UsedRange->Rows->Count
You know - it would really be a good idea for you to learn about Excel and its object model if you're trying to program against it.
The easiest way to see what Excel has to offer is to open Excel, press ALT+F11 and play with VBA, especially the Object Browser (press F2 in the VBA IDE to access that).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
thanks
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
|
Purish Dwivedi wrote: So how can I support languages without installing language pack either through WIN XP CD or through microsoft site.
What's wrong about WIN XP CD or MS site?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Purish Dwivedi wrote: Suppose the client doesn't have WIN XP CD or registration at microsoft, then in this situation what will be the solution?
Microsoft should sue your customer, I suppose...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|