This project is built to practice several languages from the Fall 2017 semester. Each program solves a given problem.
This program asks the user for their name and reponds with a greeting.
- Compile
gcc prog1_1.c -o prog1_1.out
- Run
./prog1_1.out
- Compile
gcc program.c -o program.out
- Run
./program.out
This program takes up to 65 chars from stdin that are space delimited and terminated by a newline. It then outputs each token from the input on seperate lines, enclosed by equals signs. Multiple delimiters are ignored.
This program prompts the user for an input with >. It then takes each token from the input and prints if the token is a STR or an INT for each token.
This program runs similarly to prog2_2, however, includes an error condition in the event that more than two tokens are entered.
This program runs similarly to prog2_3, however, includes another error condition in the event that too many chars are entered. It also continues to take input until the user enters "quit"; case insensitive. It takes a maximum of 20 chars.
You need the lua-5.3.5 source files to execute prog3.
This program takes the name of a Lua file as a command line argument and executes it within a Lua environment in the program.
- Download & extract lua, then do
make linux
; if it complains about readline missing,apt-get install libreadline-dev
- Compile
g++ prog3_1.cpp –o prog3_1.out –Ilua-5.3.5/src –Llua-5.3.5/src –llua –lm –ldl
- Run
./prog3_1.out prog3_2.lua
This program has the InfixToPostfix() function which inputs a single string, tokenizes it (space delimeted), and returns a postfix string.
This program operates the same as prog3_1 but recieves an additional command line input and executes the InfixToPostfix() function to return the resulting postfix string from the Lua stack.
- Compile
g++ prog3_3.cpp –o prog3_3.out –Ilua-5.3.5/src –Llua-5.3.5/src –llua –lm –ldl
- Run
./prog3_3.out prog3_2.lua
This program takes the name of a text file as a command line argument and tokenize it, space delimited, and print it to stdout seperated by commas.
- Run
python3 prog4_1.py filename.txt
This program has 8 functions (push, pop, add, sub, mul, div, mod, and constructor) to implement the funtionality of a stack machine.
This program receives the same input as prog4_1.py, tokenizes it, and uses the first token to perform any of the 8 functions from the stack.
- Run
python3 prog4_2.py filename.txt