diff --git a/LangS.cpp b/LangS.cpp index a81084e..81496b6 100644 --- a/LangS.cpp +++ b/LangS.cpp @@ -9,28 +9,58 @@ int yylex (void); map varTable; +/** +* Converts a string into a double. +* @return The double repersented by the string. +* @param text The string to convert. +* Uses stringstream for the conversion, so 7k.89 is 7. +*/ double str2num(string text){ stringstream ss(text); double ret; ss>>ret ? ret : throw text; return ret; -} +}//end str2num +/** +* Converts a double to a string. +* @param val The double to convert. +* @return The string repersenting the double. +*/ string num2str(double val){ stringstream ss; ss<