• Tidak ada hasil yang ditemukan

CSE332 Lab Test 1. Consider the following strings

N/A
N/A
Protected

Academic year: 2023

Membagikan "CSE332 Lab Test 1. Consider the following strings"

Copied!
1
0
0

Teks penuh

(1)

Course: Compiler Design Lab, Course No: CSE332 Lab Test

1.

Consider the following strings:

String 1: #ACTTTTTAAA>TAAGAGGATA>TTAA#AAACCTTTAAAA String 2: TTTTT<AAAACCCCTTTTAAAAACCC##TTTAAAAAAAAA String 3: >>GGGTTTAAAAACCCTACTACTGGTACAAAAATTTTTTA String 4: AAAAAAAA###TTTTTAAAAA>>AAAAACCCTTTTAAAAA

Compute the length of each string and concatenate them into a single string and then compute the length of the final concatenated string. Reverse the final concatenated string.

Perform tokenization of the final concatenated string using the symbol #, >, <.

2.

Write a single program that can tokenize the variables, keywords, constants from the following expressions:

a. return 0;

b. for(i=0;i<=10;i=i+1) c. if (a==b) {sum=a+b;}

3.

Write a code that can remove extra white space (with both space and Tab) and Line Comment from a C code.

Referensi

Dokumen terkait

Có thể điểm qua hàng loạt những tên tuổi thật sự đóng góp cho thành tựu chung của tiểu thuyết đương đại: Dạ Ngân, Y Ban, Võ Thị Hảo, Võ Thị Xuân Hà, Nguyễn Ngọc Tư, Bích Ngân, Lí Lan,

Thở vào, tôi biết tôi sẽ già / Già Thở ra, tôi biết không thể thoát được tuổi già / Không thoát Thở vào, tôi biết tôi sẽ bệnh / Bệnh Thở ra, tôi biết không thể thoát được bệnh /