Beruflich Dokumente
Kultur Dokumente
TEPOSCOLULA
INGENIERA EN SISTEMAS COMPUTACIONALES
PRESENTA:
Elioena Garca Garca
MATRICULA:
13ISC215
DOCENTE:
Ing. Luis Hernndez Aparicio
MATERIA:
Lenguaje y Autmatas I
ACTIVIDAD:
Reporte de Investigacin
INTRODUCCION.
ANALISIS LEXICO.
Lexemas
Tokens
Sentencias
instruccin)
Token
Patron
OPERADD
[+-]
OPERMUL
[*/]
NUMEINT
[0-9]+
IDENT
[a-zA-Z]+
AGRUP
[()]
foreach(Simbolo s in analex.GetSimbolos())
{
switch((int)s.Token)
{
case (int)Tokens.IDENT:{Console.WriteLine("IDENT");break;}
case (int)Tokens.OPERADD:{Console.WriteLine("OPERADD");break;}
case (int)Tokens.OPERMUL:{Console.WriteLine("OPERMUL");break;}
case (int)Tokens.NUMEINT:{Console.WriteLine("NUMEINT");break;}
case (int)Tokens.OPERAGRU:{Console.WriteLine("OPERAGRU");break;}
case (int)Tokens.ERROR:{Console.WriteLine("ERROR");break;}
}
}
Console.ReadLine();
}
}
}
Compile y ejecute la aplicacin
CONCLUSION
A manera de concluir conocer las expresiones regulares es un medio por el cual
nosotros podemos conocer categoras de los tokens, bien la estructura de una
expresin regular es la forma de validar ciertos requerimientos dentro de un
sistema.
BIBLIOGRAFIA
Alejandro, H. (2012). ANLISIS LXICOS. Mxico. Mc Graw Hill. Pgs. 189.