Answered step by step
Verified Expert Solution
Question
1 Approved Answer
file:///C:/Users/xhorx/Downloads/A22.pdf INSTRUCTIONS IN THE ABOVE PDF FILE YOU ARE REQUIRED TO WRITE A JLEX SPECIFICATION ACCEPTS A FILE CALLED A2.input and outputs A2.output HERE ARE
file:///C:/Users/xhorx/Downloads/A22.pdf
INSTRUCTIONS IN THE ABOVE PDF FILE YOU ARE REQUIRED TO WRITE A JLEX SPECIFICATION
ACCEPTS A FILE CALLED A2.input and outputs A2.output
HERE ARE THE FILES
A2.input
/** keywords (such as read and if) and identifiers should not be counted in * comments. * Comments can be longer than one line. **/ MAIN f() BEGIN you are not required to check the syntax of the program; so all these words are identifiers; except "quoted" strings and keywords; to check how many lines and words I have; type "wc A2.input" in "luna.cs"; your number of characters and lines may vary from sample output, depends on how you save this file; to count the identifers and keywords; you have to count me one by one; note that A1_A2 is not ONE identifier; as defined in the language lexicon specification; A1 and A2 should returned as two identifiers; special characters such as !@#$% and tab may also appear to test your program; both 123 and 123.45 are numbers; while 12,34 are two numbers; /** you can put more than one comment line with characters like * and ) **/ here is some more tricky part: " /** this is a quoted string **/ " but /** "this is a comment " **/ END
A2.output
identifiers: 116 keywords: 3 numbers: 4 comments: 3 quotedString: 4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started