1.1 OBJECTIVE:Design a lexical analyzer for given language and the lexical analyzer should ignore redundant spaces, tabs and new lines. It should also ignore comments. Although the syntax specification states that identifiers can be arbitrarily long, you may restrict the length to some reasonable value. Simulate the same in C language.   1.2 PROGRAM LOGIC:   Read the input Expression        2. Check whether input is alphabet or digits then store it as identifier        3. If the input is is operator store it as symbol        4. Check the input for keywords

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section9.6: A Closer Look: Namespaces And Creating A Personal Library
Problem 3E: (For thought) a. What’s an advantage of namespaces? b. What’s a possible disadvantage of namespaces?
icon
Related questions
Question
100%

1.1 OBJECTIVE:Design a lexical analyzer for given language and the lexical analyzer should ignore redundant spaces, tabs and new lines. It should also ignore comments. Although the syntax specification states that identifiers can be arbitrarily long, you may restrict the length to some reasonable value. Simulate the same in C language.

 

1.2 PROGRAM LOGIC:

 

  1. Read the input Expression

 

     2. Check whether input is alphabet or digits then store it as identifier

 

     3. If the input is is operator store it as symbol

 

     4. Check the input for keywords

 

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Concept of pointer parameter
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr