Clearly shows the what effort I was putting into the task :P...(then I complain it’s not interesting...) [Very clever, sir!! The way you snuck in this bit, so you'll know who really worked on the assignment.!! Very clever indeed!! Lol...!! :P]
Sunday, January 31, 2010
Befitting Lesson for the day...
Clearly shows the what effort I was putting into the task :P...(then I complain it’s not interesting...) [Very clever, sir!! The way you snuck in this bit, so you'll know who really worked on the assignment.!! Very clever indeed!! Lol...!! :P]
Tuesday, January 26, 2010
Meet Mr. Lexer and Ms. Parser!!!
Hey all those who have been trying to make sense of the compiler/compiling process, the part with lexical analyzer(lexer) and the parsers and how they work, I just found this while browsing… This was a beautiful way to put it. (Hope it helps you!)
Parser: Give me the next token
Lexer: Next token is "cx" which is a variable.
Parser: Ok, I have "cx" as a declared integer variable. Give me next token
Lexer: Next token is "=", the assignment operator.
Parser: Ok, the program wants me to assign something to "cx". Next token
------Lexer: The next token is "cy" which is a variable.
------Parser: Ok, I know "cy" is an integer variable. Next token please
------Lexer: The next token is '+', which is an addition operator.
------Parser: Ok, so I need to add something to the value in "cy". Next token please.
-----------Lexer: The next token is "324", which is an integer.
-----------Parser: Ok, both "cy" and "324" are integers, so I can add them. Next token please:
-----------Lexer: The next token is ";" which is end of statement.
------Parser: Ok, I will evaluate "cy + 324" and get the answer
Parser: I'll take the answer from "cy + 324" and assign it to "cx"
It’s clear now...Isn’t it?? J
Wonderin' why Mr Lexer ans Ms Parser...Well girls ask for a lot of things... Mind you, we use what we ask... we give meaning to what we get (what we have)..just like parser gives meaning to the tokens!! You think Lexer knows what the tokens really mean/ their purpose is?? Just look again...He just knows that/ even if he does,does he do anything with the knowledge...nahh...He just knows that ";" is end of statement...but doesn't know what to do with that piece of info...it's like collecting all the crap and not knowing why you are doing it...whereas Parser uses that info...i guess that's nature's way of creating balance in the world [;)] and a use for one another...or else we would destroy each other!!!
When I get time I’l update this post…[i have an assignment to finish(start actually!!)]
....about how compiler (also about the interpreter) works / what does it really do…not the “converts source languge to machine code” routine… (Still trying to find the answer... I'll let you know when I do!!)
Why you should NOT read this blog: An Intro...
So, I finally create a blog...!!
To all those who want to know how to go about in my blog, well there will be no order. I’m going to be very random, as I’m going to post whatever I feel has an importance or is useful or if it has caught my attention. My posts will range from topics like C, Java, Compilers, Operating systems (the few things which are right now on my mind), analysis of various other subjects, how stuff works,… (Well what do u expect, I’m a to-be-computer-science-engineer, I HAVE to know these things) to latest advancements, projects, may be Einstein’s Unified theory, string theory (why not!!), to why MBA, why MTech…, to shocking facts or interesting things I learn/come across during the day. In short all the WHY’s and the HOW’s and the WHAT’s that my mind ponders. So click away and read whatever interests you. (I’m sure you’ll find some Order in the Chaos!!) I’ll ensure that my posts’ titles will be of some help thereJ.
As you’ve already seen, “( )” the brackets/braces help me to say the many things running in my mind simultaneously. And you must’ve also observed, my posts will be a bit stretchy (Hey!! this is a blog, not a book for me to be concise precise brief. I’m only here to put my thoughts in words), but you’ll get the hang of it once you know what to READ and what to skip!!
“Exploring the Known and the Unknown”, that's what this blog is all about... A learning process recorded in words!!(Just parts of it, I guess. I might not get the time to write)
To do justice to my blog title, I think I’ll have to go through all my previous thoughts. I’m so eager to do that, coz it’ll give me some clarity of what I already learnt in life!! Maybe even “WHY” I learnt it in the first place!!
I’ll try to stick to academics, I mean to say, I’ll try to stay on study-related topics. (loll, bad joke!!) (Don’t be disheartened...I’ll post only if it’s interesting/useful) [Come on, Be hopeful... I’m bound to stray from this...] Oh, also I’m going to post all my assignments here... (I WANNA SAVE PAPER!! I want to save our dear planet. Go GREEE...EN!!)[My assignments will be a bit more formal and may be sophisticated if I can help it.] Friends, feel free to copy...
(To Sirs and Mams-I can’t stop them anyway!! [No offence guys J]Regarding my assignments, I hope you’ll cooperate in this matter as I really want to conserve what’s left of the trees. I’ll intimate you when I submit them, post them actually.)
As of now, the purpose of this blog is to help me and my friends to understand the myriad of things we need to explore (as well as the explored.)
P.S.: DON’T come back!! DON’T read this blog!!**
**( ;) Advertising strategy!! :P J )