wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

321 - Quiz07

Total questions: 10

Worksheet time: 8mins

Name
Class
Date
1.

One of the following valid Regular Expression is equivalent to the Regular Expression a? Which one is it?

a)

a|ε

b)

[a]

c)

a+ε

d)

not a valid RE

2.

RE: (a|b)* is equivalent to b*a*

a)

No

b)

Yes

c)

maybe

d)

I should guess

3.

RE: (a|b)* is equivalent to (a*b*)*

a)

No

b)

yes

c)

Maybe

d)

I should guess

4.

The Cambridge notation for z = x + 2 * y is?

a)

(z (x (2 y*)+)=)

b)

(= z (+ x (* 2 y)))

c)

= z + x * 2 y

d)
5.

Before you can use a grammar to create a LL(1) parser, you must

a)

Remove Left Recursion

b)

Calculate the First set for each Terminal

c)

Make sure each production rule has a single RHS

d)

make sure the current sentential form look like αAβ

6.

LR parsers are table driven; uses a Left-to-right reading of input; create Rightmost derivation (in reverser order)

a)

True

b)

False

7.

Regular Expression: [ch]?at - matches which of the following?

a)

hat

b)

cat

c)

at

d)

chat

e)

hcat

8.

If we have the following production rules?

a)

S

b)

R

c)

T

d)

P

9.

a)

First(R)= { c d f }

b)

First(R)= { c d f b }

c)

First(R)={ a b c d f }

d)

First(R)= { c d f b ε }

10.

Consider S->0S1 | ε T={0 1} N={S} which of the following are true?

a)

It is not a Regular Grammar

b)

0n 1n | n>=0 (same number of 1's as 0's for n>= 0)

c)

An equivalent RE: 0+1+

d)

the empty string is a member of this language

e)

The empty string is NOT a member of the language