Lab 1
8/28 @ 11:59 PM
Not accepted late

Create a program called parts_of_speech that uses the Flex lexer generator to print the parts of speech for a very simple language. You may alter the demo code from the lab video provided here

Obey the following specifications:

  • The program should take 1 input argument, a path to a file that will be scanned.
  • The program should output a single line containing three numbers: the number of nouns, the number of verbs, and the number of adjectives.
  • The following strings must be recognized as nouns:
    • man
    • Man
    • woman
    • Woman
    • dog
    • Dog
  • The following strings must be recognized as verbs:
    • bites
    • kicks
    • loves
  • The following strings must be recognized as adjectives:
    • long with one or more 'o' characters, so looong is considered an adjective
    • tall
    • short
  • Whitespace should be ignored
  • Any character that is not part of the above language should cause the offending character to be printed and the program should immediately exit with a non-zero exit code.
Submission Instructions

Create a tarball consisting of a single directory with all of your work in it, including code, Makefile, and (if you have one) README file. Name your work directory l1 and name your tarball l1.tgz. Upload your tarball to the L1 Canvas assignment.