Author: iPoster

1

CSMA Implementation in Java

This is the CSMA Implementation in java Carrier sense multiple access (CSMA) is a probabilistic media access control (MAC) protocol in which a node verifies the absence of other traffic before transmitting on a...

0

Lex Program to Identify Tokens

This is the Lex Program to identify tokens in a program using regular expressions [cc lang=”c”] %{ #include %} %% bool|int|float printf(“Keyword”); [-,+]?[0-9]+ printf(“Constants”); [,.’”]+ printf(“Punctuation Chars”); [!@#$%^&*()]+ printf(“Special Chars”); [a-zA-Z]+ printf(“Identifiers”); %% main(){yylex();}...

1

Lex Program to Check String Palindrome

This is the lex program to check whether the given string is palindrome or not. [cc lang=”c”] %{ #include char num,temp[100]; int rev=0; char arr[100]; %} %% . scanf(“%s”,arr); temp=arr; while(temp!=0){rev=rev*10+(temp%10); temp/=10;} if(rev==num) printf(“PALI”);...