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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started