skip to content
Dévai Gergely @ ELTE
User Tools
Log In
Site Tools
Search
Tools
Show pagesource
Old revisions
Backlinks
Recent Changes
Media Manager
Sitemap
Log In
>
Recent Changes
Media Manager
Sitemap
Trace:
•
Sample exam questions (theory part)
Sidebar
Info
in English
en Esperanto
magyarul
ELTE
Órarend
Timetable
BSc Formális nyelvek és fordítóprogramok (B szakirány)
MSc Fordítóprogramok
BSc Fordítóprogramok (kifutó tárgy)
Compilers
Software Technology Lab
Research
Research
compilers:sample-questions
Sample exam questions (theory part)
What is the task of the lexer?
Which part of the compiler is usually defined by a context-free grammar?
What is JIT (Just in time compilation)?
Write 3 token sequences that are accepted by the following grammar and 5 that are not accepted!
S→ab | aSb
Is LL(1) top-down or bottom-up?
How do the two basic actions of an LR(1) parser change the stack?
In which direction do synthesized attributes propagate information in the syntax tree?
What is the esp register used for?
Write an example assembly line with the and instruction and explain what does it do!
Write a code generation rule for an assignment!
Answers
The lexer breaks up the input character sequence to a token sequence.
Parser.
Some parts of interpreted code (eg. bytecode) are compiled to machine code in runtime to speed up program execution.
Accepted: ab, aabb, aaabbb; Not accepted: a, b, ba.
Top-down.
Shift pushes the next token into the stack, reduction removes the right-hand side and pushes the left-hand side of the selected grammar rule.
Bottom-up.
The esp register points to the top of the stack.
and eax,1: All bits of eax become zero, except the last one, which is preserved.
For integer type: code of the expression + mov [label of the variable],eax
compilers/sample-questions.txt
· Last modified: 2016/12/15 11:35 by
deva
Page Tools
Show pagesource
Old revisions
Backlinks
Back to top