Regular Computing Expressions and Languages

This quiz contains multiple-choice problems on regular expressions and their operators, building and converting the regular expressions, lexical analysis, UNIX regular expressions, finding patterns in text and algebraic laws.

Start Quiz

Which of the following does not represent the given language {0,01}?

0+01

{0} U {01}

{0} U {0}{1}

{0} ^ {01}

Which among the following expressions does the language L={xϵ{0,1}|x is of length four or less} correspond?

(0+1+0+1+0+1+0+1)4

(0+1)4

(01)4

(0+1+ε)4

Which among the following looks similar to the expression ((0+1). (0+1)) *?

{xϵ {0,1} *|x is all binary number with even length}

{xϵ {0,1} |x is all binary number with even length}

{xϵ {0,1} *|x is all binary number with odd length}

{xϵ {0,1} |x is all binary number with odd length}

Which of the following forms can accurately express RR*?

R+

R-

R+ U R-

R

Concatenating R with Ф yields us

R

Ф

R.Ф

None of the above

Which of the following set operations refers to the concatenation operation?

Union

Dot

Kleene

Two of the options are correct

Lexemes can be referred to as

Elements of lexicography

Sequence of alphanumeric characters in a token

Lexical errors

None of the above

If the lexical analyser finds a lexeme with the same name as that of a reserved word, it

Overwrites the word

Overwrites the functionality

Generates an error

Is something else

A program that performs lexical analysis is called

Scanner

Lexer

Tokenizer

All of the above

Lexers and parsers are not found in which of the following?

Compiler front end processing

Pretty printers

Linters

None of the above

Which phase of compiler includes lexical analysis?

1

2

3

Its primary function, not in any phase

L is a regular language if and only if the set of __ classes in IL is finite.

Equivalence

Reflexive

Myhill

Nerode

A language can be simply generated from simple primitive languages if and only if

It is recognized by a device of infinite states

It takes no auxiliary memory

All of the above

None of the above

The outputs of the lexical and syntax analyzers are respectively

Parse stream, parse tree

Token tree, parse tree

Token stream, parse tree

All of the above

Which among the following is not a tool to construct a lexical analyzer from a regular expression?

lex

flex

jflex

None of the above

Quiz/Test Summary
Title: Regular Computing Expressions and Languages
Questions: 15
Contributed by:
Ivan