Monday, October 12, 2015

PCD PROGRAM : Implementation of a lexical analyzer to count total number of words, character,special Symbolcount and line from given.

Input:



%{
#include<stdio.h>
int w=0,d=0,ln=0,c=0;
int s=0;
%}
%%
[A-Z|a-z]+ {w++; c=c+yyleng;}
[0-9]+ {d++;}
[\n] {ln++;}
. {s=s+yyleng;}
%%
int main(int argc, char *argv[50])
{
FILE *fp;
yylex();
printf(" Wordcount= %d\n Numbercount= %d\n",w,d);
printf(" Charcount= %d\n Linecount= %d\n",c,ln);
printf(" specialSymbolcount= %d\n",s);
}

Output:
database@database-Veriton-Series:~/Desktop$ lex second.l
database@database-Veriton-Series:~/Desktop$ cc lex.yy.c -ll
database@database-Veriton-Series:~/Desktop$ ./a.out
more.mdsb@gmail.com
 Wordcount= 4
 Numbercount= 0
 Charcount= 16
 Linecount= 1
 specialSymbolcount= 3
note: for output display press Ctrl+d

2 comments:

  1. Hello,

    welcome to technechhacks where problems are been solved,

    We deal with the total functioning of sites like


    + SOCIAL MEDIA (Facebook, twitter, Instagram, Snapchat etc.)

    + BANK ACCOUNTS.

    + ICLOUD.

    + CRIMINAL RECORDS.

    + SCHOOL GRADES.

    + CREDIT SCORES.

    + SPOUSES PHONES.

    + BINARY RECOVERY.

    + BTC MINING etc.


    Thus Beware of scammers because most persons are been scammed and they end up getting all solutions to their cyber bullies and attacks by US.

    I am Jason Williams one of the leading hack agents.

    PURPOSE IS TO GET YOUR JOBS DONE AT EXACTLY NEEDED TIME REQUESTED!!


    And our WORK SUCCESS IS 100%!!!



    I'm always available for you when you need help.

    Contact or write us on:

    technechhacks@gmail.com or
    intelcorehacks@gmail.com

    Thanks for your time.

    ReplyDelete
    Replies
    1. ◾PROTOCOL SHIELDERS◾
      HELLO,

      I am COREY RODRIGUEZ by name,
      the only GENERAL CEO of protocol-cyber-shield-hackers.
      In this message, we will explain how you can almost avoid SCAMMERS and stay safe, plus how our organization works.

      Read it carefully!!
      Its reading will not take more than 10mins.

      We kindly URGE you to not respond without have read the entire text. Those who mail without have read everything, ask questions that are answered here!!

      ⚠️WARNING:

      MOST HACKERS YOU SEE HERE ARE FAKES
      AND SIMULTANEOUSLY INCONGRUOUS !!.
      It tears US up as we have received bitter emails of Jobs attempts proposals from most clients with hacking issues but never got it done and lost a lot in the process,
      EXAMPLES OF LOSSES ARE:
      ➡️BINARY FUNDS,
      ➡️INVESTMENTS,
      ➡️LARGE SCALE FUNDS,
      ➡️PROPERTIES,
      ➡️STONES(JEWELRIES) etc....

      all scammed by uncertified and fake hackers SIMPLY TERMED as "IMPERSONATION" like most you see here,
      which is disappointingly inadequate,
      leaving their mess for us to deal with eventually (WE DON'T MEAN TO BRAG ABOUT THAT).

      SCAMMERS DON'T SHOW MERCY ON THEIR VICTIMS!
      BY THE TIME YOU KNOW IT,YOU'VE GONE TOO DEEP BEING RIPPED OFF THROUGH DIVERSE TRICKY MEANS,PLEASE BE WISE ENOUGH TO PAY ATTENTION TO THIS ARTICLE AS YOU READ THROUGH IT.
      HOW CAN YOU BE CAREFUL??

      You won't know until you fall Victim ,but can be attentive to potential danger, error or harm if you take note of these:

      1, you see uncertified email accounts carrying numberings like
      "iamhacklord1232@(gmail,yahoo or hotmailDOTcom"
      pls flee from them, BIG SCAMMERS.
      They take your money and never do your job!!

      2, you see posts like "do you need to spy on spouse?"
      All fake!
      just a way to lure you toward getting ripped OFF!.

      3, posting fake testimonies and comments to trick you into feeling save and secured.
      Pls endeavour to ignore!!

      πŸ›‘NOTE: beware as we urge you not to make respond to any "IVAN HONG,PETER SANTOS,MONICA HART...(impersonating with our post pretending to work for us)
      WE ONLY HAVE 2 EMAILS WHICH ARE LISTED BELOW THIS ARTICLE TO ATTEND TO YOU VARIOUS MANNER OF CYBER MISHAPS.

      ◾VERY IMPORTANT ◾

      For years now, We've helped organizations secure data base, so many sites USES US AS SECURITY BACK UP TEAM BECAUSE OF OUR METHODS OF HANDLING CYBER MISHAPS.
      πŸ†—"CLEAR CRIMINAL RECORDS" 99%
      πŸ†—"iPHONE HACK" 99%
      πŸ†—"BINARY RETRIEVAL" 99% AND LOT MORE BEEN DONE IN SHORT TIMING!

      these are significant EXPERIENCES & RECORDS a good and effectively fully recognized organization must firmly ascertain.

      ◾OUR "AIMS" HERE ◾
      Are:
      1◾to assign a qualified agent of specific rank to particularly any sort of cyber issues you intend dealing with in short and accurate timing.

      2◾ to screen in real hackers (gurus only) in need of job with or without a degree, to speed up the availability of time given for Job contracts given to us.!!

      Thus an online binary decoding exam will be set for those who seeks employment under the teams Establishment.
      write us on:
      ◾Protocolhacks@gmail.com or
      ◾Cybershieldnotch@gmail.com

      COREY ROD,
      SIGNED...!
      Thank you!!!

      Delete