Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

3. What might you have done differently

Answered: 1 week ago

Question

4. Did you rethink your decision?

Answered: 1 week ago

Question

3. Did you seek anyones advice?

Answered: 1 week ago