EDIT::ADDING FULL CODE: Here is a LINK to the rest of the code on github.
Also, here is the rest of the Joker.cpp:
void Joker::addWords(QueueList<Function> new_dict) {
while(!new_dict.isEmpty()) {
dictionary.push(new_dict.pop());
}
}
bool Joker::queueListContains(String theWord, QueueList<Function> &list) {
Serial.println("Finding word:");
QueueList<Function> temp;
while(!list.isEmpty()) {
Function r = list.pop();
temp.push(r);
Serial.print(">> ");
Serial.println(theWord);
Serial.print(">> equals? ");
Serial.println(r.f_name);
delay(5);
if(r.f_name.equals(theWord)) {
while(!temp.isEmpty())
list.push(temp.pop());
return true;
}
}
while(!temp.isEmpty())
list.push(temp.pop());
return false;
}
Function Joker::getDictionaryFunction(String theWord, QueueList<Function> &list) {
QueueList<Function> temp;
while(!list.isEmpty()) {
Function theFunction = list.pop();
temp.push(theFunction);
if(theFunction.f_name.equals(theWord)) {
while(!temp.isEmpty()) {
list.push(temp.pop());
}
return theFunction;
}
}
}
void Joker::error(String message, SoftwareSerial &lcd) {
lcd.write(12);
delay(5);
lcd.write(128);
lcd.print(message);
delay(2000);
}
And the header:
#pragma once
class Joker {
private:
bool queueListContains(String theWord, QueueList<Function> &list);
Function getDictionaryFunction(String theWord, QueueList<Function> &list);
public:
QueueList<float> stack;
QueueList<Function> dictionary;
void error(String message, SoftwareSerial &lcd);
void addWords(QueueList<Function> new_dict);
bool runCode(QueueList<String> lineTable, SoftwareSerial &lcd);
};