| | |
Interpreter
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2008
Posts: 517
Reputation:
Solved Threads: 1
I am trying to write an Interpreter but are not really sure about the methods that are used for this.
What I think I have understood is for the example below, I will have to parse out 3 things from the string.
"Number1", "==" and "2" and associate these to maps in some way ?
Though I dont know much more than this and are not sure where to begin how to do this ?
What could be the first step.
What I think I have understood is for the example below, I will have to parse out 3 things from the string.
"Number1", "==" and "2" and associate these to maps in some way ?
Though I dont know much more than this and are not sure where to begin how to do this ?
What could be the first step.
C++ Syntax (Toggle Plain Text)
int Number1 = 2; std::string Criteria = "Number1 == 2"; if ( Criteria ) { MessageBox::Show("Number1 has a Value of 2"); }
Last edited by Jennifer84; Jun 30th, 2008 at 5:13 pm.
Infix notation is relatively difficult to parse. If you're doing this to learn how interpreters work, I'd recommend starting with a simpler syntax. For example, instead of "Number1 == 2", you could more easily parse "Number1 2 ==" (ie. postfix notation) with a simple stack.
I'm here to prove you wrong.
•
•
Join Date: Feb 2008
Posts: 517
Reputation:
Solved Threads: 1
Thank you.. I am not sure but if there could be any Tutoriouls about how interpreters is written.. Perheps this could be a good start also.
I have googled "Interpreters C++" but cant really find this. If there is any links anywhere I would be more than interested to read them.
I have googled "Interpreters C++" but cant really find this. If there is any links anywhere I would be more than interested to read them.
•
•
•
•
Infix notation is relatively difficult to parse. If you're doing this to learn how interpreters work, I'd recommend starting with a simpler syntax. For example, instead of "Number1 == 2", you could more easily parse "Number1 2 ==" (ie. postfix notation) with a simple stack.
>I am not sure but if there could be any Tutoriouls about how interpreters is written..
Not that I know of off the top of my head, but I'm sure they exist. If you want an example, I wrote an extremely simple interpreter a while ago and posted it on Daniweb. You can find it here.
Not that I know of off the top of my head, but I'm sure they exist. If you want an example, I wrote an extremely simple interpreter a while ago and posted it on Daniweb. You can find it here.
I'm here to prove you wrong.
•
•
Join Date: Feb 2008
Posts: 517
Reputation:
Solved Threads: 1
That would be really nice to read but when I press the link, the page is not showing and I get:
"404 File Not Found"
Perheps I can search for the Title if you remember what this was called.
"404 File Not Found"
Perheps I can search for the Title if you remember what this was called.
•
•
•
•
>I am not sure but if there could be any Tutoriouls about how interpreters is written..
Not that I know of off the top of my head, but I'm sure they exist. If you want an example, I wrote an extremely simple interpreter a while ago and posted it on Daniweb. You can find it here.
•
•
Join Date: Jan 2008
Posts: 3,833
Reputation:
Solved Threads: 503
I think it's this thread. I just took the thread number from the link and typed it in:
http://www.daniweb.com/forums/thread19348.html
http://www.daniweb.com/forums/thread19348.html
•
•
Join Date: Feb 2008
Posts: 517
Reputation:
Solved Threads: 1
Okay, thanks! I will look at this.
•
•
•
•
I think it's this thread. I just took the thread number from the link and typed it in:
http://www.daniweb.com/forums/thread19348.html
•
•
Join Date: Feb 2008
Posts: 517
Reputation:
Solved Threads: 1
Thanks, this seems to be good to read.
•
•
Join Date: Apr 2008
Posts: 296
Reputation:
Solved Threads: 42
howdy
Is this problem not roaring for herd of lex, yacc, flex, gnus, bison?
Also Aho and Sethi might be involved
krs,
tesu
Is this problem not roaring for herd of lex, yacc, flex, gnus, bison?
Also Aho and Sethi might be involved
krs,
tesu
Last edited by tesuji; Jun 30th, 2008 at 9:42 pm.
Information is moving—you know, nightly news is one way, of course, but it's also moving through the blogosphere and through the Internets. I promise you I will listen to what has been said here, even though I wasn't here. Ann and I will carry out this equivocal message to the world. I'm the master of low expectations.
![]() |
Similar Threads
- I want to get started learning a programming language (Computer Science)
- Urgent: Postfix Interpreter (Pascal and Delphi)
- Pseudocode for PC Interpreter (Assembly)
- Interpreter? (C)
- Haskell (Computer Science)
- shebang! (Perl)
- ASP and SQL ? (MS SQL)
- Big Game need progrmmers (C++)
- Inetnet Problems (Web Browsers)
Other Threads in the C++ Forum
- Previous Thread: submitting commands to other windows?
- Next Thread: Call a void()
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api array arrays based beginner binary bmp c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete deploy desktop directshow dll download dynamic encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib library linkedlist linker list loop looping loops map math matrix memory microsoft newbie news number output pointer problem program programming project python random read recursion recursive reference simple string strings studio system temperature template templates test text text-file tree unix url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






