EXAM Flashcards

(48 cards)

1
Q

A context-free grammar is a recognizer mechanism.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A rule with both left recursion and right recursion makes the grammar ambiguous.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

EBNF notation allows for a more concise grammar compared to an equivalent grammar in BNF notation.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The syntax analyzer verifies whether the tokens in a program are correct.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In a parse tree, the operator with the lowest precedence must appear at the lowest level of the tree.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A grammar rule with both left recursion and right recursion always generates the same parse tree.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

BNF notation uses curly brackets, i.e. “{“ and “}” symbols, to indicate zero or more repetition of a symbol.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In a BNF grammar a terminal symbol can be replaced by other symbols.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

To implement left associativity for an operator we use left recursion.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The static semantics are mostly used to prove the correctness of programs.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Lexical analysis generates a stream of valid tokens.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In a DFA, there can be more than one transition out from a state for an input.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Operational semantics present the meanings of language’s constructs in the form of smaller actions.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In regular grammars the epsilon symbol is a special non-terminal symbol which can be replaced with another symbol.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

There is only one non-terminal on the RHS of a rule in regular grammars.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Backtracking parsing algorithms are very efficient in regard with execution time and memory consumption.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

A bottom-up parsing table defines a non-deterministic finite automaton.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Parsing algorithms build parse trees by finding a derivation for a program.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

In LR parsers, reduce operation means replacing a RHS with its equivalent LHS of a grammar rule.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Bottom-up parsers perform left-most derivation.

21
Q

In a C compiling system, the preprocessor generates the assembly code.

22
Q

The variable yytext is the interface between lexical analyzer and syntax analyzer.

23
Q

Using C++ for rapid prototyping is more convenient than using python.

24
Q

In the grammar rule “turn_off_on : TURN BUILDING ONOFF” we can access the content of TURN using the variable $0.

25
In an attributes grammar an intrinsic attribute gets its value from the symbol table.
True
26
In a tail-recursive function, the recursive call is the first to be executed at every iteration.
False
27
In functional programming, a program is not sensitive to the computation history, because it does not need to save information in memory.
True
28
In Racket Language the difference between "for" and "for/list" expressions is that "for/list" returns a list, but "for" does not return anything.
True
29
In Lambda calc, functions have names.
False
30
The racket function (exact? 0.504) returns true.
False
31
An atom in Prolog starts with a capital letter or underscore character.
False
32
We interpret the Prolog rule "Head :- Body" as "If Head is true, then Body is true".
False
33
In Prolog two compound terms with the same functor can unify no matter how many parameters each one has.
False
34
The underlying computation model in logic programming is Horn clauses.
True
35
In Prolog a fact is a rule which its head is always true.
True
36
The Python and C++ languages implement the same associativity for arithmetic operators.
True
37
A BNF grammar is a generative mechanism.
True
38
Finite Automata are recognizer tools.
True
39
Denotational semantics are specified based on first order logic concepts.
False
40
In Axiomatic semantics, the strongest precondition is the one that is logically implied by all other preconditions.
False
40
The behaviors that can be checked at compile time are generally specified by static semantics.
True
41
An advantage of LR parsers over LL parsers is that less rewriting of grammar rules is required.
True
42
LR parsing algorithms belong to the top-down parsers group.
False
43
Removing left recursion from grammar is desirable when implementing top-down parsing algorithms.
True
44
Rewriting the set of grammar rules on the left side to the set on the right side will change the language defined by the grammar. | S -> E$ E -> T | E -> T E -> E + T | E -> E + T T -> 0-9 | T -> 0-9
False
45
Bison generates bottom-up parsers.
True
46
Generally, a compiled source code runs faster than its interpreted counterpart.
True
47
In functional programming, the computation happens through state transitions.
False