Question
|
Answer
|
Saturday, July 22 2006
|
In question 2.9ab, in the first production rule, there
is "$$" what does it mean?
|
The "$$" is a "end
marker" that is present in all "strings" that the grammar
generates. In other words, you can think of the $$ as a
terminal symbol.
|
Follow up from previous question: Then does it mean we
can exclude it when parsing? and just say G --> S ?
|
Well, what it means is that the final string of terminals
will contain the $$ so once you replace G with S$$ then you can ignore
the $$ for the remainder of the parse so essentially you are "ignoring
it" but it has to appear.
|
Can you please put up a pdf version of Assignment 1
questions from the book,like you said in class, for those of us who
don't have the book yet?
|
Take a look
at the course website "Assignments" link for a pdf version of
assignment one questions (scanned directly from the textbook). or by following this link.
|
Then if final string should contain $$, the final
string should be abaa$$
that we should get from the production rules, not abbaa that the exercise shows. Is it
right?
|
Yes, you are correct, the final sting should contain the $$.
|
Sunday, July 23 2006
|
I was working on the assignment and found that the questions
actually take a long time to figure out. On the test, will we be
required to solve questions as involved as the assignment?
Usually the assignments are longer than the tests, but it just got me a
little worried.
|
Assignments are generally (and should be) "longer" than the
test only
because of the time constraints, access to information etc. As
far as the test goes, you will have sufficient time to complete it and
it will be
relevant to what we have discussed in the lectures. You can ask
those that have taken previous courses with me - there has never been
any real problems with the tests...
|
Also, there is a lot of material being covered in such a
short time. Will the test be geared more towards question solving
or theory? I would like to re-read all the chapters again, but
with the time constraints, I won't be able to and it's difficult
to remember everything.
|
As far as the format, there will be a bit of both - some
theory and some "more practical" style questions. Re-reading the
chapters is a great idea if you have the time but start by looking at
the lecture notes and then use the book to elaborate on topics you are
not too clear on or on topics that are vague etc - so use the notes as
a guide... Actually, you may find it useful to also read the chapter
summery before you start reading the book also. Also, make sure
you understand any examples we have covered in the lecture.
|
In this line: r3 := *r3 -- load(register indirect)
What does it mean? The value of register 3 is already in there, why it
is reloaded ?
|
A good question! Basically, in the expression r3 = *r3
the register r3,
prior to the assignment of the right hand side, contains the address of
a memory location that contains a value. So basically, by
de-referencing the register r3 (e.g., *r3 as in C pointers) we are
actually taking the value stored in the memory location contained in
the address held in r3 before the assignment. Once we obtain this
value, then we assign it to register r3 and therefore, over-write what
was previously there. This is what they mean by a register
indirect load.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|