Starting from:

$24.99

CSE420 Lab 3 Solution


I. Topic Overview:
The lab is designed to introduce the students to the basics concept of a compiler Design. As part of this activity students will be using built in libraries. Basic techniques of coding and required tools will also be shown to students.

II. Lesson Fit:
The lab gives a hand on experience of the knowledge of theory class.

III. Learning Outcome:
After this lab, the students will be able to:
a. Understand and use built-in library function for tokenization.
b. Use Regex library effectively.

IV. Anticipated Challenges and Possible Solutions Possible Solutions:
a. Use built in methods of java.

V. Acceptance and Evaluation
Code: 0%
Viva: 100%

VI. Activity Detail
Activity Detail
a. Hour: 1 - 2
Discussion: Learn Regex to Convert Regular Expression.
Problem Task: Task 1 (page 3-4)
b. Hour: 3
Discussion: Code in Regex.
Problem Task: Task 2 (page 4-5)

Assignment 3: Problem Description
In this assignment, you will work on regular expression. For simplicity, we will assume that there is a fixed set of regular expressions. We will not consider out of these. You must use any built-in method or package in your implementation. The following table contains a fixed set of RE that will be used in this assignment.

Description RE Valid Invalid
Zero or more a(bc)*de ade abcbcde abde abcbde
One or more a(bc)+de abcde abcbcde ade abc
Once or not at all a(bc)?de ade abcde abc abcbcde
Character classes [a-m]* blackmail
imbecile above below
Negation of character classes [^aeiou] b
c a e
Exactly N times [^aeiou]{6} rhythm
syzygy rhythms
allowed


Lab 3: Activity List
Task 1: Learn Regex by searching in google.
https://www.tutorialspoint.com/java/java_regular_expressions.htm

Input:
2 ab*c*d a*b(cd)+e?f 3 acccd abbbbbcccc
bcdcdef

Output:
YES, 1 NO, 0
YES, 2

Input:
3
[a-c]{3}cab+(da)*f db*a[^def]{2}gh def[k-p]*p+
5
defkmnpmpp acbcabbf pqrstdd dbaabggh dbbbbamkgh

Output:
YES, 3
YES, 1
NO, 0
NO, 0
YES, 2


More products