Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

1. What is a token? A character A group of characters A lexeme A category of lexemes A symbol, such as name, identifier, or literal

1. What is a token?

A character

A group of characters

A lexeme

A category of lexemes

A symbol, such as name, identifier, or literal

2. A grammar is ambiguous if it:

Has two or more rules with the same nonterminal on their LHS's

Has two or more rules with the same RHS

A sentential form can produce two or more different parse trees

Different sentential forms produce the same parse tree

3.

  1. Which of the following does not belong to an attribute grammar?

    Predicate functions

    Semantic functions

    Attributes

    Inference rules

4.Which of the following sentences cannot be derived using the following EBNF: (Hint: look at the terminal symbols) --> {( + | - ) } --> {( * | / ) } --> a | b | c

a * a + b * c

a * ( b + c )

a * b * c + a

( a + b ) + (a + c)

5. The LHS of a context-free rule consists of:

One terminal or one terminal and one nonterminal

A combination of terminals and nonterminals

Must have at least one nonterminal symbol

Exactly one nonterminal symbol

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions