From da1764a9f839e1d29b2bee12d35534f71f05c6ff Mon Sep 17 00:00:00 2001 From: Akshay Date: Fri, 30 Apr 2021 22:25:19 +0530 Subject: law & order --- 2/input | 5 ----- 2/main.l | 29 ----------------------------- 2 files changed, 34 deletions(-) delete mode 100644 2/input delete mode 100644 2/main.l (limited to '2') diff --git a/2/input b/2/input deleted file mode 100644 index 5ad8acb..0000000 --- a/2/input +++ /dev/null @@ -1,5 +0,0 @@ -this is the first para text. -another line in this para. - -this is the second para text. -another line in this para. diff --git a/2/main.l b/2/main.l deleted file mode 100644 index 872c7bc..0000000 --- a/2/main.l +++ /dev/null @@ -1,29 +0,0 @@ -%{ -int word_count = 0; -int line_count = 0; -int char_count = 0; -int para_count = 0; -int spaces = 0; -%} - -%% -\n line_count++; -[ \t] spaces++; -[A-Za-z]+ { word_count++; char_count+=yyleng;}; -\n\n para_count++; -<> {para_count++; return 1;}; -. ; -%% - -int main(void) { - yylex(); - printf("%d lines\n", line_count); - printf("%d words\n", word_count); - printf("%d blanks\n", spaces); - printf("%d characters\n", char_count); - printf("%d paragraphs\n", para_count); -} - -int yywrap() { - return(1); -} -- cgit v1.2.3