Beruflich Dokumente
Kultur Dokumente
Tantoyuca
Docente:
M.C.C. Manuel Hernández Hernández
Alumnos:
Ismael Herbert Hernández
Jesús Santiago Antonio
Ángel Alberto Villanueva Santiago
Materia:
Lenguajes y Autómatas II
Carrera:
Ingeniería en Sistemas Computacionales
Semestre:
7° B
Fecha:
08 de Octubre de 2018
Lenguaje.
Nombre: GATSAMHP.
Extensión: Nombre_Archivo.jai
Paradigma de programación.
• Imperativo (Compilador)
Alfabeto.
Σ={a, b, c, d, e, f, g, h, i ,j ,k ,l ,m ,n , o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I,
J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, +, -, *, /, %, =, (, ),
Gramática
Programa: START Secuencia_Instrucciones END
Secuencia_Instrucciones: Instrucción Secuencia_Instrucciones | Instrucción
Instruccion: Declaración | Asignación | Metodo | InstSI | InstSINO | InstMIENTRAS |
InstPARA | Switch_case | Print
Declaracion: Tipo_d Variable;
Parametro: Tipo_d Variable, Parametro | Tipo_d Variable
Asignacion: Variable = Exp;
Exp: Exp Operadores Factor | Factor
Factor: Exp | Numero | Variable
Metodo: Tipo_d | void id ( ) {Secuencia_Instrucciones} | Tipo_d | void id (Parametro)
{Secuencia_Instrucciones}
Operadores: + | - | * | / | < | <= | > | >= | == | != | | | & | <>
Tipo_d: int | boolean | String | double | char
InstSI: if (Exp) { Secuencia_Instrucciones }
InstSINO: if (Exp) { Secuencia_Instrucciones } else { Secuencia_instrucciones }
InstMIENTRAS: while (Exp) { Secuencia_Instrucciones }
InstPARA: for (Exp) { Secuencia_Instrucciones }
Switch_case: switch (Variable) { Casos }
Casos: Casos Caso | Caso
Caso: case{Secuencia_Instrucciones};
Print: print Concatenacion | Cadena | Variable
Cadena: TIPO_STRING
Concatenacion: Cadena + Variable | Variable + Variable
Variable: id
Numero: Numero Dígito | Digito
Digito: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9