RESPONDER UNA PREGUNTA

Si para responder la pregunta, crees necesario enviar un archivo adjunto, puedes hacerlo a traves del correo [email protected]

    Pregunta:  23629 - AUTOMATAS DE PILA EN C++
Autor:  Jairo Alberto Cardenas
Amigos necesito su apoyo con el codigo o programa para construir un simulador de automatas de pila usando pilas y abstracción en C++, igualmente necesito el codigo para el automata lineal limitado.

Tengo un codigo para el automata de pila usando pilas (stack), pero me gustaria que lo revisaran.

S.CreateStack()
//Create an stack S.

S.DestroyStack()
//Destroy Stack S

S.StackIsEmpty()
//Determines whether stack S is empty

//Push characters onto the stack
I = 0
InLanguage = TRUE //assume string is in language

while (I < strlen(Str))
{ Ch = Str[I]
++I

//push a character
if (Ch = ‘X’ && S.StackIsEmpty())
S.Push(‘X’, success) //push X on stack
else if (Ch = ‘Y’)
S.Pop(Success) //pop the Top of stack

else if (Ch = Y)
if (S.StackIsEmpty() or Ch = ‘Y’)
S.Push(‘Y’, success) //push Y on stack
else if (Ch = ‘X’)
S.Pop(Success) //pop the Top of stack
} //end while

if (InLanguage && S.StackIsEmpty())
cout <<”String is in language” << endl;
else
cout <<”String is not in language” << endl;

Atte,

Jairo Alberto Cardenas


Nombre
Apellidos
Correo
Comentarios