Exam 1

Descripción

This is a study guide for Compiler exam one.
Thomas Scott
Test por Thomas Scott, actualizado hace más de 1 año
Thomas Scott
Creado por Thomas Scott hace casi 6 años
22
0

Resumen del Recurso

Pregunta 1

Pregunta
An NFA's transition function returns
Respuesta
  • A Boolean value
  • A state
  • A set of states
  • An edge

Pregunta 2

Pregunta
Can a DFA simulate NFA
Respuesta
  • No
  • Yes
  • Sometimes
  • Depends on NFA

Pregunta 3

Pregunta
In Flex, which of the following specifies an exclusive start condition HELLO?
Respuesta
  • %s HELLO
  • %x HELLO
  • %%x HELLO
  • %%s HELLO

Pregunta 4

Pregunta
In C++, which of the following is NOT considered as a static semantic error
Respuesta
  • 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

Pregunta 5

Pregunta
Which of the following files is generated by Flex?
Respuesta
  • tiger.ll
  • tiger.yy
  • lex.yy.cc
  • tokens.h
  • tiger.tab.cc

Pregunta 6

Pregunta
Which one of the following is not a stage of the compilation process?
Respuesta
  • Syntax Analysis
  • Semantic Analysis
  • Scanner Generator
  • Lexical Analysis

Pregunta 7

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

Pregunta 8

Pregunta
The scanner generator takes _______ as input and produces ______ as output.
Respuesta
  • Regular expressions, tokens
  • Regular expressions, scanner
  • Lexeme, scanner
  • Token, scanner

Pregunta 9

Pregunta
Which of the following is NOT a feature of compiler?
Respuesta
  • 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

Pregunta 10

Pregunta
Which of the following pairs of regular expressions are equivalent?
Respuesta
  • 1(01)* and (10)*1
  • x(xx)* and (xx)*x
  • x+ and x+x*
  • All of the mentioned

Pregunta 11

Pregunta
The language of the regular expression (x | y)(x |y) is the set_____.
Respuesta
  • {xy, xy}
  • {xx, xy, yx, yy}
  • {x,y}
  • {x, y, xy}

Pregunta 12

Pregunta
The language of the regular expression x | y is the set ______.
Respuesta
  • {x, y}
  • {xy}
  • {x}
  • {y}
Mostrar resumen completo Ocultar resumen completo

Similar

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