Question: Using flex and bison, lets say I want to parse my input file: 3 + 1; 2 + 1; ? The goal is to parse

Using flex and bison, lets say I want to parse my input file:

3 + 1;

2 + 1; ?

The goal is to parse through each line until the ‘?’ symbol is reached. Leaving the output file to evaluate the expressions.

However, with my code I have it programmed to stop at the semicolon, so my output is only the first evaluated expression.

Is there a simple way I can make a token for ‘?’ that will tell my program to terminate?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!