| | |
Compiler inside a Interpreter
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Thread Solved |
•
•
Join Date: Dec 2007
Posts: 17
Reputation:
Solved Threads: 0
Hello All,
I have a doubt...
basically I worte my first interpreter in C (A very simple one though... )
I will take a input file and will pass as command line arguements to my interpreter . This file will convert the input file to standard C file and will store in .C extension.
Now how do I call a C compiler insider my function itself, so that this generated C file will be compiled and executed at once.
Eg.
I create a text file test.txr as follows
Hello PRINTA ......
Hello GETTA .....
I pass this file as a command line...
conv text.txr (In command line)
This conv.C takes this file as input and convert PRINTA as printf and GETTA as scanf etc . (As you know..... simple pre processor).
So as the end, text.C will be generated.... All was fine till here.
Now I wanna compile this text.C and execute inside this conv.C itself.
Do you get my objective...............???????????/
Is this possible??????????
Waiting for your help guys......... I;m doing it for one charity process. I want this to happen ASAP.
--Rigidboss
I have a doubt...
basically I worte my first interpreter in C (A very simple one though... )
I will take a input file and will pass as command line arguements to my interpreter . This file will convert the input file to standard C file and will store in .C extension.
Now how do I call a C compiler insider my function itself, so that this generated C file will be compiled and executed at once.
Eg.
I create a text file test.txr as follows
Hello PRINTA ......
Hello GETTA .....
I pass this file as a command line...
conv text.txr (In command line)
This conv.C takes this file as input and convert PRINTA as printf and GETTA as scanf etc . (As you know..... simple pre processor).
So as the end, text.C will be generated.... All was fine till here.
Now I wanna compile this text.C and execute inside this conv.C itself.
Do you get my objective...............???????????/
Is this possible??????????
Waiting for your help guys......... I;m doing it for one charity process. I want this to happen ASAP.
--Rigidboss
•
•
Join Date: Dec 2007
Posts: 17
Reputation:
Solved Threads: 0
0
#3 Nov 8th, 2009
•
•
•
•
You can use the system function to run the compiler and then run the compiled code
I already sorted out this issue . I used the system function.......
Thanx a lot
))))))))Meanwhile I have a idea on creating a special language .
Namely ABSTRACT PROGRAMMING LANGUAGE (APL)
The details which we give will be abstract. The compiler inturn will process it and will create a response .
Is this possible ??????? If so how and where should i start.
Eg
In put : Let a be 10 and B be 20 .
Out put which will be fed to the compiler must be : int i=10, b=20 ;
Like this, I want to create a programming language......
Pls Help!!!!!!!!
•
•
Join Date: Dec 2007
Posts: 17
Reputation:
Solved Threads: 0
0
#5 Nov 9th, 2009
•
•
•
•
Take a look at yacc and lex. Also, APL is already a programming language
Thanks for ur help!!
I did read Lex and Yacc.
That's what I exactly did in my previous program . Anyways It gave some ideas.
Regarding APL . I just kept one name....
Anyways thanks for your help!
![]() |
Similar Threads
- Starting "Java" [Java tutorials / resources / faq] (Java)
- Need Help!!!!!!!! (Java)
- graph.. (C++)
- Mission impossible! Find the bracket problem (Java)
- What is your slackware version? (Getting Started and Choosing a Distro)
Other Threads in the Computer Science Forum
- Previous Thread: QA
- Next Thread: What is the best project idea!
Views: 485 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Computer Science
ai algorithm algorithms assignmenthelp assignments automata battery bigbrother binary bittorrent bizarre bletchleypark blogging bomb business clueless codebreaker compiler computer computerscience connect conversion csc data dataanalysis dataintepretation development dfa dissertation dissertationthesis dissertationtopic employment energy extensions foreclosure foreclosuresoftware fuel geeks givemetehcodez government graphics hardware history homeowners homework homeworkassignment homeworkhelp humor ibm idea ideas internet iphone ipod jobs kindle laser laws lazy linkbait lsmeans mainframes marketing mining mobileapplication msaccess nano netbeans news os p2p parser piracy piratebay principles programming rasterizer research sam-being-cute sas science security simulation software spoonfeeding spying sql sql-server stephenfry student supercomputer supercomputing sweden syntactic technology turing turingtest two'scompliment warehouse ww2





