Building a Compiler cant be easy , but is that too tough to build a Compiler in C++ ?? for any language, like even a simple one . I have been following an ebook of that , and quite liking it
is that really possible in a Month if I really work hard or Iam just wasting my Time ??
It's definitely possible. Learning about a coding language is never a waste of time, whatever it is or whatever you're goals are, you'll pick up things along the way that will help you in later projects. Keep up the good work.
A compiler basically in sum turns langauge syntax into something recognizable by the machine (machine code). If you can understand how to make that conversion.
(02-21-2012, 07:45 AM)AceInfinity Wrote: [ -> ]A compiler basically in sum turns langauge syntax into something recognizable by the machine (machine code). If you can understand how to make that conversion.
I have been following an ebook and so far Iam only in the introductory part , like I know basically a Compiler is a two pass , Front End and Back End , Front End basically deals first with the source code as it has two parts Scanner and Parser . Scanner takes the source code and generates tokens which are basically in pairs , like <id,x> where x is an identifier id(token type) and x is said as a word . Parser take this token and converts it into an IR [Intermediate Representation] which basically checks the Context Grammer , that is the particular code belongs to the language or not , than there is a Back End which basically converts this into an assembly code ??
Huff revision done
hope Iam going the right way ? reply would be helpful
(02-21-2012, 07:27 AM)Load Wrote: [ -> ]It's definitely possible. Learning about a coding language is never a waste of time, whatever it is or whatever you're goals are, you'll pick up things along the way that will help you in later projects. Keep up the good work.
Thank you so much for boosting me up
Ebook which Iam following says that after studying this you can make your own compiler for language which is a subset of Java , which one that is , Javascript ?
Yes, but you can't forget about the order in which things get compiled with C++ either, and with that comes the linker.
(02-21-2012, 08:03 AM)AceInfinity Wrote: [ -> ]Yes, but you can't forget about the order in which things get compiled with C++ either, and with that comes the linker.
Ebook which Iam following says that you can biuld you own Compiler of language which is a subset of Java , which one is subset of Java , Javascript ??
lol no, Javascript and Java aren't even close. Javascript would be much lower than Java.
(02-21-2012, 08:08 AM)AceInfinity Wrote: [ -> ]lol no, Javascript and Java aren't even close. Javascript would be much lower than Java.
Then which language is the subset of it ? actually I have challenged my Professor today that I'll be making a Compiler for my project and every one is saying that you are fudged , its not possible , after posting here Iam getting some kind of confidence that I can do something , it "IS" possible
It is, but no one said it would be easy. I know how a compiler works, I just wouldn't know how to go about making one that would be any decent.
Also, the reason why Javascript wouldn't be it, is because Javascript isn't even compiled lol.
If you're using Java, then you can only compile lower level langauges would be my assumption, but I may be wrong, it just seems logical that it's true though.
(02-21-2012, 08:26 AM)AceInfinity Wrote: [ -> ]It is, but no one said it would be easy. I know how a compiler works, I just wouldn't know how to go about making one that would be any decent.
Also, the reason why Javascript wouldn't be it, is because Javascript isn't even compiled lol.
If you're using Java, then you can only compile lower level langauges would be my assumption, but I may be wrong, it just seems logical that it's true though.
Iam just asking you which language can be called as a subset of Java
and I have to make my project in C++ . I know its not easy but Iam ready to work really hard , and I have like 45 days to make that . hope I can achive my Goal , many guys suggested me to make my own simple language and build a Compiler for that ??