Unit 1 Flashcards

(20 cards)

1
Q

What is a compiler?

A

A compiler is a program that translates source code written in a programming language into machine code.

This process involves several phases.

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

What are the phases of a compiler?

A

The phases of a compiler include lexical analysis, syntax analysis, semantic analysis, optimization, and code generation.

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

What are the types of compilers?

A

Types of compilers include single-pass compilers, multi-pass compilers, and just-in-time compilers.

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

What is lexical analysis?

A

Lexical analysis is the first phase of a compiler that converts a sequence of characters into a sequence of tokens.

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

What is the role of the lexical analyzer?

A

The lexical analyzer reads the source code and produces tokens for the syntax analyzer to process.

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

What are tokens?

A

Tokens are the smallest units of meaning in the source code, such as keywords, operators, and identifiers.

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

What are patterns in lexical analysis?

A

Patterns define the structure of tokens and are used to identify them in the source code.

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

What are lexemes?

A

Lexemes are the actual character sequences in the source code that match a token’s pattern.

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

What is input buffering?

A

Input buffering is a technique used to read input data efficiently during lexical analysis.

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

What are buffer pairs?

A

Buffer pairs are two buffers used in input buffering to allow for continuous reading of input data.

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

What are sentinels in input buffering?

A

Sentinels are special characters used to mark the end of input in a buffer.

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

What are regular sets?

A

Regular sets are collections of strings defined by regular expressions.

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

What are regular expressions?

A

Regular expressions are patterns used to match character combinations in strings.

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

What is the specification of tokens?

A

The specification of tokens describes the patterns that define each token type.

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

What is token recognition?

A

Token recognition is the process of identifying tokens from the input stream based on their specifications.

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

What is the conversion from regular expression (RE) to DFA?

A

The conversion from regular expression to deterministic finite automaton (DFA) is a method to create a DFA that recognizes the same language as the regular expression.

17
Q

What is minimization of finite state machines?

A

Minimization of finite state machines is the process of reducing the number of states in a finite state machine while preserving its language.

18
Q

What is the Lex tool?

A

Lex is a tool used for lexical analysis that generates a lexical analyzer from a set of regular expressions.

19
Q

What is the Yacc tool?

A

Yacc is a tool used for syntax analysis that generates a parser from a context-free grammar.

20
Q

What is a language processing system?

A

A language processing system is a system that processes programming languages, typically involving compilation and interpretation.