OPL Exam 2

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

38. Consdier the following program. What value of x is displayed in function sub1? Select one best answer. /* program begins here */ var x; function sub1( ) { document.write("x = " + x + "<br />"); } function sub2( ) { var x; x = 10; sub1( ); } x = 5; sub2( ); /* program ends here */ A. 5 with static scoping, 10 with dynamic scoping B. 10 with static scoping, 5 with dynamic scoping C. 5 with static or dynamic scoping D. 10 with static or dynamic scoping E. undefined for static scoping F. undefined with dynamic scoping

A. 5 with static scoping, 10 with dynamic scoping

14. Static scoping is a central feature of ___ and some of its descendants. A. ALGOL 60 B. COBOL C. FORTRAN D. LISP E. ADA

A. ALGOL 60

2. A(n) ___ is a homogeneous aggregate of data elements in which an individual element is identified by its position in the aggregate, relative to the first element. A. Array B. Record C. Object D. Structure E. Union

A. Array

1. A(n) ___ defines a collection of data objects and a set of predefined operations on those objects A. Data type B. Polymorphism C. Container D. Program Abstraction E. Data structure

A. Data type

4. Array ___ is a mapping from indices to elements. A. Indexing B. Range C. Length D. Initializing E. Ordering

A. Indexing

23. Consider dynamic binding of a variable. Which one of the following statements is NOT correct? A. The variable being assigned is bound to the type of the value of the expression on the left side of the assignment. B. Any variable can be assigned any type value. C. A variable's type can change any number of times during program execution. D. The type of a variable whose type is dynamically bound may be temporary. E. Languages in which types are dynamically bound are dramatically different from those in which types are statically bound.

A. The variable being assigned is bound to the type of the value of the expression on the left side of the assignment.

18. If the binding first occurs during run time or can change in the course of program execution, it is called ____. A. dynamic B. immutable C. global D. local E. physical F. static G. statistical

A. dynamic

21. With _____ binding, the type of a variable is not specified by a declaration statement, nor can it be determined by the spelling of its name. Instead, the variable is bound to a type when it is assigned a value in an assignment statement. A. dynamic B. global C. local D. permanent E. static F. temporary

A. dynamic

22. The primary advantage of ____ binding of variables to types is that it provides more programming flexibility. A. dynamic B. global C. local D. permanent E. static F. temporary

A. dynamic

27. The asterisk symbol (*) is usually bound to the multiplication operation at ___. A. language design time B. language implementation time C. compile time D. load time E. link time F. run time. G. termination time

A. language design time

20. With this binding, array subscript ranges are statically bound and storage allocation is static (before run-time). The advantage is efficiency (for no dynamic allocation). A. static B. fixed stack-dynamic C. stack-dynamic D. fixed heap-dynamic E. heap-dynamic

A. static

7. Arrays can be ___, as in C++ arrays whose definition includes the static specifier. A. static B. stack-dynamic C. fixed stack-dynamic D. fixed heap dynamic E. physical memory F. virtual memory

A. static

16. To store a fixed number of decimal digits, in coded form (BCD), it uses ___ bits for a decimal digit. A. 2 B. 4 C. 8 D. 16 E. 32 F. 64

B. 4

36. ___ is the association of attributes with program entities. A. Association B. Binding C. Scoping D. Abstraction E. Naming

B. Binding

3. ______ programming languages allow expressions to be named. A. Abstract B. Functional C. Imperative D. Logical E. Object-Oriented F. Agile

B. Functional

9. For length option(s) of string data type, some languages (e.g., C and C++), it is ___. In these languages, a special character is used to indicate the end of a string's characters, rather than maintaining the length. A. Static Length B. Limited Dynamic Length C. Dynamic Length (no maximum) D. Heap Length E. Stack-dynamic Length

B. Limited Dynamic Length

13. It is possible to have multiple variables that have the same address by using _____. A. address B. alias C. entry point D. heap E. stack

