This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Other Languages and the fly likes compile c and cpp program from java code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Languages » Other Languages
Bookmark "compile c and cpp program from java code" Watch "compile c and cpp program from java code" New topic
Author

compile c and cpp program from java code

t sathya narayana
Ranch Hand

Joined: Jan 23, 2014
Posts: 31
Requirement:
Our Program should

be able to compile source codes in at least three different kinds of programming languages (C, CPP, Java, .net) and provide some errors while compiling if there is any error.
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
So your "program" is a cross-compiler? What do you mean by "call" in the subject of your post?
t sathya narayana
Ranch Hand

Joined: Jan 23, 2014
Posts: 31
Ulf Dittmer wrote:So your "program" is a cross-compiler? What do you mean by "call" in the subject of your post?

my program is like compiler to show some errors if there is?
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
OK. So what is your exact question?
t sathya narayana
Ranch Hand

Joined: Jan 23, 2014
Posts: 31
Ulf Dittmer wrote:OK. So what is your exact question?


our program should be able to compile at least 3 programming languages.
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
That's quite a task! So what do you have so far, and where are you stuck making progress?
t sathya narayana
Ranch Hand

Joined: Jan 23, 2014
Posts: 31
Ulf Dittmer wrote:That's quite a task! So what do you have so far, and where are you stuck making progress?

first of all i dn't know how to start and which concept here i need to use.
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
Are you familiar with compiler technology? Lexers, parsers, ASTs, code generation, etc.? If not, start by reading something like https://en.wikipedia.org/wiki/Compilers:_Principles,_Techniques,_and_Tools; that should give you some grounding so you know what you're getting into. http://www.ethoberon.ethz.ch/WirthPubl/CBEAll.pdf is a somewhat shorter starting point.

Would this tool also generate actual code? Or should it just point out the syntax errors? Generating code adds a bunch of complexity; creating ready-to-run executables even more so. If that is part of it, I'd estimate that you have no chance of finishing within the next 12 months. If not, you may be able to get something useful out within a couple of months.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: compile c and cpp program from java code
 
It's not a secret anymore!