Exam 1

Beschreibung

This is a study guide for Compiler exam one.
Thomas Scott
Quiz von Thomas Scott, aktualisiert more than 1 year ago
Thomas Scott
Erstellt von Thomas Scott vor fast 6 Jahre
22
0

Zusammenfassung der Ressource

Frage 1

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

Frage 2

Frage
Can a DFA simulate NFA
Antworten
  • No
  • Yes
  • Sometimes
  • Depends on NFA

Frage 3

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

Frage 4

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

Frage 5

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

Frage 6

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

Frage 7

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

Frage 8

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

Frage 9

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

Frage 10

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

Frage 11

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

Frage 12

Frage
The language of the regular expression x | y is the set ______.
Antworten
  • {x, y}
  • {xy}
  • {x}
  • {y}
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

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