removed most of the shared_ptr usage and retooled temporary variables to recycle

This commit is contained in:
Samuel D. Crow
2021-03-28 22:35:35 -05:00
parent fd89b1a054
commit bb2be9c16c
7 changed files with 452 additions and 291 deletions

View File

@@ -8,7 +8,7 @@
*/
#include "yab2cpp.h"
printSegment::printSegment(shared_ptr<expression>e, enum SEPARATORS s)
printSegment::printSegment(expression *e, enum SEPARATORS s)
{
cargo=e;
sep=s;
@@ -18,11 +18,11 @@ void printSegment::generate()
{
if (cargo!=NULL)
{
shared_ptr<operands>op=cargo->evaluate();
operands *op=cargo->evaluate();
switch (op->getSimpleVarType())
{
case T_STRINGVAR:
output_cpp << "printf(\"%s\", " << op->boxName() << ");\n";
output_cpp << "puts(" << op->boxName() << ");\n";
break;
case T_INTVAR:
output_cpp << "printf(\"%d\", " << op->boxName() << ");\n";