Thursday, September 24
Consider the extended BNF grammar in problem 2 of the previous hw.
Your task is to write code that:
More specifically, you should write the functions:
- determines if a given string is valid
- determine a list of "tokens" in the string if it is
valid expression. In this context, tokens are:
- anything that is a <symbol>
- anything that is an <operator>
- anything that is a <number>
/* This function returns true if the input is
valid <Expression> as
determined by the previous Extended BNF.
bool validExpression(string input);
This function returns a list of the tokens in the input.
within the context of the BNF.
vector<string> splitIntoTokens(string input);
To help you with the structure, you are given the following files:
There should be a comment at the top of each program file with your name
in it. The comment should also contain a brief description of the
Please use descriptive names for functions/variables, etc.
Each function should have a comment describing it's purpose.
Be sure to include information on the parameters.
Any place where you take code or ideas from other people or sources, you
should cite this in a comment.
Feel free to put additional comments in programs as you see fit.
Handin instructions TBA.