Question: #include #include #include #include #include using namespace std; #include expression.h #include subexpression.h #include symboltable.h #include parse.h SymbolTable symbolTable; std::ifstream fin (
#include
#include
#include
#include
#include
using namespace std;
#include "expression.h
#include "subexpression.h
#include "symboltable.h
#include "parse.h
SymbolTable symbolTable;
std::ifstream finC:pathtoinputtxt;
void parseAssignmentsstd::stringstream& in
char assignop, delimiter;
std::string variable;
double value;
do
variable parseNamein;
in std::ws assignop value delimiter;
symbolTable.insertvariable value;
while delimiter ;
int main
const int SIZE ;
char lineSIZE;
std::ifstream fininputtxt;
if fin
std::cerr "Error: Unable to open input file." std::endl;
return ;
while fingetlineline SIZE
std::stringstream inline;
try
char paren;
in paren;
Expression expression SubExpression::parsein;
char comma;
in comma;
parseAssignmentsin;
double result expressionevaluate;
std::cout line result std::endl;
catch const std::exception& ex
std::cerr "Error: exwhat std::endl;
return ;
a ~ a ;
x y x y ;
zz z;
b b ;
c d c d ;
e & e ;
f f ;
g # g ;
tt ss tt ;
aa aa aa ; for some reason my code cant open up the input text file
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