B. alias

11. A variable can be characterized as a sextuple of attributes which include everything except ___. A. address B. binding C. lifetime D. name E. scope F. type G. value

B. binding

34. Consider the following Java assignment statement: count = count + 5; The internal representation of the literal 5 is bound at _____. A. language design time B. compiler design time C. compile time D. load time E. link time F. run time. G. termination time

B. compiler design time

13. Scalar variables can be separated into four categories by considering their lifetimes. Which is not one of them? A. static B. dynamic C. stack dynamic D. explicit heap dynamic

B. dynamic

18. With this binding, array subscript ranges are statically bound, but the storage allocation is done at declaration time. The advantage is space-efficiency. A. static B. fixed stack-dynamic C. stack-dynamic D. fixed heap-dynamic E. heap-dynamic

B. fixed stack-dynamic

28. A data type, such as int in C, is bound to a range of possible values at ____. A. language design time B. language implementation time C. compile time D. load time E. link time F. run time. G. termination time

B. language implementation time

15. The ___ environment of a statement is the collection of all of the variables that are visible to that statement. A. binding B. referencing C. static D. dynamic E. symbolic

B. referencing

10. For length option(s) of string data type, some languages (e.g., COBOL, Java's String class), it is ___. A. Static Length B. Limited Dynamic Length C. Dynamic Length (no maximum) D. Heap Length E. Stack-dynamic Length

C. Dynamic Length (no maximum)

1. ____ programming languages are, to varying degrees, abstractions of the underlying von Neumann computer architecture. A. Abstract B. Functional C. Imperative D. Logical E. Object-Oriented F. Programmable

C. Imperative

10. Which one of the following statements is NOT correct? A. Special words in programming languages are used to make programs more readable by naming actions to be performed. B. Special words also are used to separate the syntactic parts of statements and programs. C. In most languages, special words are classified as reserved words, which means they cannot be redefined by programmers. D. Some of the special words are only keywords, which means they can be redefined. E. Special words in programming languages tend to be long in length.

C. In most languages, special words are classified as reserved words, which means they cannot be redefined by programmers.

8. Which one of the following statements is NOT correct? A. In many languages, notably the C-based languages, names are case sensitive. B. For example, the following three names are distinct in C++: rose, ROSE, and Rose. C. To some people, "name being case sensitive" is a serious detriment to orthogonality, because names that look very similar in fact denote different entities. D. With "name being case sensitive", case sensitivity violates the design principle that language constructs that look similar should have similar meanings. E. The problems of case sensitivity in C are avoided by the convention that variable names do not include uppercase letters.

C. To some people, "name being case sensitive" is a serious detriment to orthogonality, because names that look very similar in fact denote different entities.

16. A(n) ____ is an association between an attribute and an entity, such as between a variable and its type or value, or between an operation and a symbol. A. aliasing B. addressing C. binding D. naming E. referencing

C. binding

29. At ____, a variable in a Java program is bound to a particular data type. A. language design time B. language implementation time C. compile time D. load time E. link time F. run time. G. termination time

C. compile time

32. Consider the following Java assignment statement: count = count + 5; The type of count is bound at ____. A. language design time B. language implementation time C. compile time D. load time E. link time F. run time. G. termination time

C. compile time

33. Consider the following Java assignment statement: count = count + 5; The meaning of the operator symbol + is bound at ____, when the types of its operands have been determined. A. language design time B. compiler design time C. compile time D. load time E. link time F. run time.

C. compile time

5. Arrays can be ___, as in C functions (without the static specifier). A. static B. temporary stack C. fixed stack-dynamic D. fixed heap dynamic E. physical memory F. virtual memory

C. fixed stack-dynamic

5. For variable, the term ____ is often used interchangeably with name. A. alias B. attribute C. identifier D. property E. scope F. symbol

C. identifier

12. In several languages that support object-oriented programming, records are supported with ___. A. primitives B. arrays C. objects D. methods E. heaps

C. objects

19. With this binding, array subscript ranges are dynamically bound and the storage allocation is dynamic (done at run-time). The advantage is flexibility as the size of an array need not be known until the array is to be used. A. static B. fixed stack-dynamic C. stack-dynamic D. fixed heap-dynamic E. heap-dynamic

C. stack-dynamic

37. ___ scoping provides a simple, reliable, and efficient method of allowing visibility of nonlocal variables in subprograms. A. flexible B. stack-dynamic C. static D. heap-dynamic E. heap-static

C. static

8. Binding can be ___. A. coercing or casting B. implicit or explicit C. static or dynamic D. local or global E. internal or external

C. static or dynamic

3. A(n) ___ is the collection of the attributes of a variable A. Array B. Alias C. Data D. Descriptor E. Functor

D. Descriptor

19. Which one of the following statements is NOT correct? A. An explicit declaration is a statement in a program that lists variable names and specifies that they are a particular type. B. An implicit declaration is a means of associating variables with types through default conventions, rather than declaration statements. C. With an implicit declaration, the first appearance of a variable name in a program constitutes its implicit declaration. D. Explicit declarations create dynamic bindings to types. E. Implicit variable type binding is done by the language processor, either a compiler or an interpreter.

D. Explicit declarations create dynamic bindings to types.

9. Which one of the following statements is NOT correct? A. In Java, many of the predefined names include both uppercase and lowercase letters. B. In C#, many of the predefined names include both uppercase and lowercase letters. C. The Java method for converting a string to an integer value is parseInt, and spellings such as ParseInt and parseint are not recognized. D. The need to remember specific case usage for variable names makes it more precise to write correct programs. E. The case sensitivity of variable naming is a kind of intolerance on the part of the language designer, which is enforced by the compiler.

D. The need to remember specific case usage for variable names makes it more precise to write correct programs.

7. Which one of the following statements is NOT correct? Consider the name of a variable. A. Names in most programming languages are in the form of a letter followed by a string consisting of letters, digits, and underscore characters ("_"). B. Although the use of underscore characters to form names was widely used in the 1970s and 1980s, that practice is now far less popular. C. In the C-based languages, it has to a large extent been replaced by the so-called camel notation (e.g., parseInt, myStack, or thisHellWorld). D. The use of underscores and mixed case in names is a programming design issue as well as a programming style issue. E. All variable names in PHP must begin with a dollar sign.

D. The use of underscores and mixed case in names is a programming design issue as well as a programming style issue.

4. Which one of the following choices is NOT correct? The phrase "C-based languages" is used to refer to ____. A. C B. C++ C. C# D. Web C++ E. Objective-C F. Java

D. Web C++

11. In general, ___ binding allows greater flexibility but at the expense of readability, efficiency, and reliability. A. static B. local C. compile-time D. dynamic E. stack

D. dynamic

6. Arrays can be ___, as with Java's objects. A. static B. stack-dynamic C. fixed stack-dynamic D. fixed heap dynamic E. physical memory F. virtual memory

D. fixed heap dynamic

15. A variable's value is sometimes called its ____ because it is what is required when the name of the variable appears in the right side of an assignment statement. A. address B. alias C. l-value D. r-value E. reference F. nonterminal

D. r-value

25. Aliasing is a hindrance to ____ because it allows a variable to have its value changed by an assignment to a different variable. A. complexity B. orthogonality C. conformance D. readability E. writability

D. readability

17. Variables can be characterized by the sextuple of attributes. Which is not one of these six attributes? A. name B. type C. lifetime D. storage E. scope

D. storage

24. Which one of the following statements is NOT correct? A. The names of variables are never bound to types. Names can be bound to variables and variables can be bound to types. B. A program to process numeric data in a language that uses dynamic type binding can be written as a generic program, meaning that it is capable of dealing with data of any numeric type. C. Whatever type data is input will be acceptable, because the variables in which the data are to be stored can be bound to the correct type when the data is assigned to the variables after input. D. By contrast, because of static binding of types, one cannot write a C program to process data without knowing the type of that data. E. Before the mid-1990s, the most commonly used programming languages used dynamic type binding

E. Before the mid-1990s, the most commonly used programming languages used dynamic type binding

21. With this binding, binding of subscript ranges and storage allocation is dynamic and can change any number of times. The advantage is flexibility (as arrays can grow or shrink during program execution). A. static B. fixed stack-dynamic C. stack-dynamic D. fixed heap-dynamic E. heap-dynamic

E. heap-dynamic

20. Another kind of implicit type declarations uses context. This is sometimes called _____. In the simpler case, the context is the type of the value assigned to the variable in a declaration statement. For example, in C# a declaration of a variable must include an initial value, whose type is made the type of the variable. A. implicit type B. explicit type C. type conversion D. type declaration E. type inference

E. type inference

14. Aliases can be created in programs in several different ways. One common way in C and C++ is with their ____ types. A. alias B. common C. extern D. static E. union

E. union

12. A program ____ is an abstraction of a computer memory cell or collection of cells. A. address B. name C. scope D. type E. variable

E. variable

6. Which one of the following statements is NOT correct? A. Fortran 95+ allows up to 31 characters in its names. B. C99 has no length limitation on its internal names, but only the first 63 are significant. C. External names in C99 are restricted to 31 characters. D. Names in Java have no length limit and all characters in them are significant. E. Names in C# have no length limit and all characters in them are significant. F. Names in C++ have no length limit and all characters in them are significant.

F. Names in C++ have no length limit and all characters in them are significant.

30. A variable may be bound to a storage cell when the program is loaded into memory at ____. A. language design time B. language implementation time C. compile time D. load time E. link time F. run time. G. termination time

F. run time.

31. The binding of a variable to a storage cell may not happen until ____ in some cases, as with variables declared in Java methods. A. language design time B. language implementation time C. compile time D. load time E. link time F. run time. G. termination time

F. run time.

35. Consider the following Java assignment statement: count = count + 5; The value of count is bound at ___ with this statement. A. language design time B. compiler design time C. compile time D. load time E. link time F. run time. G. termination time

F. run time.

17. A binding is ____ if it first occurs before run time begins and remains unchanged throughout program execution. A. dynamic B. immutable C. global D. local E. physical F. static G. statistical

F. static

2. A variable can be characterized by a collection of properties, or attributes, the most important of which is ____. A. Abstraction B. Attribute C. Class D. Lifetime E. Object F. Scope G. Type

G. Type

26. Which one of the following statements is NOT correct? Bindings can take place at ____. A. language design time B. language implementation time C. compile time D. load time E. link time F. run time. G. termination time

G. termination time

40. The lexical-analysis process includes skipping ¬¬¬_______ and _____________ outside lexemes, as they are not relevant to the meaning of the program. a. Comments, white spaces b. White spaces, commas c. Commas, comments d. Commas, semicolons e. Semicolons, colons

a. Comments, white spaces

7. A rule that has ε as its RHS is called a(n)... a. Erasure Rule b. Direct Right Rule c. Pairwise disjointedness d. Right Factoring e. Removal Rule

a. Erasure Rule

6. Which of the following is a similarity between top down and bottom up parsers? a. Many only have 1 token ahead in the input b. They both start at the leaves c. They both start at the root d. Their order is leftmost derivation e. They share the same time complexity

a. Many only have 1 token ahead in the input

27. A bottom-up parser construct a? a. Parse tree beginning at the leaves towards the root b. Parse tree beginning at the root and towards the leaves c. Parse tree from root and all the way to the LHS. d. Parse tree from root and all the way to the RHS. e. Parse tree from the LHS leaves to the root.

a. Parse tree beginning at the leaves towards the root

41. Which of the following true about parsing? a. Parsers that work for any unambiguous grammar are complex and inefficient b. All parsers have a run time of O(n) c. Compilers use parsers for all grammars d. Parsers produce syntax errors e. Parsers do not produce error messages when an error is found

a. Parsers that work for any unambiguous grammar are complex and inefficient

32. Which of the following is not an action an LR parser may take? a. Pop b. Shift c. Accept d. Error e. Reduce

a. Pop

31. Which of the following best characterizes the bottom-up parsing problem? a. The parsing problem is finding the correct RHS in a right-sentential form to reduce to get the previous right-sentential form in the derivation b. The parsing problem is finding the correct LHS in a left-sentential form to reduce to get the previous left-sentential form in the derivation c. The parsing problem is finding the minimal syntax search in order to determine the right-sentential form in the derivation d. The parsing problem is finding the minimal syntax search in order to determine the left-sentential form in the derivation e. The parsing problem is finding the reduced BNF in a right-sentential form in order to produce the RHS parse tree

a. The parsing problem is finding the correct RHS in a right-sentential form to reduce to get the previous right-sentential form in the derivation

4. What is an advantage of LR parsers? a. They will work for all grammars that describe programming languages b. They can detect inferential errors quickly c. They are as efficient at any other top-bottom parsers d. LR class of grammars is a superset of the class parse able by nLR parsers e. They are recursive parsers which allows fast analysis than non-recursive

a. They will work for all grammars that describe programming languages

33. Which of the following is not a phrase of the following parse tree? a. a b. abcaa c. aa d. b e. c

a. a

11. A characteristic of grammars that disallows top-down parsing is the lack of _____. a. pairwise disjointness b. pairwise functions c. pairwise comparisons d. pairwise alignment e. pairwise independence

a. pairwise disjointness

30. What are the most common top down parsing algorithms? a. recursive descent and LL parsers b. top-down and bottom-up c. recursive descent and bottom-up d. top-down and LL parsers e. lexical

a. recursive descent and LL parsers

25. EBNF is ideally suited for _____ parsers. a. recursive-descent b. recursive- ascend. c. backtracking d. All of the above e. None of the above

a. recursive-descent

29. What is the one thing that language implementation system must analyzed, regardless of the specific implementation approach? a. source code b. data c. range d. syntax analysis e. lexical

a. source code

17. Internal codes for categories of lexemes are called a. tokens b. characters c. chips d. bytes e. numbers

a. tokens

14. Based on the following grammar, which option will pass the Pairwise Disjointness test? 1. A → aB | c | cBB 2. B → aB | bA | cBb 3. C → aaA | b | baB a. 1 b. 2 c. 3 d. All of the above e. Only 1 and 3

b. 2

2. Parsers are categorized according to which feature? a. The order in which the nodes are examined b. Direction in which the parse trees are created c. Point of derivation tracing d. Tree completeness e. Time complexity of performing a search

b. Direction in which the parse trees are created

12. Using the following parsing table and grammar, which of the following would be used as an Action based on the Stack and Input? a. Reduce 1 (use GOTO[0,T]) b. Reduce 3 (use GOTO[0,T]) c. Reduce 3 (use GOTO[2,T]) d. Reduce 3 (use GOTO[0,F]) e. Reduce 1 (use GOTO[2,T])

b. Reduce 3 (use GOTO[0,T])

24. Finite automata can be designed to recognize members of a class of languages called: a. CNF b. Regular languages c. Tokens d. Digits e. Lexemes

b. Regular languages

20. Which of the following is not a benefit of LR parsers? a. They detect syntax errors quickly. b. They work on a smaller class of grammars compared to other bottom-up algorithms. c. The LR class of grammars are a superset of the class parse able by LL parsers. d. They are just as efficient as other bottom-up parsers. e. They work on almost all grammars that are used to describe programming languages.

b. They work on a smaller class of grammars compared to other bottom-up algorithms.

39. What does $ represent in LL parser? a. dollar sign b. end of input marker c. terminal symbol d. nonterminal symbol e. beginning of input marker

b. end of input marker

18. Bottom-up parsers are often called ______ because shift and reduce are the two most common actions they specify a. shift-small algorithms b. shift-reduce algorithms c. parse-reduce algorithms d. SR algorithms e. pushdown algorithms

b. shift-reduce algorithms

26. Which is NOT a problem associated with Top down parsers? a. Finding all syntax errors b. Producing a parse tree c. Choosing the correct A-rule to get the next sentential form in the rightmost derivation d. Choosing the correct A-rule using only the first token produced by A e. Recovering after finding errors

c. Choosing the correct A-rule to get the next sentential form in the rightmost derivation

16. Which of the following makes a parsing algorithm more efficient? a. Making the algorithm work for any unambiguous grammar b. Backing up parts of a sentence more often c. Making the algorithm work for only a subset of all possible grammars d. Designing the parser for a language with many types of syntax errors e. Increasing sentence length

c. Making the algorithm work for only a subset of all possible grammars

3. What is the time complexity of CFG? What is the Big-O of a parser works for a subset of unambiguous grammars? a. O(n) b. O(n^2) c. O(n^3) d. O(1) e. O(n!)

c. O(n^3)

1. Which of the following is NOT a reason that lexical analysis is separated from syntax analysis? a. Simplicity b. Efficiency c. Readability d. Portability e. None of the above

c. Readability

21. Which of the following is not a characteristic of Lexical Analysis? a. It is a pattern matcher of character strings. b. It is usually called as a function by the parser. c. The only way to build a lexical analyzer involves creating formal descriptions of tokens and then using software to construct a table-driven analyzer from said description. d. Lexical analysis is kept separate from the syntax analysis to make parsers more efficient, portable, and simple. e. It is considered the "front-end" of a parser.

c. The only way to build a lexical analyzer involves creating formal descriptions of tokens and then using software to construct a table-driven analyzer from said description.

34. A lexical analyzer is a pattern matcher that isolates the small-scale parts of a program, which are called ____. a. Tokens b. Symbols c. lexemes d. Characters e. Keywords

c. lexemes

38. In a bottom up parser, what does it mean to perform a shift action? a. bits are moved n digit positions to the left/right b. values are popped from the parser's stack c. the next input token is placed onto the parser's stack d. lowercase characters are converted to uppercase characters e. bottom up parsers don't perform shifts, top down parsers do

c. the next input token is placed onto the parser's stack

19. In many cases, ____________ can be combined to simplify the state diagram. a. parsers b. analyzers c. transitions d. tokens e. none of the above

c. transitions

35. What are the approaches to building a lexical analyzer? a. Write a formal description of the token patterns of the language using a descriptive language related to regular expressions. b. Design a state transition diagram that describes the token patterns of the language and write a program that implements the diagram. c. Design a state transition diagram that describes the token patterns of the language and hand-construct a table-driven implementation of the state diagram. d. All of the above e. None of the above

d. All of the above

22. Which of the following is an advantage of using BNF? a. BNF descriptions of the syntax of programs are clear and concise, for both human and computers b. BNF descriptions can be used as the direct basis for the syntax analyzer c. Implementations based on BNF are easy to maintain d. All of the above are advantages e. None of the above are advantages

d. All of the above are advantages

9. Which of the following is not a component of a Context-Free Grammar? a. Non-terminals b. Terminal symbols c. Productions d. Simple phrases e. A start symbol

d. Simple phrases

36. LR parsers are table driven and the table has two components, ACTION table and GOTO table. Which best describes the ACTION table? a. The ACTION table specifies which state to put on top of the parse stack after a reduction action is done. Rows are state names columns are terminals. b. The ACTION table specifies which state to put on top of the parse stack after a reduction action is done. Rows are state names columns are non-terminals. c. The ACTION table specifies the action of the parser, given the parser state and the next token. Rows are state names columns are non-terminals. d. The ACTION table specifies the action of the parser, given the parser state and the next token. Rows are state names columns are terminals. e. The ACTION table performs three operations: shift, reduce, go to a new state.

d. The ACTION table specifies the action of the parser, given the parser state and the next token. Rows are state names columns are terminals.

28. What are two distinct grammar characteristics preventing a recursive-descent parser from being constructed? a. The left recursion along with the bottom-up parser. b. The right recursion and the failure of the pairwise joint test. c. The right recursion and the success of the pairwise joint test. d. The left recursion and the failure of the pairwise joint test. e. The success of the pairwise joint test and the failure to eliminate through recursions.

d. The left recursion and the failure of the pairwise joint test.

23. Which of the following is an incorrect match? a. Terminal symbols - lowercase letters at the beginning of alphabet b. Nonterminal symbols - uppercase letters at the beginning of alphabet c. Terminal or nonterminal - uppercase letters at the end of alphabet d. Strings of terminals - lowercase letters at the end of alphabet e. Mixed strings (terminals and/or nonterminals) - uppercase Greek letters

e. Mixed strings (terminals and/or nonterminals) - uppercase Greek letters

15. An LR parser uses a(n) ________, a(n) __________, and a(n) ____________. a. Parse Table, Input Buffer, Stack of "sticks" b. Shift, Reduce, "got to new state" c. Parse Table, Reduce, Stack of "blocks" d. Shift, Input Buffer, Stack of "Contents" e. Parse Table, Input Buffer, Stack of "states"

e. Parse Table, Input Buffer, Stack of "states"

5. Which of the following statements about top-down parsing is true? a. Oriented around rightmost derivation tracing b. Parse tree creation/traversal or is a reversal of the postorder approach c. Parse tree creation/traversal follows the postorder approach d. Parse tree creation/traversal follows the inorder approach e. Parse tree creation/traversal follows the preorder approach

e. Parse tree creation/traversal follows the preorder approach

8. What is not the goal of the parser given an input program? a. Find all syntax errors b. Produce a diagnostics message c. Recover quickly d. Produce a parse tree e. Produce a syntax list

e. Produce a syntax list

37. LR parsers are table driven and the table has two components, ACTION table and GOTO table. Which best describes the GOTO table? a. The GOTO table specifies the action of the parser, given the parser state and the next token. Rows are state names columns are non-terminals. b. The GOTO table specifies the action of the parser, given the parser state and the next token. Rows are state names columns are terminals. c. The GOTO table performs three operations: shift, reduce, go to a new state. d. The GOTO table specifies which state to put on top of the parse stack after a reduction action is done. Rows are state names columns are terminals. e. The GOTO table specifies which state to put on top of the parse stack after a reduction action is done. Rows are state names columns are non-terminals.

e. The GOTO table specifies which state to put on top of the parse stack after a reduction action is done. Rows are state names columns are non-terminals.

13. Which of the following is an incorrect statement? a. Two categories of parsers are Top-Down and Bottom-Up b. Many parsers only look one token ahead in the input c. It is more efficient to separate Lexical and Syntax Analysis d. Compilers often use parsers that only work for a subset of unambiguous grammars for efficiency. e. The Pairwise Disjointness test is used before running an LR parse.

e. The Pairwise Disjointness test is used before running an LR parse.

10. The handle of a right sentential form is its _____ simple phrase. a. rightmost b. topmost c. bottommost d. second most e. leftmost

e. leftmost


Ensembles d'études connexes

hurst fluid and electrolyte post test

View Set

EMT - Chapter 8 - Pathophysiology

View Set

Essentials of Communication Ch. 2 Quiz 3 Listening

View Set

Exam 2 (Selection, Performance Appraisal, and Training)

View Set

Macroeconomics exam #4 Questions #10, #11 Quiz #4

View Set