Skip to content

Commit

Permalink
push de nuevo sin archivos basura
Browse files Browse the repository at this point in the history
  • Loading branch information
pablorich committed May 16, 2018
1 parent 99b4b6f commit 43df367
Show file tree
Hide file tree
Showing 16 changed files with 3,053 additions and 3,130 deletions.
416 changes: 208 additions & 208 deletions Arbol.h

Large diffs are not rendered by default.

1,052 changes: 526 additions & 526 deletions ArbolSintactico.h

Large diffs are not rendered by default.

1,636 changes: 818 additions & 818 deletions Lexico.h

Large diffs are not rendered by default.

1,642 changes: 821 additions & 821 deletions Nodos.h

Large diffs are not rendered by default.

810 changes: 405 additions & 405 deletions Sintactico.h

Large diffs are not rendered by default.

32 changes: 0 additions & 32 deletions Traductor.depend

This file was deleted.

45 changes: 0 additions & 45 deletions Traductor.layout

This file was deleted.

Binary file removed bin/Debug/Traductor.exe
Binary file not shown.
10 changes: 5 additions & 5 deletions entrada.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
a = 5;
b = a - 3;
print (a+2);
a = 34;
c = 7+3;
a = 5;
b = a - 3;
print (a+2);
a = 34;
c = 7+3;
print (a+3);
260 changes: 130 additions & 130 deletions lista.h
Original file line number Diff line number Diff line change
@@ -1,130 +1,130 @@
#ifndef LISTA_H_INCLUDED
#define LISTA_H_INCLUDED

class ActualID
{
public:
ActualID *siguiente = NULL;
string simbolo;
char tipo;

ActualID(string sim, char t)
{
simbolo = sim;
tipo = t;
}

void setTipo(char t)
{
tipo = t;
}

char getTipo()
{
return tipo;
}

string getID()
{
return simbolo;
}
};
typedef ActualID *pActualID;


class Lista
{
private:
pActualID root;
pActualID fin;
public:

Lista()
{
root = NULL;
fin = NULL;
}

bool vacio()
{
return (root == NULL);
}

void insertaNodo(string nuevo, char t)
{
if(vacio())
{
root = new ActualID(nuevo,t);
fin = root;
}
else
{
if(!buscaID(nuevo))
{
fin->siguiente = new ActualID(nuevo, t);
fin = fin->siguiente;
}
else
{
updateType(nuevo, t);
}
}
}

bool buscaID(string busca)
{
pActualID temp = root;
while(temp != NULL)
{
if(temp->getID() == busca)
{
return true;
}
temp = temp->siguiente;
}
return false;
}

char tipoID(string busca)
{
pActualID temp = root;
while(temp != NULL)
{
if(temp->getID() == busca)
{
return temp->getTipo();
}
temp = temp->siguiente;
}
return 'e';
}

void updateType(string busca, char t)
{
pActualID temp = root;
while(temp != NULL)
{
if(temp->getID() == busca)
{
temp->setTipo(t);
break;
}
temp = temp->siguiente;
}
}

void imprime()
{
pActualID temp = root;
while(temp != NULL)
{
cout << temp->getID() << "\t" << temp->getTipo() << endl;
temp = temp->siguiente;
}
}


};

#endif // LISTA_H_INCLUDED

#ifndef LISTA_H_INCLUDED
#define LISTA_H_INCLUDED

class ActualID
{
public:
ActualID *siguiente = NULL;
string simbolo;
char tipo;

ActualID(string sim, char t)
{
simbolo = sim;
tipo = t;
}

void setTipo(char t)
{
tipo = t;
}

char getTipo()
{
return tipo;
}

string getID()
{
return simbolo;
}
};
typedef ActualID *pActualID;


class Lista
{
private:
pActualID root;
pActualID fin;
public:

Lista()
{
root = NULL;
fin = NULL;
}

bool vacio()
{
return (root == NULL);
}

void insertaNodo(string nuevo, char t)
{
if(vacio())
{
root = new ActualID(nuevo,t);
fin = root;
}
else
{
if(!buscaID(nuevo))
{
fin->siguiente = new ActualID(nuevo, t);
fin = fin->siguiente;
}
else
{
updateType(nuevo, t);
}
}
}

bool buscaID(string busca)
{
pActualID temp = root;
while(temp != NULL)
{
if(temp->getID() == busca)
{
return true;
}
temp = temp->siguiente;
}
return false;
}

char tipoID(string busca)
{
pActualID temp = root;
while(temp != NULL)
{
if(temp->getID() == busca)
{
return temp->getTipo();
}
temp = temp->siguiente;
}
return 'e';
}

void updateType(string busca, char t)
{
pActualID temp = root;
while(temp != NULL)
{
if(temp->getID() == busca)
{
temp->setTipo(t);
break;
}
temp = temp->siguiente;
}
}

void imprime()
{
pActualID temp = root;
while(temp != NULL)
{
cout << temp->getID() << "\t" << temp->getTipo() << endl;
temp = temp->siguiente;
}
}


};

#endif // LISTA_H_INCLUDED

Loading

0 comments on commit 43df367

Please sign in to comment.