EXAM Flashcards

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.

A

False

21
Q

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

A

False

22
Q

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

A

False

23
Q

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

A

False

24
Q

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

A

False

25
Q

In an attributes grammar an intrinsic attribute gets its value from the symbol table.

A

True

26
Q

In a tail-recursive function, the recursive call is the first to be executed at every iteration.

A

False

27
Q

In functional programming, a program is not sensitive to the computation history, because it does not need to save information in memory.

A

True

28
Q

In Racket Language the difference between “for” and “for/list” expressions is that “for/list” returns a list, but “for” does not return anything.

A

True

29
Q

In Lambda calc, functions have names.

A

False

30
Q

The racket function (exact? 0.504) returns true.

A

False

31
Q

An atom in Prolog starts with a capital letter or underscore character.

A

False

32
Q

We interpret the Prolog rule “Head :- Body” as “If Head is true, then Body is true”.

A

False

33
Q

In Prolog two compound terms with the same functor can unify no matter how many parameters each one has.

A

False

34
Q

The underlying computation model in logic programming is Horn clauses.

A

True

35
Q

In Prolog a fact is a rule which its head is always true.

A

True

36
Q

The Python and C++ languages implement the same associativity for arithmetic operators.

A

True

37
Q

A BNF grammar is a generative mechanism.

A

True

38
Q

Finite Automata are recognizer tools.

A

True

39
Q

Denotational semantics are specified based on first order logic concepts.

A

False

40
Q

In Axiomatic semantics, the strongest precondition is the one that is logically implied by all other preconditions.

A

False

40
Q

The behaviors that can be checked at compile time are generally specified by static semantics.

A

True

41
Q

An advantage of LR parsers over LL parsers is that less rewriting of grammar rules is required.

A

True

42
Q

LR parsing algorithms belong to the top-down parsers group.

A

False

43
Q

Removing left recursion from grammar is desirable when implementing top-down parsing algorithms.

A

True

44
Q

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

A

False

45
Q

Bison generates bottom-up parsers.

A

True

46
Q

Generally, a compiled source code runs faster than its interpreted counterpart.

A

True

47
Q

In functional programming, the computation happens through state transitions.

A

False