Exam 1

Descrição

This is a study guide for Compiler exam one.
Thomas Scott
Quiz por Thomas Scott, atualizado more than 1 year ago
Thomas Scott
Criado por Thomas Scott mais de 5 anos atrás
18
0

Resumo de Recurso

Questão 1

Questão
An NFA's transition function returns
Responda
  • A Boolean value
  • A state
  • A set of states
  • An edge

Questão 2

Questão
Can a DFA simulate NFA
Responda
  • No
  • Yes
  • Sometimes
  • Depends on NFA

Questão 3

Questão
In Flex, which of the following specifies an exclusive start condition HELLO?
Responda
  • %s HELLO
  • %x HELLO
  • %%x HELLO
  • %%s HELLO

Questão 4

Questão
In C++, which of the following is NOT considered as a static semantic error
Responda
  • Variables used without declaration
  • Redefinition of variables in the same scope
  • The number of arguments in a function call doesn't match the number of parameters in the function definition
  • Types of operands of an operator are not compatible
  • None of the above

Questão 5

Questão
Which of the following files is generated by Flex?
Responda
  • tiger.ll
  • tiger.yy
  • lex.yy.cc
  • tokens.h
  • tiger.tab.cc

Questão 6

Questão
Which one of the following is not a stage of the compilation process?
Responda
  • Syntax Analysis
  • Semantic Analysis
  • Scanner Generator
  • Lexical Analysis

Questão 7

Questão
The lexical analyzer takes _______ as input and produces a stream of ______ as output.
Responda
  • Token, source program
  • Either of the two
  • Source program, tokens
  • None of the mentioned

Questão 8

Questão
The scanner generator takes _______ as input and produces ______ as output.
Responda
  • Regular expressions, tokens
  • Regular expressions, scanner
  • Lexeme, scanner
  • Token, scanner

Questão 9

Questão
Which of the following is NOT a feature of compiler?
Responda
  • Scan the entire program first and translate into machine code
  • To detect syntax errors
  • Optimize the generated code
  • Execution time is more comparing with pure interpreter

Questão 10

Questão
Which of the following pairs of regular expressions are equivalent?
Responda
  • 1(01)* and (10)*1
  • x(xx)* and (xx)*x
  • x+ and x+x*
  • All of the mentioned

Questão 11

Questão
The language of the regular expression (x | y)(x |y) is the set_____.
Responda
  • {xy, xy}
  • {xx, xy, yx, yy}
  • {x,y}
  • {x, y, xy}

Questão 12

Questão
The language of the regular expression x | y is the set ______.
Responda
  • {x, y}
  • {xy}
  • {x}
  • {y}

Semelhante

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Data Analytics
anelvr