FA2 Flashcards

(58 cards)

1
Q

A __________is a group of characters having a collective meaning.

Group of answer choices

None of the Above

TOKEN

NODE

STRING

A

TOKEN

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

The regular expression is a set of rules that say how to build a tree—a parse tree.

Group of answer choices

True

False

A

F

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

A grammar is a set of strings over an alphabet.

Group of answer choices

True

False

A

F

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

The Lexical analyzer does not have to be an individual phase.

Group of answer choices

True

False

A

T

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

A __________ over an alphabet is a finite sequence of symbols drawn from that alphabet.

A

STRING

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

There are a number of algebraic laws that are obeyed by regular expressions, which can be used to manipulate regular expressions into equivalent forms.

Group of answer choices

True

False

A

T

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

The grammar defined by regular expressions is known as regular grammar.

Group of answer choices

True

False

A

F

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

In verifying the validity of expressions in Lexical Analysis, a well-accepted solution is to use finite automata for verification.

Group of answer choices

True

False

A

T

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

Lexical analyzer does not have to be an individual phase. But having a separate phase simplifies the design and improves the efficiency and portability.

Group of answer choices

True

False

A

T

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

An expression can be the sum of two expressions, or the product of two expressions, or a parenthesized subexpression.

Group of answer choices

True

False

A

T

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

In panic mode, when a parser encounters an error anywhere in the statement, it ignores the rest of the statement by not processing input from erroneous input to delimiter, such as semi-colon.

Group of answer choices

True

False

A

T

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

One of the major roles of the parser is not to produce an intermediate representation (IR) of the source program using syntax-directed translation methods.

Group of answer choices

True

False

A

F

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

___________It is defined as the grammar in each programming language.

Group of answer choices

SEMANTICAL

SYNTAX

LOGICAL

None of the Above

A

SYNTAX

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

A type of error about the incompatible value assignment.

Group of answer choices

LOGICAL

SEMANTICAL

ANALYTICAL

None of the Above

A

SEMANTICAL

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

A type of error about some missing semicolon or unbalanced parenthesis.

Group of answer choices

ANALYTICAL

LOGICAL

None of the Above

SYNTACTICAL

A

SYNTACTICAL

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

The Semantic analyzer: reads input characters and produces a sequence of tokens as output.

Group of answer choices

True

False

A

T

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

_____________is a state machine that takes a string of symbols as input and changes its state accordingly.

A

FINITE AUTOMATA

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

In Notation, Union : (r)|(s) is a regular expression denoting L(r) U L(s).

Group of answer choices

True

False

A

T

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

A lexeme is a particular instant of a token.

Group of answer choices

True

False

A

T

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

The generated lexers are in a class of extremely simple programs called ________________.

A

FINITE AUTOMATA

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

The language defined by regular grammar is known as Irregular language.

Group of answer choices

True

False

A

T

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

The regular expressions is an algebraic notation for describing sets of strings.

Group of answer choices

True

False

A

T

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

The pattern is the rule describing how a token can be formed.

Group of answer choices

True

False

A

T

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

In Lexical analysis, a well-accepted solution is to use finite automata for verification.

Group of answer choices

True

False

25
Expression: a := x * y + z After lexical analysis, this statement has the structure: id1 assign id2 binop1 id3 binop2 id4 Group of answer choices True False
T
26
A ___________is a logical unit with respect to the rules of the source language. Group of answer choices None of the Above PHRASE SYNTAX WORD
PHRASE
27
According to handling errors, the lexical errors: important, can sometimes recover. Group of answer choices True False
F
28
In error handling, the lexical errors state: important, compiler can easily recover and continue. Group of answer choices True False
T
29
The Dynamic semantic errors: hard or impossible to detect at compile time, runtime checks are required. Group of answer choices True False
T
30
The Union of two languages L and M is written as L U M = {s | s is in L or s is in M}. Group of answer choices True False
T
31
The Lexical analyzer: reads input characters and produces a sequence of tokens as output. Group of answer choices True False
T
32
The regular expressions have the capability to express finite languages by defining a pattern for finite strings of symbols. Group of answer choices True False
T
33
The lexical analyzer filters out whatever separates the tokens, lay-out characters and comments. Group of answer choices True False
T
34
A syntax analyzer or parser is a program that groups sequences of tokens from the lexical analysis phase into phrases each with an associated phrase type. Group of answer choices True False
T
35
The viable-prefix property of parsers allows early detection of syntax errors. Group of answer choices True False
T
36
In handling errors, the ______________ : most important for compiler, can almost always recover. Group of answer choices None of the Above SYNTAX ERRORS ERROR MODE PARITY MODE
SYNTAX ERRORS
37
It is not important to detect errors as soon as possible without further consuming unnecessary input. Group of answer choices True False
F
38
Tokens are specified by regular expressions. Group of answer choices True False
T
39
Finite automata is a not recognizer for regular expressions. Group of answer choices True False
F
40
The word ______________in terms of programming languages, words are objects like variable names, numbers, keywords.
LEXICAL
41
In the statement mode, When parser encounters an error anywhere in the statement, it ignores the rest of the statement by not processing input from erroneous input to delimiter, such as semi-colon. Group of answer choices True False
F
42
In Notation, the Union: (r)(s) is a regular expression denoting L(r)L(s). Group of answer choices True False
F
43
String: a group of characters having a collective meaning. Group of answer choices True False
F
44
In Finite Automata, Vertices – represents the states and ________ – represents transitions. Group of answer choices VERTEX ROOT None of the Above EDGES
EDGES
45
Error production: Some common errors are known to the compiler designers that may occur in the code. Group of answer choices True False
T
46
It is expected that when an error is encountered, the parser should be able to handle it and carry on parsing the rest of the input. Group of answer choices True False
T
47
A program may have the following kinds of errors at various stages: Lexical, Syntactical, Semantical and the ______________. Group of answer choices ANALYTICAL LOGICAL SEMANTIC None of the Above
LOGICAL
48
A syntax analyzer or parser takes the input from a lexical analyzer in the form of token streams. Group of answer choices True False
T
49
In syntax analysis, a parser is not required to detect and report any error in the program. Group of answer choices True False
F
50
A lexical analyzer, or ______ for short, will as its input take a string of individual letters and divide this string into tokens. Group of answer choices None of the Above LEXER LEXAL LEXIS
LEXER
51
Type of mode which is the easiest way of error-recovery and also, it prevents the parser from developing infinite loops. Group of answer choices PARITY MODE None of the Above PANIC MODE ERROR MODE
PANIC MODE
52
The parser considers the program in hand as a whole and tries to figure out what the program is intended to do and tries to find out a closest match for it, which is error-free. Group of answer choices True False
T
53
The grammar designers have to be careful here because one wrong correction may lead to an infinite loop. Group of answer choices True False
F
54
According to handling errors, the logical errors: hard or impossible to detect. Group of answer choices True False
T
55
Parsers use error recovering strategies. Group of answer choices True False
T
56
A parser should be able to detect and report any error in the program. Group of answer choices True False
T
57
In error recovery choose a minimal sequence of changes to obtain a global least- cost correction. Group of answer choices True False
T
58
A type of error about name of some identifier typed incorrectly. Group of answer choices LEXICAL None of the Above SEMANTIC LOGICAL
LEXICAL