📄 comandoprint.cpp
字号:
/*
TP2 LP INTERPRETADOR TINY
ALUNO : ANDRE LUIS DURAO ABDO
MATRICULA : 283999
DATA DA ENTREGA : 10/05/2007
*/
//ComandoPrint.cpp
#include "ComandoPrint.h"
ComandoPrint::ComandoPrint(const string& str,bool tipo,Memoria *mem,int linha){
//tipo define se o print e de strings ou de variaveis na memoria
//tipo == true ->string
strMem = str;
tipoOp = tipo;
this->mem = mem;
//seta linha no vetor de execucao
this->linha = linha;
}
int ComandoPrint::executa(){
if(tipoOp)
cout << strMem;
else{
string *temp = mem->getValue(strMem);
cout << *temp;
}
return (linha+1);
}
string ComandoPrint::toString(){
string saida="";
if (tipoOp)
saida = "print ('"+ strMem+ "')";
else
saida = "print ("+ strMem+ ")";
return saida;
}
void ComandoPrint::defineLinhaSalto(int nolinha){
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -