Esempio n. 1
0
void RivenSwitchCommand::dump(byte tabs) {
	Common::String varName = _vm->getStack()->getName(kVariableNames, _variableId);
	printTabs(tabs); debugN("switch (%s) {\n", varName.c_str());
	for (uint16 j = 0; j < _branches.size(); j++) {
		printTabs(tabs + 1);
		if (_branches[j].value == 0xFFFF)
			debugN("default:\n");
		else
			debugN("case %d:\n", _branches[j].value);
		_branches[j].script->dumpScript(tabs + 2);
		printTabs(tabs + 2); debugN("break;\n");
	}
	printTabs(tabs); debugN("}\n");
}
Esempio n. 2
0
void OrderIn::printNode()
{
  printTabs();
  std::cerr << "========OrderIn Node========" << std::endl;
  Expr::printNode();
  printEndNode();
}
Esempio n. 3
0
void Not::printNode()
{
  printTabs();
  std::cerr << "========Not Node========" << std::endl;
  LogicExpr::printNode();
  printEndNode();
}
Esempio n. 4
0
void printIDs(listID* ids,int tabs, int n_type, int type) {
    while(ids != NULL) {
        printTabs(tabs);
        printf("Id(%s)\n",ids->id);
        ids = ids->next;
    }
}
Esempio n. 5
0
void Id::printNode()
{
  printTabs();
  std::cerr << "========Id Node========" << std::endl;
  printTabsClean();
  std::cerr << "Offset: " << offset << std::endl;
  Expr::printNode();
  printEndNode();
}
Esempio n. 6
0
void Return::printNode()
{
  printTabs();
  std::cerr << "========Return Node========" << std::endl;
  Stmnt::printNode();
  tabs++;
  if(ret != NULL) ret->printNode();
  tabs--;
  printEndNode();
}
Esempio n. 7
0
int main()
{
    char tab[2*65536];
    memset(tab, 0, 65536);
    setTab(tab, nmstrt, sizeof(nmstrt)/sizeof(nmstrt[0]));
    memcpy(tab + 65536, tab, 65536);
    setTab(tab + 65536, name, sizeof(name)/sizeof(name[0]));
    printTabs(tab);
    return 0;
}
Esempio n. 8
0
void ServeOut::printNode()
{
  printTabs();
  std::cerr << "========ServeOut Node========" << std::endl;
  Stmnt::printNode();
  tabs++;
  if(outExpr != NULL) outExpr->printNode();
  tabs--;
  printEndNode();
}
Esempio n. 9
0
/*
    Prints the AST
        @Param AST Root of the AST
*/
void printAST(Node* AST) {
    /*printNode(AST, 0);*/
    if(AST != NULL) {
        printf("%s\n", NODE_STRING[AST->n_type]);  
        printTabs(1);
        printf("Id(%s)\n", AST->id->id);   
    }
    
    if(AST->next != NULL)
        printSubTree(AST->next,1);
}
Esempio n. 10
0
/*
Function: displayIdentifierAttributes() const

Description: This function will print out all of the attributes associated 
with a symbol table entry. 
*/
void symbolTableEntry::displayIdentifierAttributes(int tabCount) const {
	int idNumTemp = 0;
	std::string idTemp = getIdentifierName();
	printTabs(tabCount);
	std::cout << "Identifier name: " << idTemp << std::endl;
	idTemp = getIdentifierType_String();
	printTabs(tabCount);
	std::cout << "Identifier type: " << idTemp << std::endl;
	printTabs(tabCount);
	std::cout << "Identifier value: ";
	printIdentifierValue(); 
	std::cout << std::endl;
	//!!!!!!!!!!!!!!!!! CHECK THIS LATER !!!!!!!!!!!
	
	if (isFunc) {
		idNumTemp = getNumParams(); 
		std::cout << "Identifier is a function." << std::endl;
		std::cout << "Identifier has " << idNumTemp << " parameters.";
		std::cout << std::endl; 
		std::cout << "Identifier parameters: " << std::endl;
		viewParams(); 
	}

	else if (isPtr) {
		idNumTemp = getNumPtrs();
		std::cout << "Identifier is a pointer." << std::endl;
		std::cout << "Identifier has " << idNumTemp << " parameters.";
		std::cout << std::endl; 
	}

	else if (isArr) {
		idNumTemp = getNumArrDims();
		std::cout << "Identifier is an array." << std::endl;
		std::cout << "Identifier has " << idNumTemp << " dimensions.";
		std::cout << std::endl;
		std::cout << "Identifier dimensions: " << std::endl;
		for (unsigned int i = 0; i < arrayDimensions.size(); i++) {
			std::cout << "Dimension #" << i << " :" << arrayDimensions[i] << std::endl; 
		} 
	}
}
Esempio n. 11
0
/*
    Prints a Node type
        @Param node Node to be print
*/
void printNode( Node* currentNode, int tabs) {

    if(currentNode->n_type == NODE_DONTPRINT)
           return;

    /* TODO: falta aqui um tipo acho eu */
    else if(currentNode->n_type == NODE_BOOLLIT || currentNode->n_type == NODE_INTLIT || currentNode->n_type == NODE_ID ) {
        printTabs(tabs);
        printf("%s(%s)\n",NODE_STRING[currentNode->n_type], currentNode->value);
    }
    else {
        printTabs(tabs);
        printf("%s\n", NODE_STRING[currentNode->n_type]);
        if(currentNode->n_type == NODE_VARDECL || currentNode->n_type == NODE_PARAMDECL || currentNode->n_type == NODE_METHODDECL){
            printTabs(tabs + 1);
            printf("%s\n",NODE_TYPE_NAMES[currentNode->type]);
        }
        printIDs(currentNode->id,tabs+1, currentNode->n_type, currentNode->type);
    }
        
}
Esempio n. 12
0
void printList(RST* node, int depth) {
    RST* current = node;
    if (depth==0){
        printf("Root is %i\n", current->index);
    }
    printTabs(depth);
    printf("Point %i has distance %i ", current->index, current->pathLength);
    if(current->indegree >0){
        printf("and has in-degree %i:\n", current->indegree);
    } else {
        printf("and has in-degree %i//\n", current->indegree);
    }

    if (depth!=0){
        printTabs(depth);
        printf("Point %i has overlap of %i, with path ", current->index, current->overlap);
        printPath(current->path);

    }
    for(int j=0; j< current->indegree; j++) {
        printList(current->child[j], depth+1);
    }
}
	ostream& EmptyElement::toString(ostream& stream, int depth)
	/*
	On affiche d'abord la balise ouvrante, l'ensemble des attributs puis la balise
	fermante.
	*/
	{
		printTabs(stream, depth);
		stream << beginCharacter(); 
		if (!name.first.empty())
		{
			stream << name.first << ":";
		}

		stream << name.second;
		for(AttList::iterator it = attributes.begin();
			it != attributes.end();
			++it)
		{
			stream << " " << it->first << "=\"" << it->second << "\"";
		}
		stream << endCharacter(); 
		return stream;
	}
Esempio n. 14
0
void RivenTimerCommand::dump(byte tabs) {
	printTabs(tabs);
	debugN("doTimer();\n");
}
Esempio n. 15
0
void RivenStackChangeCommand::dump(byte tabs) {
	printTabs(tabs);
	debugN("changeStack(%d, %d);\n", _stackId, _cardId);
}
Esempio n. 16
0
	ostream& Data::toString(ostream& stream, int depth)
	{
		printTabs(stream, depth);
		stream << data;
		return stream; 
	}
Esempio n. 17
0
void RivenSimpleCommand::dump(byte tabs) {
	printTabs(tabs);
	debugN("%s;\n", describe().c_str());
}