Question: prog3_1.cpp will be implemented in C/C++. Program 1 will take a single command line argument (other than the name of the program). The command line

prog3_1.cpp will be implemented in C/C++. Program 1 will take a single command line argument (other than the name of the program). The command line argument will be the name of a lua file. Your program should then execute the Lua file in a lua environment you create in your C/C++ program. You should expect the lua-5.3.4 source folder is in the current directory

Program 1 will be compiled like so:

g++ prog3_1.cpp o prog3_1 I lua-5.3.4/src L lua5.3.4/src l lua l m l dl

prog3_2.lua In Lua, implement the Infix to Postfix function that went over in class. The function InfixToPostfix(str) takes a single argument (it will be an input string). Tokenize that input string by space (split by space) and then apply the infix to postfix algorithm to return a postfix string.

prog3_3.cpp will be written in C/C++. It will be called prog3_3.cpp and can/should be an extension of prog3_1.cpp The program will create a lua environment, load/run the file specified by the command line argument. It will then take in a line of input from the stdin, call the InfixToPostfix() function in lua (use the dostring), retrieve the resulting postfix string from the lua stack (use the checkstring function) and then print the resultant postfix string.

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 Databases Questions!