Skip to content
C++ Stack and Tokenizer for my programming languages class at SDSU
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information. Update Mar 8, 2017
Stack.cpp Part 3 Mar 5, 2017
Stack.hpp Part 3 Mar 5, 2017
Tokenizer.cpp Updated to all work Mar 10, 2017
Tokenizer.hpp fixes again Mar 9, 2017
prog2_1.cpp Updated Program files to work with tester Mar 8, 2017
prog2_2.cpp Updated to all work Mar 10, 2017
prog2_3.cpp Updated to all work Mar 10, 2017

Assignment 2

This assignment is a collection of C++ programs that implement two classes (Tokenizer and Stack) in order to build off of the previous Assignment 1.


C++ class that builds a simple stack that can push, pop, and print the items within the stack.


The header file for the Stack class. Implemented in Stack.cpp.


C++ class that takes user input from STDIN and tokenizes it space delimited into a size 2 string array and returns the array. If there is only one token, the second item in the array is "". Only returns proper user input.


The header for for the Tokenizer class. Implemented in Tokenizer.cpp


This program acts much like prog1_5 in Assignment 1. It takes in user input (no more than 65 characters) and checks the number and types of arguments (only 1 integer argument). The program only prints out STR INT or STR if the user input was tokenized into a string and int or just a string. Program terminated on "quit"


This program does the same thing as prog2_1 but it implements the Tokenizer class in order to perform its task.


This program builds on prog2_2, in that it utilizes the Tokenizer class in order to get tokenized user input. However, if user input is a STR INT or STR, it checks if the user typed "push int" or "pop". If it is "push int" the int is pushed onto the stack created by the Stack.cpp class, and if it is "pop" the last item in the stack is popped (if the stack is not empty). The program ends by printing the items within the stack.

You can’t perform that action at this time.