1 // $ANTLR : "AnaSem.g" -> "AnaSem.java"$
7 import antlr.TreeParser;
9 import antlr.collections.AST;
10 import antlr.RecognitionException;
11 import antlr.ANTLRException;
12 import antlr.NoViableAltException;
13 import antlr.MismatchedTokenException;
14 import antlr.SemanticException;
15 import antlr.collections.impl.BitSet;
17 import antlr.collections.impl.ASTArray;
20 public class AnaSem extends antlr.TreeParser implements AnaSemTokenTypes
23 int cont_dev; // variable contador del numero de instrucciones DEV en un metodo
\r
26 Atr_Expr AS_Literal(AST lit){
\r
27 Atr_Expr result = new Atr_Expr();
\r
29 if(lit == null) return null;
\r
30 switch(lit.getType()){
\r
32 tipo = (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(ENTERO,"entero")));
\r
35 tipo = (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(REAL,"real")));
\r
38 tipo = (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(CARACTER,"caracter")));
\r
42 tipo = (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(LOGICO,"logico")));
\r
47 result.setTipo(tipo);
\r
48 result.setLVal(false);
\r
49 result.setRVal(true);
\r
53 Atr_Expr AS_Acceso_Simple(AST dec){
\r
54 Atr_Expr result = new Atr_Expr();
\r
56 if (dec == null) return null;
\r
57 switch(dec.getType()){
\r
59 System.out.println("ERROR CT: el tipo es modulo");
\r
61 case CLASE: //acceso a clase no instanciable
\r
63 result.setLVal(false);
\r
64 result.setRVal(false);
\r
66 case ATRIBUTO://acceso a un atributo de la propia clase
\r
67 tipo = dec.getFirstChild().getNextSibling();
\r
68 result.setLVal(true);
\r
69 result.setRVal(true);
\r
71 case METODO: //acceso a un metodo de la propia clase
\r
72 tipo = dec.getFirstChild();
\r
73 result.setLVal(false);
\r
74 result.setRVal(false);
\r
77 tipo = dec.getFirstChild().getNextSibling();
\r
78 result.setLVal(false);
\r
79 result.setRVal(true);
\r
81 case VARIABLE_LOCAL:
\r
82 tipo = dec.getFirstChild().getNextSibling();
\r
83 result.setLVal(true);
\r
84 result.setRVal(true);
\r
89 result.setTipo(tipo);
\r
93 Atr_Expr AS_Acceso_Objeto(Atr_Expr atr_raiz, AST raiz, AST atrib){
\r
94 Atr_Expr result = new Atr_Expr();
\r
95 AST tipo, tipo_raiz, aux;
\r
96 if(atr_raiz == null || raiz == null || atrib ==null) return null;
\r
97 //comprobar que el tipo de la raiz sea clase
\r
98 tipo_raiz = atr_raiz.getTipo();
\r
99 if(tipo_raiz.getType() != CLASE){
\r
100 System.out.println("ERROR CT: "+raiz.getFirstChild().getText()+" no es una clase");
\r
103 //si la raiz es una clase instanciable
\r
104 if(raiz.getFirstChild().getNextSibling().getType() == CLASE){
\r
105 if(tipo_raiz.getFirstChild().getNextSibling().getType() != NO_INST){
\r
106 System.out.println("ERROR CT: "+raiz.getFirstChild().getText()+" es una clase instanciable");
\r
110 //si la raiz es un objeto
\r
112 if(tipo_raiz.getFirstChild().getNextSibling().getType() != INST){
\r
113 System.out.println("ERROR CT: "+raiz.getFirstChild().getText()+" es un objeto de clase no instanciable");
\r
117 //comprobar que "atrib" sea un atributo o metodo de la clase y ademas sea visible
\r
118 aux = tipo_raiz.getFirstChild().getNextSibling().getNextSibling();
\r
120 if(aux.getType() == METODO){
\r
121 if(aux.getFirstChild().getFirstChild().equals(atrib))
\r
124 if(aux.getFirstChild().equals(atrib))
\r
127 aux = aux.getNextSibling();
\r
130 System.out.println("ERROR CT: el atributo "+atrib.getText()+" no pertenece a la clase "+raiz.getFirstChild().getText());
\r
133 if(aux.getFirstChild().getNextSibling().getNextSibling().getType() != VISIBLE){
\r
134 System.out.println("ERROR CT: el atributo "+atrib.getText()+" no es visible");
\r
138 //tipo de la expresion
\r
139 if(aux.getType() == METODO){
\r
140 tipo = aux.getFirstChild();
\r
141 result.setLVal(false);
\r
142 result.setRVal(false);
\r
144 tipo = aux.getFirstChild().getNextSibling();
\r
145 result.setLVal(true);
\r
146 result.setRVal(true);
\r
148 result.setTipo(tipo);
\r
153 //hay que pasarle la raiz para saber el nombre de la raiz cuando no es un metodo
\r
154 Atr_Expr AS_Llamada(Atr_Expr atr_raiz, LinkedList expresiones){
\r
155 ListIterator it = expresiones.listIterator();
\r
156 Atr_Expr result = new Atr_Expr();
\r
157 AST pars, par_f, tipo;
\r
160 //comprobar que atr_raiz no se a null
\r
161 if(atr_raiz == null || expresiones == null){
\r
164 //comprobar que la raiz sea de tipo prototipo
\r
165 if(atr_raiz.getTipo().getType() != PROTOTIPO){
\r
166 System.out.println("ERROR CT: "+atr_raiz.getTipo().getText()+" no es un metodo.");
\r
169 //comprobar que los parametros reales coinciden con los formales
\r
170 pars = atr_raiz.getTipo().getFirstChild().getNextSibling();
\r
171 par_f = pars.getFirstChild();
\r
172 while (it.hasNext() && (par_f != null)){
\r
173 par_r = (Atr_Expr)it.next();
\r
174 if(! par_f.getFirstChild().getNextSibling().equalsTree(par_r.getTipo())){
\r
175 System.out.println("ERROR CT: El numero de parametros en el metodo \""+atr_raiz.getTipo().getFirstChild().getText()+"\" es incorrecto.");
\r
178 par_f = par_f.getNextSibling();
\r
180 if(it.hasNext() && (par_f == null)){
\r
181 System.out.println("ERROR CT: El numero de parametros en el metodo \""+atr_raiz.getTipo().getFirstChild().getText()+"\" es incorrecto.");
\r
184 if(!it.hasNext() && (par_f != null)){
\r
185 System.out.println("ERROR CT: El numero de parametros en el metodo \""+atr_raiz.getTipo().getFirstChild().getText()+"\" es incorrecto.");
\r
188 //el tipo de la expresion es el rango del metodo
\r
189 tipo = atr_raiz.getTipo().getFirstChild().getNextSibling().getNextSibling().getFirstChild();
\r
190 result.setLVal(false);
\r
191 result.setRVal(true);
\r
192 result.setTipo(tipo);
\r
196 Atr_Expr AS_Acceso_Tabla(Atr_Expr atr_raiz, LinkedList expresiones){
\r
197 if(atr_raiz == null || expresiones == null) return null;
\r
198 ListIterator it = expresiones.listIterator();
\r
199 Atr_Expr result = new Atr_Expr();
\r
203 //comprobar que el tipo de la raizes una formacion
\r
205 if(atr_raiz.getTipo().getType() != FORMACION){
\r
206 System.out.println("ERROR CT: intentando acceder a \""+atr_raiz.getTipo().getText()+"\" como formacion");
\r
209 //comprobar que el numero de expresiones coincida con el numero de dimensiones
\r
210 while(it.hasNext()){
\r
212 aux = (Atr_Expr) it.next();
\r
213 if(aux == null) return null;
\r
214 if(aux.getTipo().getType() != ENTERO){
\r
215 System.out.println("ERROR CT: no coinciden el numero de expresiones en el acceso a formacion");
\r
219 if(tam != atr_raiz.getTipo().getFirstChild().getNumberOfChildren()){
\r
220 System.out.println("ERROR CT: no coinciden el numero de expresiones en el acceso a formacion");
\r
223 tipo = atr_raiz.getTipo().getFirstChild().getNextSibling();
\r
224 result.setTipo(tipo);
\r
225 result.setLVal(atr_raiz.getLVal());
\r
226 result.setRVal(atr_raiz.getRVal());
\r
232 //AS DE EXPRESIONES
\r
234 //Expresiones binarias aritmeticas
\r
235 Atr_Expr AS_Exp_Bin_Arit(Atr_Expr e1, Atr_Expr e2){
\r
236 Atr_Expr result = new Atr_Expr();
\r
238 if(e1 == null || e2 == null) return null;
\r
240 //Comprobamos que e1 y e2 sean consultables
\r
241 if(!e1.getLVal() || !e2.getRVal()){
\r
242 if (!e2.getRVal()) men="ERROR LR: la expresion no puede aparecer a la derecha de una expresion binaria" ;
\r
243 if (!e1.getLVal()) men="ERROR LR: la expresion no puede aparecer a la izquierda de una expresion binaria" ;
\r
244 System.out.println(men);
\r
248 //Comprobamos que e1 y e2 sean numericas y compatibles
\r
249 if((e1.getTipo().getType()!=ENTERO) && (e1.getTipo().getType()!=REAL) ||
\r
250 (e2.getTipo().getType()!=ENTERO) && (e2.getTipo().getType()!=REAL)){
\r
251 System.out.println("ERROR CT: no son expresiones numericas ("+e1.getTipo().getText()+" y "+e2.getTipo().getText()+")");
\r
254 if(!e1.getTipo().equals(e2.getTipo())){
\r
255 System.out.println("ERROR CT: Los tipos no son compatibles ("+e1.getTipo().getText()+" y "+e2.getTipo().getText()+")");
\r
259 //Calculamos el tipo
\r
260 result.setTipo(e1.getTipo());
\r
261 result.setLVal(false);
\r
262 result.setRVal(true);
\r
268 //Expresiones binarias logicas
\r
269 Atr_Expr AS_Exp_Bin_Log(Atr_Expr e1, Atr_Expr e2){
\r
270 Atr_Expr result = new Atr_Expr();
\r
273 if(e1 == null || e2 == null) return null;
\r
274 //Comprobar que las expresiones son consultables
\r
275 if(!e1.getLVal() || !e2.getRVal()){
\r
276 if (!e2.getRVal()) men ="ERROR LR: la expresion no puede aparecer a la derecha de la expresion" ;
\r
277 if (!e1.getLVal()) men ="ERROR LR: la expresion "+e1.getTipo().getFirstChild().getText()+" no puede aparecer a la izquierda de la expresion" ;
\r
278 System.out.println(men);
\r
282 //Comprobamos que sean de tipo logico
\r
283 if((e1.getTipo().getType()!=LOGICO) || (e2.getTipo().getType()!=LOGICO)){
\r
284 if (e1.getTipo().getType()!=LOGICO)
\r
285 men = "ERROR CT: la expresion "+e1.getTipo().getFirstChild().getText()+"no es de tipo logico";
\r
286 if (e2.getTipo().getType()!=LOGICO)
\r
287 men = "ERROR CT: la expresion "+e2.getTipo().getFirstChild().getText()+"no es de tipo logico";
\r
288 System.out.println(men);
\r
292 //Calculamos el tipo
\r
293 result.setTipo(e1.getTipo());
\r
294 result.setLVal(false);
\r
295 result.setRVal(true);
\r
300 //Expresiones binarias relacionales
\r
301 Atr_Expr AS_Exp_Bin_Rel(Atr_Expr e1, Atr_Expr e2, AST operador){
\r
302 Atr_Expr result = new Atr_Expr();
\r
306 if(e1 == null || e2 == null || operador == null) return null;
\r
307 //Comprobamos que las expresiones son consultables
\r
308 if(!e1.getLVal() || !e2.getRVal()){
\r
309 if (!e2.getRVal()) men ="ERROR LR: la expresion no se puede consultar en la expresion binaria" ;
\r
310 if (!e1.getLVal()) men ="ERROR LR: la expresion "+e1.getTipo().getFirstChild().getText()+" no puede aparecer a la izquierda en la expresion";
\r
311 System.out.println(men);
\r
315 //No dejamos que se utilicen formaciones y comprobamos la compatibilidad de las expresiones
\r
316 if(e1.getTipo().getType()==FORMACION){
\r
317 System.out.println("ERROR CT: no puede tener formaciones en expresiones relacionales");
\r
320 men = "ERROR CT: Los tipos no son compatibles ("+e1.getTipo().getText()+" y "+e2.getTipo().getText()+")";
\r
321 if(!e1.getTipo().equals(e2.getTipo())){
\r
322 System.out.println(men);
\r
326 if((e1.getTipo().getType() == CLASE) && (!e1.getTipo().getFirstChild().equals(e2.getTipo().getFirstChild()))){ //Comparamos las clases por nombre
\r
327 System.out.println(men);
\r
331 //Miramos los grupos de operadores
\r
332 if((operador.getType()!=IGUAL && operador.getType()!=DISTINTO) && (e1.getTipo().getType()==CLASE || e1.getTipo().getType()==LOGICO)){
\r
333 System.out.println("ERROR CT: el operador \""+operador.getText()+"\" no esta permitido para los tipos usados ("+e1.getTipo().getText()+" y "+e2.getTipo().getText()+")");
\r
337 //Establecemos el tipo
\r
338 tipo = (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(LOGICO,"logico")));
\r
339 result.setTipo(tipo);
\r
340 result.setLVal(false);
\r
341 result.setRVal(true);
\r
346 //Expresiones unarias aritmeticas == MENOS UNARIO
\r
347 Atr_Expr AS_Exp_Una_Arit(Atr_Expr e){
\r
348 Atr_Expr result = new Atr_Expr();
\r
351 if(e == null) return null;
\r
352 //e tiene que ser consultable
\r
354 men ="ERROR LR: la expresion no es consultable" ;
\r
355 System.out.println(men);
\r
359 //comprobar que e es de tipo numerico
\r
360 if( e.getTipo().getType()!=ENTERO && e.getTipo().getType()!=REAL){
\r
361 System.out.println("ERROR CT: el menos unario solo puede ser utilizado en expresiones numericas");
\r
365 //Establecemos el tipo
\r
366 result.setTipo(e.getTipo());
\r
367 result.setLVal(false);
\r
368 result.setRVal(true);
\r
373 //Expresiones unarias logicas == NEGACION
\r
374 //Identica a la anterior
\r
375 Atr_Expr AS_Exp_Una_Log(Atr_Expr e){
\r
376 Atr_Expr result = new Atr_Expr();
\r
378 if(e == null) return null;
\r
379 //e tiene que ser consultable
\r
381 System.out.println("ERROR LR: la expresion no es consultable" );
\r
385 //comprobar que e es de tipo numerico
\r
386 if( e.getTipo().getType()!=LOGICO){
\r
387 System.out.println("ERROR CT: la negacion solo se puede utilizar con expresiones logicas");
\r
391 //Establecemos el tipo
\r
392 result.setTipo(e.getTipo());
\r
393 result.setLVal(false);
\r
394 result.setRVal(true);
\r
401 void AS_Asignacion(Atr_Expr e1, Atr_Expr e2, AST e3, AST e4){
\r
402 //comprobar si alguno es null
\r
404 if(e1==null || e2 == null) return;
\r
406 //Comprobamos la consultabilidad de las expresiones
\r
407 if(!e1.getLVal() || !e2.getRVal()){
\r
409 men ="ERROR LR: la expresion "+e4.getFirstChild().getText()+" no puede aparecer a la derecha de una asignacion." ;
\r
410 if (!e1.getLVal()) men ="ERROR LR: el "+e3.getFirstChild().getNextSibling().getText()+" "+e3.getFirstChild().getText()+" no puede aparecer a la izquierda de una asignacion." ;
\r
411 System.out.println(men);
\r
415 //No dejamos asignar formaciones y comprobamos la compatibilidad de tipos
\r
416 if(e1.getTipo().getType()==FORMACION){
\r
417 System.out.println("ERROR CT: no dejamos asignar formaciones");
\r
419 men = "ERROR CT: Los tipos no son compatibles ("+e1.getTipo().getText()+" y "+e2.getTipo().getText()+")";
\r
420 if(!e1.getTipo().equals(e2.getTipo())){
\r
421 System.out.println(men);
\r
423 if((e1.getTipo().getType() == CLASE) && (!e1.getTipo().getFirstChild().equals(e2.getTipo().getFirstChild()))){ //Comparamos las clases por nombre
\r
424 System.out.println(men);
\r
429 void AS_Condicional(Atr_Expr e){
\r
431 if (e == null) return;
\r
433 men ="ERROR LR: la expresion no es consultable" ;
\r
434 System.out.println(men);
\r
438 //Comprobamos que es de tipo logico
\r
439 if(e.getTipo().getType()!=LOGICO){
\r
440 System.out.println("ERROR CT: no es un tipo logico");
\r
444 //Instruccion de devolucion
\r
445 int AS_Devolucion(AST tipo_dev, Atr_Expr e, int cont){
\r
447 // String men = "ERROR CT: Los tipos no son compatibles (entero y real)"
\r
448 if(tipo_dev == null || e == null) return cont+1;
\r
449 //Comprobamos que el metodo sea funcional
\r
452 System.out.println("ERROR CT: el metodo no es funcional");
\r
456 //Comprobar que la expresion e es consultable
\r
458 System.out.println("ERROR CT: la expresion no es consultable, no se puede devolver");
\r
461 men = "ERROR CT: Los tipos no son compatibles ("+e.getTipo().getText()+" y "+tipo_dev.getText()+")";
\r
462 //Comprobamos que el tipo de la expresion es compatible con el tipo que se devuelve
\r
463 if(!e.getTipo().equals(tipo_dev)){
\r
464 System.out.println(men);
\r
466 if(tipo_dev.getType()==CLASE && (!tipo_dev.getFirstChild().equals(e.getTipo().getFirstChild()))){
\r
467 System.out.println(men);
\r
470 if(tipo_dev.getType()==FORMACION && (!tipo_dev.equals(e.getTipo()))){
\r
471 System.out.println(men);
\r
478 Atr_Expr AS_Crear(Atr_Expr as, AST clase){
\r
479 if (as == null || clase == null){
\r
480 System.out.println("ERROR CT: no se puede crear");
\r
483 //comprobar que el tipo de la variable es el mismo que el del interior de crear
\r
484 Atr_Expr result = new Atr_Expr();
\r
485 AST tipo = as.getTipo();
\r
486 if(tipo.getType() != CLASE){
\r
487 System.out.println("ERROR CT: no es una clase");
\r
490 if(!(tipo.getFirstChild().getNextSibling().getType() == INST)){
\r
491 System.out.println("ERROR CT: la clase no es instanciable");
\r
494 AST tipo_var = tipo.getFirstChild();
\r
495 AST interior = clase;
\r
496 if(!tipo_var.getText().equals(interior.getText())){
\r
497 if(interior.getType() == ACCESO_SIMPLE)
\r
498 System.out.println("ERROR CT: Los tipos no son compatibles ("+tipo_var.getText()+" y "+interior.getFirstChild().getText()+")");
\r
500 System.out.println("ERROR CT: Los tipos no son compatibles ("+tipo_var.getText()+" y "+interior.getText()+")");
\r
503 //hay que comprobar que la clase es instanciable, y que el tipo es clase
\r
505 result.setLVal(false);
\r
506 result.setRVal(false);
\r
507 //el tipo es el de la variable
\r
508 result.setTipo(tipo);
\r
514 void AS_Escribir(Atr_Expr e, AST exp){
\r
516 if(exp.getType() == ACCESO_SIMPLE)
\r
517 System.out.println("ERROR CT: no se puede escribir "+ exp.getFirstChild().getText());
\r
519 System.out.println("ERROR CT: no se puede escribir "+ exp.getText());
\r
522 //Comprobamos que la expresion se pueda consultar
\r
524 System.out.println("ERROR CT: la expresion no es consultable, no se puede escribir");
\r
530 Atr_Expr AS_Entero_A_Real(Atr_Expr e1){
\r
531 Atr_Expr result = new Atr_Expr();
\r
532 if (e1 == null) return null;
\r
533 AST tipo = e1.getTipo();
\r
534 if(tipo.getType() != ENTERO){
\r
535 System.out.println("ERROR CT: El tipo del parametro del operador enteroareal es incorrecto.");
\r
538 result.setTipo((AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(REAL,"real"))));
\r
539 result.setLVal(false);
\r
540 result.setRVal(true);
\r
543 Atr_Expr AS_Real_A_Entero(Atr_Expr e1){
\r
544 Atr_Expr result = new Atr_Expr();
\r
546 if (e1 == null) return null;
\r
547 AST tipo = e1.getTipo();
\r
548 if(tipo.getType() != REAL){
\r
549 System.out.println("ERROR CT: El tipo del parametro del operador realaentero es incorrecto.");
\r
552 result.setTipo((AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(ENTERO,"entero"))));
\r
553 result.setLVal(false);
\r
554 result.setRVal(true);
\r
560 tokenNames = _tokenNames;
563 public final void declaracion_modulo(AST _t) throws RecognitionException {
565 AST declaracion_modulo_AST_in = (_t == ASTNULL) ? null : (AST)_t;
567 ASTPair currentAST = new ASTPair();
568 AST declaracion_modulo_AST = null;
570 try { // for error handling
573 AST tmp1_AST_in = null;
574 tmp1_AST = astFactory.create((AST)_t);
575 tmp1_AST_in = (AST)_t;
576 astFactory.addASTChild(currentAST, tmp1_AST);
577 ASTPair __currentAST9810 = currentAST.copy();
578 currentAST.root = currentAST.child;
579 currentAST.child = null;
581 _t = _t.getFirstChild();
584 astFactory.addASTChild(currentAST, returnAST);
585 definicion_modulo(_t);
587 astFactory.addASTChild(currentAST, returnAST);
588 currentAST = __currentAST9810;
590 _t = _t.getNextSibling();
591 declaracion_modulo_AST = (AST)currentAST.root;
593 catch (RecognitionException ex) {
595 if (_t!=null) {_t = _t.getNextSibling();}
597 returnAST = declaracion_modulo_AST;
601 public final void nombre_modulo(AST _t) throws RecognitionException {
603 AST nombre_modulo_AST_in = (_t == ASTNULL) ? null : (AST)_t;
605 ASTPair currentAST = new ASTPair();
606 AST nombre_modulo_AST = null;
608 try { // for error handling
610 AST tmp2_AST_in = null;
611 tmp2_AST = astFactory.create((AST)_t);
612 tmp2_AST_in = (AST)_t;
613 astFactory.addASTChild(currentAST, tmp2_AST);
615 _t = _t.getNextSibling();
616 nombre_modulo_AST = (AST)currentAST.root;
618 catch (RecognitionException ex) {
620 if (_t!=null) {_t = _t.getNextSibling();}
622 returnAST = nombre_modulo_AST;
626 public final void definicion_modulo(AST _t) throws RecognitionException {
628 AST definicion_modulo_AST_in = (_t == ASTNULL) ? null : (AST)_t;
630 ASTPair currentAST = new ASTPair();
631 AST definicion_modulo_AST = null;
633 try { // for error handling
634 lista_declaraciones_clases(_t);
636 astFactory.addASTChild(currentAST, returnAST);
637 definicion_modulo_AST = (AST)currentAST.root;
639 catch (RecognitionException ex) {
641 if (_t!=null) {_t = _t.getNextSibling();}
643 returnAST = definicion_modulo_AST;
647 public final void lista_declaraciones_clases(AST _t) throws RecognitionException {
649 AST lista_declaraciones_clases_AST_in = (_t == ASTNULL) ? null : (AST)_t;
651 ASTPair currentAST = new ASTPair();
652 AST lista_declaraciones_clases_AST = null;
654 try { // for error handling
658 if (_t==null) _t=ASTNULL;
659 if ((_t.getType()==CLASE)) {
660 declaracion_clase(_t);
662 astFactory.addASTChild(currentAST, returnAST);
670 lista_declaraciones_clases_AST = (AST)currentAST.root;
672 catch (RecognitionException ex) {
674 if (_t!=null) {_t = _t.getNextSibling();}
676 returnAST = lista_declaraciones_clases_AST;
680 public final void declaracion_clase(AST _t) throws RecognitionException {
682 AST declaracion_clase_AST_in = (_t == ASTNULL) ? null : (AST)_t;
684 ASTPair currentAST = new ASTPair();
685 AST declaracion_clase_AST = null;
687 try { // for error handling
690 AST tmp3_AST_in = null;
691 tmp3_AST = astFactory.create((AST)_t);
692 tmp3_AST_in = (AST)_t;
693 astFactory.addASTChild(currentAST, tmp3_AST);
694 ASTPair __currentAST9817 = currentAST.copy();
695 currentAST.root = currentAST.child;
696 currentAST.child = null;
698 _t = _t.getFirstChild();
701 astFactory.addASTChild(currentAST, returnAST);
702 cualificador_clase(_t);
704 astFactory.addASTChild(currentAST, returnAST);
705 definicion_clase(_t);
707 astFactory.addASTChild(currentAST, returnAST);
708 currentAST = __currentAST9817;
710 _t = _t.getNextSibling();
711 declaracion_clase_AST = (AST)currentAST.root;
713 catch (RecognitionException ex) {
715 if (_t!=null) {_t = _t.getNextSibling();}
717 returnAST = declaracion_clase_AST;
721 public final void nombre_clase(AST _t) throws RecognitionException {
723 AST nombre_clase_AST_in = (_t == ASTNULL) ? null : (AST)_t;
725 ASTPair currentAST = new ASTPair();
726 AST nombre_clase_AST = null;
728 try { // for error handling
730 AST tmp4_AST_in = null;
731 tmp4_AST = astFactory.create((AST)_t);
732 tmp4_AST_in = (AST)_t;
733 astFactory.addASTChild(currentAST, tmp4_AST);
735 _t = _t.getNextSibling();
736 nombre_clase_AST = (AST)currentAST.root;
738 catch (RecognitionException ex) {
740 if (_t!=null) {_t = _t.getNextSibling();}
742 returnAST = nombre_clase_AST;
746 public final void cualificador_clase(AST _t) throws RecognitionException {
748 AST cualificador_clase_AST_in = (_t == ASTNULL) ? null : (AST)_t;
750 ASTPair currentAST = new ASTPair();
751 AST cualificador_clase_AST = null;
753 try { // for error handling
754 if (_t==null) _t=ASTNULL;
755 switch ( _t.getType()) {
759 AST tmp5_AST_in = null;
760 tmp5_AST = astFactory.create((AST)_t);
761 tmp5_AST_in = (AST)_t;
762 astFactory.addASTChild(currentAST, tmp5_AST);
764 _t = _t.getNextSibling();
765 cualificador_clase_AST = (AST)currentAST.root;
771 AST tmp6_AST_in = null;
772 tmp6_AST = astFactory.create((AST)_t);
773 tmp6_AST_in = (AST)_t;
774 astFactory.addASTChild(currentAST, tmp6_AST);
776 _t = _t.getNextSibling();
777 cualificador_clase_AST = (AST)currentAST.root;
782 throw new NoViableAltException(_t);
786 catch (RecognitionException ex) {
788 if (_t!=null) {_t = _t.getNextSibling();}
790 returnAST = cualificador_clase_AST;
794 public final void definicion_clase(AST _t) throws RecognitionException {
796 AST definicion_clase_AST_in = (_t == ASTNULL) ? null : (AST)_t;
798 ASTPair currentAST = new ASTPair();
799 AST definicion_clase_AST = null;
801 try { // for error handling
802 declaraciones_elementos_clase(_t);
804 astFactory.addASTChild(currentAST, returnAST);
805 definicion_clase_AST = (AST)currentAST.root;
807 catch (RecognitionException ex) {
809 if (_t!=null) {_t = _t.getNextSibling();}
811 returnAST = definicion_clase_AST;
815 public final void declaraciones_elementos_clase(AST _t) throws RecognitionException {
817 AST declaraciones_elementos_clase_AST_in = (_t == ASTNULL) ? null : (AST)_t;
819 ASTPair currentAST = new ASTPair();
820 AST declaraciones_elementos_clase_AST = null;
822 try { // for error handling
826 if (_t==null) _t=ASTNULL;
827 if ((_t.getType()==ATRIBUTO||_t.getType()==METODO)) {
828 declaracion_elemento_clase(_t);
830 astFactory.addASTChild(currentAST, returnAST);
838 declaraciones_elementos_clase_AST = (AST)currentAST.root;
840 catch (RecognitionException ex) {
842 if (_t!=null) {_t = _t.getNextSibling();}
844 returnAST = declaraciones_elementos_clase_AST;
848 public final void declaracion_elemento_clase(AST _t) throws RecognitionException {
850 AST declaracion_elemento_clase_AST_in = (_t == ASTNULL) ? null : (AST)_t;
852 ASTPair currentAST = new ASTPair();
853 AST declaracion_elemento_clase_AST = null;
855 try { // for error handling
856 if (_t==null) _t=ASTNULL;
857 switch ( _t.getType()) {
862 AST tmp7_AST_in = null;
863 tmp7_AST = astFactory.create((AST)_t);
864 tmp7_AST_in = (AST)_t;
865 astFactory.addASTChild(currentAST, tmp7_AST);
866 ASTPair __currentAST9825 = currentAST.copy();
867 currentAST.root = currentAST.child;
868 currentAST.child = null;
870 _t = _t.getFirstChild();
871 declaracion_metodo(_t);
873 astFactory.addASTChild(currentAST, returnAST);
874 cualificador_elemento_clase(_t);
876 astFactory.addASTChild(currentAST, returnAST);
877 currentAST = __currentAST9825;
879 _t = _t.getNextSibling();
880 declaracion_elemento_clase_AST = (AST)currentAST.root;
887 AST tmp8_AST_in = null;
888 tmp8_AST = astFactory.create((AST)_t);
889 tmp8_AST_in = (AST)_t;
890 astFactory.addASTChild(currentAST, tmp8_AST);
891 ASTPair __currentAST9826 = currentAST.copy();
892 currentAST.root = currentAST.child;
893 currentAST.child = null;
895 _t = _t.getFirstChild();
897 AST tmp9_AST_in = null;
898 tmp9_AST = astFactory.create((AST)_t);
899 tmp9_AST_in = (AST)_t;
900 astFactory.addASTChild(currentAST, tmp9_AST);
902 _t = _t.getNextSibling();
905 astFactory.addASTChild(currentAST, returnAST);
906 cualificador_elemento_clase(_t);
908 astFactory.addASTChild(currentAST, returnAST);
909 currentAST = __currentAST9826;
911 _t = _t.getNextSibling();
912 declaracion_elemento_clase_AST = (AST)currentAST.root;
917 throw new NoViableAltException(_t);
921 catch (RecognitionException ex) {
923 if (_t!=null) {_t = _t.getNextSibling();}
925 returnAST = declaracion_elemento_clase_AST;
929 public final void declaracion_metodo(AST _t) throws RecognitionException {
931 AST declaracion_metodo_AST_in = (_t == ASTNULL) ? null : (AST)_t;
933 ASTPair currentAST = new ASTPair();
934 AST declaracion_metodo_AST = null;
937 try { // for error handling
938 tipodev=prototipo_metodo(_t);
940 astFactory.addASTChild(currentAST, returnAST);
941 definicion_metodo(_t,tipodev);
943 astFactory.addASTChild(currentAST, returnAST);
945 System.out.println("ERROR: Metodo funcional que no devuelve nada");
949 declaracion_metodo_AST = (AST)currentAST.root;
951 catch (RecognitionException ex) {
953 if (_t!=null) {_t = _t.getNextSibling();}
955 returnAST = declaracion_metodo_AST;
959 public final void cualificador_elemento_clase(AST _t) throws RecognitionException {
961 AST cualificador_elemento_clase_AST_in = (_t == ASTNULL) ? null : (AST)_t;
963 ASTPair currentAST = new ASTPair();
964 AST cualificador_elemento_clase_AST = null;
966 try { // for error handling
967 if (_t==null) _t=ASTNULL;
968 switch ( _t.getType()) {
971 AST tmp10_AST = null;
972 AST tmp10_AST_in = null;
973 tmp10_AST = astFactory.create((AST)_t);
974 tmp10_AST_in = (AST)_t;
975 astFactory.addASTChild(currentAST, tmp10_AST);
977 _t = _t.getNextSibling();
978 cualificador_elemento_clase_AST = (AST)currentAST.root;
983 AST tmp11_AST = null;
984 AST tmp11_AST_in = null;
985 tmp11_AST = astFactory.create((AST)_t);
986 tmp11_AST_in = (AST)_t;
987 astFactory.addASTChild(currentAST, tmp11_AST);
989 _t = _t.getNextSibling();
990 cualificador_elemento_clase_AST = (AST)currentAST.root;
995 throw new NoViableAltException(_t);
999 catch (RecognitionException ex) {
1001 if (_t!=null) {_t = _t.getNextSibling();}
1003 returnAST = cualificador_elemento_clase_AST;
1007 public final void tipo(AST _t) throws RecognitionException {
1009 AST tipo_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1011 ASTPair currentAST = new ASTPair();
1012 AST tipo_AST = null;
1014 try { // for error handling
1015 if (_t==null) _t=ASTNULL;
1016 switch ( _t.getType()) {
1022 tipo_predefinido_simple(_t);
1024 astFactory.addASTChild(currentAST, returnAST);
1025 tipo_AST = (AST)currentAST.root;
1030 tipo_predefinido_compuesto(_t);
1032 astFactory.addASTChild(currentAST, returnAST);
1033 tipo_AST = (AST)currentAST.root;
1038 declaracion_clase1(_t);
1040 astFactory.addASTChild(currentAST, returnAST);
1041 tipo_AST = (AST)currentAST.root;
1046 declaracion_error(_t);
1048 astFactory.addASTChild(currentAST, returnAST);
1049 tipo_AST = (AST)currentAST.root;
1054 throw new NoViableAltException(_t);
1058 catch (RecognitionException ex) {
1060 if (_t!=null) {_t = _t.getNextSibling();}
1062 returnAST = tipo_AST;
1066 public final AST prototipo_metodo(AST _t) throws RecognitionException {
1069 AST prototipo_metodo_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1071 ASTPair currentAST = new ASTPair();
1072 AST prototipo_metodo_AST = null;
1078 try { // for error handling
1080 AST tmp12_AST = null;
1081 AST tmp12_AST_in = null;
1082 tmp12_AST = astFactory.create((AST)_t);
1083 tmp12_AST_in = (AST)_t;
1084 astFactory.addASTChild(currentAST, tmp12_AST);
1085 ASTPair __currentAST9830 = currentAST.copy();
1086 currentAST.root = currentAST.child;
1087 currentAST.child = null;
1088 match(_t,PROTOTIPO);
1089 _t = _t.getFirstChild();
1090 AST tmp13_AST = null;
1091 AST tmp13_AST_in = null;
1092 tmp13_AST = astFactory.create((AST)_t);
1093 tmp13_AST_in = (AST)_t;
1094 astFactory.addASTChild(currentAST, tmp13_AST);
1096 _t = _t.getNextSibling();
1098 AST tmp14_AST = null;
1099 AST tmp14_AST_in = null;
1100 tmp14_AST = astFactory.create((AST)_t);
1101 tmp14_AST_in = (AST)_t;
1102 astFactory.addASTChild(currentAST, tmp14_AST);
1103 ASTPair __currentAST9831 = currentAST.copy();
1104 currentAST.root = currentAST.child;
1105 currentAST.child = null;
1106 match(_t,PARAMETROS);
1107 _t = _t.getFirstChild();
1108 declaracion_parametros(_t);
1110 astFactory.addASTChild(currentAST, returnAST);
1111 currentAST = __currentAST9831;
1113 _t = _t.getNextSibling();
1115 AST tmp15_AST = null;
1116 AST tmp15_AST_in = null;
1117 tmp15_AST = astFactory.create((AST)_t);
1118 tmp15_AST_in = (AST)_t;
1119 astFactory.addASTChild(currentAST, tmp15_AST);
1120 ASTPair __currentAST9832 = currentAST.copy();
1121 currentAST.root = currentAST.child;
1122 currentAST.child = null;
1123 match(_t,RESULTADO);
1124 _t = _t.getFirstChild();
1126 if (_t==null) _t=ASTNULL;
1127 switch ( _t.getType()) {
1136 t = _t==ASTNULL ? null : (AST)_t;
1139 t_AST = (AST)returnAST;
1140 astFactory.addASTChild(currentAST, returnAST);
1141 cont_dev = 0; // inicializa el contador de instrucciones DEV
1148 AST v_AST_in = null;
1149 v_AST = astFactory.create(v);
1150 astFactory.addASTChild(currentAST, v_AST);
1152 _t = _t.getNextSibling();
1153 cont_dev = -1; // marca a -1 para indicar que es un procedimiento
1159 throw new NoViableAltException(_t);
1163 currentAST = __currentAST9832;
1165 _t = _t.getNextSibling();
1166 currentAST = __currentAST9830;
1168 _t = _t.getNextSibling();
1169 prototipo_metodo_AST = (AST)currentAST.root;
1171 catch (RecognitionException ex) {
1173 if (_t!=null) {_t = _t.getNextSibling();}
1175 returnAST = prototipo_metodo_AST;
1180 public final void definicion_metodo(AST _t,
1182 ) throws RecognitionException {
1184 AST definicion_metodo_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1186 ASTPair currentAST = new ASTPair();
1187 AST definicion_metodo_AST = null;
1189 try { // for error handling
1191 AST tmp16_AST = null;
1192 AST tmp16_AST_in = null;
1193 tmp16_AST = astFactory.create((AST)_t);
1194 tmp16_AST_in = (AST)_t;
1195 astFactory.addASTChild(currentAST, tmp16_AST);
1196 ASTPair __currentAST9840 = currentAST.copy();
1197 currentAST.root = currentAST.child;
1198 currentAST.child = null;
1199 match(_t,DEFINICION);
1200 _t = _t.getFirstChild();
1202 AST tmp17_AST = null;
1203 AST tmp17_AST_in = null;
1204 tmp17_AST = astFactory.create((AST)_t);
1205 tmp17_AST_in = (AST)_t;
1206 astFactory.addASTChild(currentAST, tmp17_AST);
1207 ASTPair __currentAST9841 = currentAST.copy();
1208 currentAST.root = currentAST.child;
1209 currentAST.child = null;
1210 match(_t,VARIABLES_LOCALES);
1211 _t = _t.getFirstChild();
1212 declaracion_variables_locales(_t);
1214 astFactory.addASTChild(currentAST, returnAST);
1215 currentAST = __currentAST9841;
1217 _t = _t.getNextSibling();
1219 AST tmp18_AST = null;
1220 AST tmp18_AST_in = null;
1221 tmp18_AST = astFactory.create((AST)_t);
1222 tmp18_AST_in = (AST)_t;
1223 astFactory.addASTChild(currentAST, tmp18_AST);
1224 ASTPair __currentAST9842 = currentAST.copy();
1225 currentAST.root = currentAST.child;
1226 currentAST.child = null;
1227 match(_t,INSTRUCCIONES);
1228 _t = _t.getFirstChild();
1229 instrucciones(_t,tipodev);
1231 astFactory.addASTChild(currentAST, returnAST);
1232 currentAST = __currentAST9842;
1234 _t = _t.getNextSibling();
1235 currentAST = __currentAST9840;
1237 _t = _t.getNextSibling();
1238 definicion_metodo_AST = (AST)currentAST.root;
1240 catch (RecognitionException ex) {
1242 if (_t!=null) {_t = _t.getNextSibling();}
1244 returnAST = definicion_metodo_AST;
1248 public final void declaracion_parametros(AST _t) throws RecognitionException {
1250 AST declaracion_parametros_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1252 ASTPair currentAST = new ASTPair();
1253 AST declaracion_parametros_AST = null;
1255 try { // for error handling
1259 if (_t==null) _t=ASTNULL;
1260 if ((_t.getType()==PARAMETRO)) {
1261 declaracion_parametro(_t);
1263 astFactory.addASTChild(currentAST, returnAST);
1271 declaracion_parametros_AST = (AST)currentAST.root;
1273 catch (RecognitionException ex) {
1275 if (_t!=null) {_t = _t.getNextSibling();}
1277 returnAST = declaracion_parametros_AST;
1281 public final void declaracion_parametro(AST _t) throws RecognitionException {
1283 AST declaracion_parametro_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1285 ASTPair currentAST = new ASTPair();
1286 AST declaracion_parametro_AST = null;
1288 try { // for error handling
1290 AST tmp19_AST = null;
1291 AST tmp19_AST_in = null;
1292 tmp19_AST = astFactory.create((AST)_t);
1293 tmp19_AST_in = (AST)_t;
1294 astFactory.addASTChild(currentAST, tmp19_AST);
1295 ASTPair __currentAST9838 = currentAST.copy();
1296 currentAST.root = currentAST.child;
1297 currentAST.child = null;
1298 match(_t,PARAMETRO);
1299 _t = _t.getFirstChild();
1300 AST tmp20_AST = null;
1301 AST tmp20_AST_in = null;
1302 tmp20_AST = astFactory.create((AST)_t);
1303 tmp20_AST_in = (AST)_t;
1304 astFactory.addASTChild(currentAST, tmp20_AST);
1306 _t = _t.getNextSibling();
1309 astFactory.addASTChild(currentAST, returnAST);
1310 currentAST = __currentAST9838;
1312 _t = _t.getNextSibling();
1313 declaracion_parametro_AST = (AST)currentAST.root;
1315 catch (RecognitionException ex) {
1317 if (_t!=null) {_t = _t.getNextSibling();}
1319 returnAST = declaracion_parametro_AST;
1323 public final void declaracion_variables_locales(AST _t) throws RecognitionException {
1325 AST declaracion_variables_locales_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1327 ASTPair currentAST = new ASTPair();
1328 AST declaracion_variables_locales_AST = null;
1330 try { // for error handling
1334 if (_t==null) _t=ASTNULL;
1335 if ((_t.getType()==VARIABLE_LOCAL)) {
1336 declaracion_variable_local(_t);
1338 astFactory.addASTChild(currentAST, returnAST);
1346 declaracion_variables_locales_AST = (AST)currentAST.root;
1348 catch (RecognitionException ex) {
1350 if (_t!=null) {_t = _t.getNextSibling();}
1352 returnAST = declaracion_variables_locales_AST;
1356 public final void instrucciones(AST _t,
1358 ) throws RecognitionException {
1360 AST instrucciones_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1362 ASTPair currentAST = new ASTPair();
1363 AST instrucciones_AST = null;
1365 try { // for error handling
1369 if (_t==null) _t=ASTNULL;
1370 if ((_t.getType()==INSTRUCCION)) {
1371 instruccion(_t,tipodev);
1373 astFactory.addASTChild(currentAST, returnAST);
1381 instrucciones_AST = (AST)currentAST.root;
1383 catch (RecognitionException ex) {
1385 if (_t!=null) {_t = _t.getNextSibling();}
1387 returnAST = instrucciones_AST;
1391 public final void declaracion_variable_local(AST _t) throws RecognitionException {
1393 AST declaracion_variable_local_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1395 ASTPair currentAST = new ASTPair();
1396 AST declaracion_variable_local_AST = null;
1398 try { // for error handling
1400 AST tmp21_AST = null;
1401 AST tmp21_AST_in = null;
1402 tmp21_AST = astFactory.create((AST)_t);
1403 tmp21_AST_in = (AST)_t;
1404 astFactory.addASTChild(currentAST, tmp21_AST);
1405 ASTPair __currentAST9847 = currentAST.copy();
1406 currentAST.root = currentAST.child;
1407 currentAST.child = null;
1408 match(_t,VARIABLE_LOCAL);
1409 _t = _t.getFirstChild();
1410 AST tmp22_AST = null;
1411 AST tmp22_AST_in = null;
1412 tmp22_AST = astFactory.create((AST)_t);
1413 tmp22_AST_in = (AST)_t;
1414 astFactory.addASTChild(currentAST, tmp22_AST);
1416 _t = _t.getNextSibling();
1419 astFactory.addASTChild(currentAST, returnAST);
1420 currentAST = __currentAST9847;
1422 _t = _t.getNextSibling();
1423 declaracion_variable_local_AST = (AST)currentAST.root;
1425 catch (RecognitionException ex) {
1427 if (_t!=null) {_t = _t.getNextSibling();}
1429 returnAST = declaracion_variable_local_AST;
1433 public final void declaracion_error(AST _t) throws RecognitionException {
1435 AST declaracion_error_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1437 ASTPair currentAST = new ASTPair();
1438 AST declaracion_error_AST = null;
1440 try { // for error handling
1441 AST tmp23_AST = null;
1442 AST tmp23_AST_in = null;
1443 tmp23_AST = astFactory.create((AST)_t);
1444 tmp23_AST_in = (AST)_t;
1445 astFactory.addASTChild(currentAST, tmp23_AST);
1447 _t = _t.getNextSibling();
1448 declaracion_error_AST = (AST)currentAST.root;
1450 catch (RecognitionException ex) {
1452 if (_t!=null) {_t = _t.getNextSibling();}
1454 returnAST = declaracion_error_AST;
1458 public final void instruccion(AST _t,
1460 ) throws RecognitionException {
1462 AST instruccion_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1464 ASTPair currentAST = new ASTPair();
1465 AST instruccion_AST = null;
1467 try { // for error handling
1469 AST tmp24_AST = null;
1470 AST tmp24_AST_in = null;
1471 tmp24_AST = astFactory.create((AST)_t);
1472 tmp24_AST_in = (AST)_t;
1473 astFactory.addASTChild(currentAST, tmp24_AST);
1474 ASTPair __currentAST9853 = currentAST.copy();
1475 currentAST.root = currentAST.child;
1476 currentAST.child = null;
1477 match(_t,INSTRUCCION);
1478 _t = _t.getFirstChild();
1480 if (_t==null) _t=ASTNULL;
1481 switch ( _t.getType()) {
1488 instruccion_simple(_t,tipodev);
1490 astFactory.addASTChild(currentAST, returnAST);
1496 instruccion_compuesta(_t,tipodev);
1498 astFactory.addASTChild(currentAST, returnAST);
1503 throw new NoViableAltException(_t);
1507 currentAST = __currentAST9853;
1509 _t = _t.getNextSibling();
1510 instruccion_AST = (AST)currentAST.root;
1512 catch (RecognitionException ex) {
1514 if (_t!=null) {_t = _t.getNextSibling();}
1516 returnAST = instruccion_AST;
1520 public final void instruccion_simple(AST _t,
1522 ) throws RecognitionException {
1524 AST instruccion_simple_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1526 ASTPair currentAST = new ASTPair();
1527 AST instruccion_simple_AST = null;
1529 try { // for error handling
1530 if (_t==null) _t=ASTNULL;
1531 switch ( _t.getType()) {
1536 astFactory.addASTChild(currentAST, returnAST);
1537 instruccion_simple_AST = (AST)currentAST.root;
1544 astFactory.addASTChild(currentAST, returnAST);
1545 instruccion_simple_AST = (AST)currentAST.root;
1552 astFactory.addASTChild(currentAST, returnAST);
1553 instruccion_simple_AST = (AST)currentAST.root;
1560 astFactory.addASTChild(currentAST, returnAST);
1561 instruccion_simple_AST = (AST)currentAST.root;
1566 retorno(_t,tipodev);
1568 astFactory.addASTChild(currentAST, returnAST);
1569 instruccion_simple_AST = (AST)currentAST.root;
1574 throw new NoViableAltException(_t);
1578 catch (RecognitionException ex) {
1580 if (_t!=null) {_t = _t.getNextSibling();}
1582 returnAST = instruccion_simple_AST;
1586 public final void instruccion_compuesta(AST _t,
1588 ) throws RecognitionException {
1590 AST instruccion_compuesta_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1592 ASTPair currentAST = new ASTPair();
1593 AST instruccion_compuesta_AST = null;
1595 try { // for error handling
1596 if (_t==null) _t=ASTNULL;
1597 switch ( _t.getType()) {
1600 condicion(_t,tipodev);
1602 astFactory.addASTChild(currentAST, returnAST);
1603 instruccion_compuesta_AST = (AST)currentAST.root;
1608 iteracion(_t,tipodev);
1610 astFactory.addASTChild(currentAST, returnAST);
1611 instruccion_compuesta_AST = (AST)currentAST.root;
1616 throw new NoViableAltException(_t);
1620 catch (RecognitionException ex) {
1622 if (_t!=null) {_t = _t.getNextSibling();}
1624 returnAST = instruccion_compuesta_AST;
1628 public final void crear(AST _t) throws RecognitionException {
1630 AST crear_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1632 ASTPair currentAST = new ASTPair();
1633 AST crear_AST = null;
1638 try { // for error handling
1640 AST tmp25_AST = null;
1641 AST tmp25_AST_in = null;
1642 tmp25_AST = astFactory.create((AST)_t);
1643 tmp25_AST_in = (AST)_t;
1644 astFactory.addASTChild(currentAST, tmp25_AST);
1645 ASTPair __currentAST9857 = currentAST.copy();
1646 currentAST.root = currentAST.child;
1647 currentAST.child = null;
1649 _t = _t.getFirstChild();
1652 astFactory.addASTChild(currentAST, returnAST);
1653 e2 = _t==ASTNULL ? null : (AST)_t;
1656 e2_AST = (AST)returnAST;
1657 astFactory.addASTChild(currentAST, returnAST);
1658 currentAST = __currentAST9857;
1660 _t = _t.getNextSibling();
1661 AS_Crear(e1,e2_AST);
1662 crear_AST = (AST)currentAST.root;
1664 catch (RecognitionException ex) {
1666 if (_t!=null) {_t = _t.getNextSibling();}
1668 returnAST = crear_AST;
1672 public final void llamada_metodo(AST _t) throws RecognitionException {
1674 AST llamada_metodo_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1676 ASTPair currentAST = new ASTPair();
1677 AST llamada_metodo_AST = null;
1678 Atr_Expr a, res; LinkedList l;
1680 try { // for error handling
1682 AST tmp26_AST = null;
1683 AST tmp26_AST_in = null;
1684 tmp26_AST = astFactory.create((AST)_t);
1685 tmp26_AST_in = (AST)_t;
1686 astFactory.addASTChild(currentAST, tmp26_AST);
1687 ASTPair __currentAST9866 = currentAST.copy();
1688 currentAST.root = currentAST.child;
1689 currentAST.child = null;
1691 _t = _t.getFirstChild();
1694 astFactory.addASTChild(currentAST, returnAST);
1696 AST tmp27_AST = null;
1697 AST tmp27_AST_in = null;
1698 tmp27_AST = astFactory.create((AST)_t);
1699 tmp27_AST_in = (AST)_t;
1700 astFactory.addASTChild(currentAST, tmp27_AST);
1701 ASTPair __currentAST9867 = currentAST.copy();
1702 currentAST.root = currentAST.child;
1703 currentAST.child = null;
1704 match(_t,EXPRESIONES);
1705 _t = _t.getFirstChild();
1706 l=lista_expresiones(_t);
1708 astFactory.addASTChild(currentAST, returnAST);
1709 currentAST = __currentAST9867;
1711 _t = _t.getNextSibling();
1712 currentAST = __currentAST9866;
1714 _t = _t.getNextSibling();
1715 res=AS_Llamada(a,l);
1716 if (res != null && res.getTipo().getType() != VACIO){
1717 System.out.println("ERROR: Llamada a funcion sin asignar valor devuelto.");
1721 llamada_metodo_AST = (AST)currentAST.root;
1723 catch (RecognitionException ex) {
1725 if (_t!=null) {_t = _t.getNextSibling();}
1727 returnAST = llamada_metodo_AST;
1731 public final void escribir(AST _t) throws RecognitionException {
1733 AST escribir_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1735 ASTPair currentAST = new ASTPair();
1736 AST escribir_AST = null;
1741 try { // for error handling
1743 AST tmp28_AST = null;
1744 AST tmp28_AST_in = null;
1745 tmp28_AST = astFactory.create((AST)_t);
1746 tmp28_AST_in = (AST)_t;
1747 astFactory.addASTChild(currentAST, tmp28_AST);
1748 ASTPair __currentAST9859 = currentAST.copy();
1749 currentAST.root = currentAST.child;
1750 currentAST.child = null;
1752 _t = _t.getFirstChild();
1753 e = _t==ASTNULL ? null : (AST)_t;
1756 e_AST = (AST)returnAST;
1757 astFactory.addASTChild(currentAST, returnAST);
1758 currentAST = __currentAST9859;
1760 _t = _t.getNextSibling();
1761 AS_Escribir(e1, e_AST);
1762 escribir_AST = (AST)currentAST.root;
1764 catch (RecognitionException ex) {
1766 if (_t!=null) {_t = _t.getNextSibling();}
1768 returnAST = escribir_AST;
1772 public final void asignacion(AST _t) throws RecognitionException {
1774 AST asignacion_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1776 ASTPair currentAST = new ASTPair();
1777 AST asignacion_AST = null;
1784 try { // for error handling
1786 AST tmp29_AST = null;
1787 AST tmp29_AST_in = null;
1788 tmp29_AST = astFactory.create((AST)_t);
1789 tmp29_AST_in = (AST)_t;
1790 astFactory.addASTChild(currentAST, tmp29_AST);
1791 ASTPair __currentAST9862 = currentAST.copy();
1792 currentAST.root = currentAST.child;
1793 currentAST.child = null;
1794 match(_t,ASIGNACION);
1795 _t = _t.getFirstChild();
1796 e3 = _t==ASTNULL ? null : (AST)_t;
1799 e3_AST = (AST)returnAST;
1800 astFactory.addASTChild(currentAST, returnAST);
1801 e4 = _t==ASTNULL ? null : (AST)_t;
1804 e4_AST = (AST)returnAST;
1805 astFactory.addASTChild(currentAST, returnAST);
1806 currentAST = __currentAST9862;
1808 _t = _t.getNextSibling();
1809 AS_Asignacion(e1,e2,e3_AST,e4_AST);
1811 asignacion_AST = (AST)currentAST.root;
1813 catch (RecognitionException ex) {
1815 if (_t!=null) {_t = _t.getNextSibling();}
1817 returnAST = asignacion_AST;
1821 public final void retorno(AST _t,
1823 ) throws RecognitionException {
1825 AST retorno_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1827 ASTPair currentAST = new ASTPair();
1828 AST retorno_AST = null;
1831 try { // for error handling
1833 AST tmp30_AST = null;
1834 AST tmp30_AST_in = null;
1835 tmp30_AST = astFactory.create((AST)_t);
1836 tmp30_AST_in = (AST)_t;
1837 astFactory.addASTChild(currentAST, tmp30_AST);
1838 ASTPair __currentAST9864 = currentAST.copy();
1839 currentAST.root = currentAST.child;
1840 currentAST.child = null;
1842 _t = _t.getFirstChild();
1845 astFactory.addASTChild(currentAST, returnAST);
1846 currentAST = __currentAST9864;
1848 _t = _t.getNextSibling();
1849 /*AS_Devolucion(tipodev, e);
1851 cont_dev=AS_Devolucion(tipodev,e,cont_dev);
1853 retorno_AST = (AST)currentAST.root;
1855 catch (RecognitionException ex) {
1857 if (_t!=null) {_t = _t.getNextSibling();}
1859 returnAST = retorno_AST;
1863 public final Atr_Expr expresion(AST _t) throws RecognitionException {
1866 AST expresion_AST_in = (_t == ASTNULL) ? null : (AST)_t;
1868 ASTPair currentAST = new ASTPair();
1869 AST expresion_AST = null;
1892 Atr_Expr e1,e2; LinkedList l;
1894 try { // for error handling
1895 if (_t==null) _t=ASTNULL;
1896 switch ( _t.getType()) {
1900 AST tmp31_AST = null;
1901 AST tmp31_AST_in = null;
1902 tmp31_AST = astFactory.create((AST)_t);
1903 tmp31_AST_in = (AST)_t;
1904 astFactory.addASTChild(currentAST, tmp31_AST);
1905 ASTPair __currentAST9880 = currentAST.copy();
1906 currentAST.root = currentAST.child;
1907 currentAST.child = null;
1909 _t = _t.getFirstChild();
1912 astFactory.addASTChild(currentAST, returnAST);
1915 astFactory.addASTChild(currentAST, returnAST);
1916 currentAST = __currentAST9880;
1918 _t = _t.getNextSibling();
1919 res=AS_Exp_Bin_Log( e1, e2);
1921 expresion_AST = (AST)currentAST.root;
1927 AST tmp32_AST = null;
1928 AST tmp32_AST_in = null;
1929 tmp32_AST = astFactory.create((AST)_t);
1930 tmp32_AST_in = (AST)_t;
1931 astFactory.addASTChild(currentAST, tmp32_AST);
1932 ASTPair __currentAST9881 = currentAST.copy();
1933 currentAST.root = currentAST.child;
1934 currentAST.child = null;
1936 _t = _t.getFirstChild();
1939 astFactory.addASTChild(currentAST, returnAST);
1942 astFactory.addASTChild(currentAST, returnAST);
1943 currentAST = __currentAST9881;
1945 _t = _t.getNextSibling();
1946 res=AS_Exp_Bin_Log( e1, e2);
1948 expresion_AST = (AST)currentAST.root;
1954 AST tmp33_AST = null;
1955 AST tmp33_AST_in = null;
1956 tmp33_AST = astFactory.create((AST)_t);
1957 tmp33_AST_in = (AST)_t;
1958 astFactory.addASTChild(currentAST, tmp33_AST);
1959 ASTPair __currentAST9882 = currentAST.copy();
1960 currentAST.root = currentAST.child;
1961 currentAST.child = null;
1963 _t = _t.getFirstChild();
1966 astFactory.addASTChild(currentAST, returnAST);
1967 currentAST = __currentAST9882;
1969 _t = _t.getNextSibling();
1970 res=AS_Exp_Una_Log( e1);
1972 expresion_AST = (AST)currentAST.root;
1978 op1 = _t==ASTNULL ? null :(AST)_t;
1979 AST op1_AST_in = null;
1980 op1_AST = astFactory.create(op1);
1981 astFactory.addASTChild(currentAST, op1_AST);
1982 ASTPair __currentAST9883 = currentAST.copy();
1983 currentAST.root = currentAST.child;
1984 currentAST.child = null;
1986 _t = _t.getFirstChild();
1989 astFactory.addASTChild(currentAST, returnAST);
1992 astFactory.addASTChild(currentAST, returnAST);
1993 currentAST = __currentAST9883;
1995 _t = _t.getNextSibling();
1996 res=AS_Exp_Bin_Rel( e1, e2, op1);
1998 expresion_AST = (AST)currentAST.root;
2004 op2 = _t==ASTNULL ? null :(AST)_t;
2005 AST op2_AST_in = null;
2006 op2_AST = astFactory.create(op2);
2007 astFactory.addASTChild(currentAST, op2_AST);
2008 ASTPair __currentAST9884 = currentAST.copy();
2009 currentAST.root = currentAST.child;
2010 currentAST.child = null;
2011 match(_t,MAYOR_IGUAL);
2012 _t = _t.getFirstChild();
2015 astFactory.addASTChild(currentAST, returnAST);
2018 astFactory.addASTChild(currentAST, returnAST);
2019 currentAST = __currentAST9884;
2021 _t = _t.getNextSibling();
2022 res=AS_Exp_Bin_Rel( e1, e2, op2);
2024 expresion_AST = (AST)currentAST.root;
2030 op3 = _t==ASTNULL ? null :(AST)_t;
2031 AST op3_AST_in = null;
2032 op3_AST = astFactory.create(op3);
2033 astFactory.addASTChild(currentAST, op3_AST);
2034 ASTPair __currentAST9885 = currentAST.copy();
2035 currentAST.root = currentAST.child;
2036 currentAST.child = null;
2038 _t = _t.getFirstChild();
2041 astFactory.addASTChild(currentAST, returnAST);
2044 astFactory.addASTChild(currentAST, returnAST);
2045 currentAST = __currentAST9885;
2047 _t = _t.getNextSibling();
2048 res=AS_Exp_Bin_Rel( e1, e2, op3);
2050 expresion_AST = (AST)currentAST.root;
2056 op4 = _t==ASTNULL ? null :(AST)_t;
2057 AST op4_AST_in = null;
2058 op4_AST = astFactory.create(op4);
2059 astFactory.addASTChild(currentAST, op4_AST);
2060 ASTPair __currentAST9886 = currentAST.copy();
2061 currentAST.root = currentAST.child;
2062 currentAST.child = null;
2063 match(_t,MENOR_IGUAL);
2064 _t = _t.getFirstChild();
2067 astFactory.addASTChild(currentAST, returnAST);
2070 astFactory.addASTChild(currentAST, returnAST);
2071 currentAST = __currentAST9886;
2073 _t = _t.getNextSibling();
2074 res=AS_Exp_Bin_Rel( e1, e2, op4);
2076 expresion_AST = (AST)currentAST.root;
2082 op5 = _t==ASTNULL ? null :(AST)_t;
2083 AST op5_AST_in = null;
2084 op5_AST = astFactory.create(op5);
2085 astFactory.addASTChild(currentAST, op5_AST);
2086 ASTPair __currentAST9887 = currentAST.copy();
2087 currentAST.root = currentAST.child;
2088 currentAST.child = null;
2090 _t = _t.getFirstChild();
2093 astFactory.addASTChild(currentAST, returnAST);
2096 astFactory.addASTChild(currentAST, returnAST);
2097 currentAST = __currentAST9887;
2099 _t = _t.getNextSibling();
2100 res=AS_Exp_Bin_Rel( e1, e2, op5);
2102 expresion_AST = (AST)currentAST.root;
2108 op6 = _t==ASTNULL ? null :(AST)_t;
2109 AST op6_AST_in = null;
2110 op6_AST = astFactory.create(op6);
2111 astFactory.addASTChild(currentAST, op6_AST);
2112 ASTPair __currentAST9888 = currentAST.copy();
2113 currentAST.root = currentAST.child;
2114 currentAST.child = null;
2116 _t = _t.getFirstChild();
2119 astFactory.addASTChild(currentAST, returnAST);
2122 astFactory.addASTChild(currentAST, returnAST);
2123 currentAST = __currentAST9888;
2125 _t = _t.getNextSibling();
2126 res=AS_Exp_Bin_Rel( e1, e2, op6);
2128 expresion_AST = (AST)currentAST.root;
2134 AST tmp34_AST = null;
2135 AST tmp34_AST_in = null;
2136 tmp34_AST = astFactory.create((AST)_t);
2137 tmp34_AST_in = (AST)_t;
2138 astFactory.addASTChild(currentAST, tmp34_AST);
2139 ASTPair __currentAST9889 = currentAST.copy();
2140 currentAST.root = currentAST.child;
2141 currentAST.child = null;
2143 _t = _t.getFirstChild();
2146 astFactory.addASTChild(currentAST, returnAST);
2149 astFactory.addASTChild(currentAST, returnAST);
2150 currentAST = __currentAST9889;
2152 _t = _t.getNextSibling();
2153 res=AS_Exp_Bin_Arit( e1, e2);
2155 expresion_AST = (AST)currentAST.root;
2161 AST tmp35_AST = null;
2162 AST tmp35_AST_in = null;
2163 tmp35_AST = astFactory.create((AST)_t);
2164 tmp35_AST_in = (AST)_t;
2165 astFactory.addASTChild(currentAST, tmp35_AST);
2166 ASTPair __currentAST9890 = currentAST.copy();
2167 currentAST.root = currentAST.child;
2168 currentAST.child = null;
2170 _t = _t.getFirstChild();
2173 astFactory.addASTChild(currentAST, returnAST);
2176 astFactory.addASTChild(currentAST, returnAST);
2177 currentAST = __currentAST9890;
2179 _t = _t.getNextSibling();
2180 res=AS_Exp_Bin_Arit( e1, e2);
2182 expresion_AST = (AST)currentAST.root;
2188 AST tmp36_AST = null;
2189 AST tmp36_AST_in = null;
2190 tmp36_AST = astFactory.create((AST)_t);
2191 tmp36_AST_in = (AST)_t;
2192 astFactory.addASTChild(currentAST, tmp36_AST);
2193 ASTPair __currentAST9891 = currentAST.copy();
2194 currentAST.root = currentAST.child;
2195 currentAST.child = null;
2196 match(_t,MENOSUNARIO);
2197 _t = _t.getFirstChild();
2200 astFactory.addASTChild(currentAST, returnAST);
2201 currentAST = __currentAST9891;
2203 _t = _t.getNextSibling();
2204 res=AS_Exp_Una_Arit( e1);
2206 expresion_AST = (AST)currentAST.root;
2212 AST tmp37_AST = null;
2213 AST tmp37_AST_in = null;
2214 tmp37_AST = astFactory.create((AST)_t);
2215 tmp37_AST_in = (AST)_t;
2216 astFactory.addASTChild(currentAST, tmp37_AST);
2217 ASTPair __currentAST9892 = currentAST.copy();
2218 currentAST.root = currentAST.child;
2219 currentAST.child = null;
2221 _t = _t.getFirstChild();
2224 astFactory.addASTChild(currentAST, returnAST);
2227 astFactory.addASTChild(currentAST, returnAST);
2228 currentAST = __currentAST9892;
2230 _t = _t.getNextSibling();
2231 res=AS_Exp_Bin_Arit( e1, e2);
2233 expresion_AST = (AST)currentAST.root;
2239 AST tmp38_AST = null;
2240 AST tmp38_AST_in = null;
2241 tmp38_AST = astFactory.create((AST)_t);
2242 tmp38_AST_in = (AST)_t;
2243 astFactory.addASTChild(currentAST, tmp38_AST);
2244 ASTPair __currentAST9893 = currentAST.copy();
2245 currentAST.root = currentAST.child;
2246 currentAST.child = null;
2248 _t = _t.getFirstChild();
2251 astFactory.addASTChild(currentAST, returnAST);
2254 astFactory.addASTChild(currentAST, returnAST);
2255 currentAST = __currentAST9893;
2257 _t = _t.getNextSibling();
2258 res=AS_Exp_Bin_Arit( e1, e2);
2260 expresion_AST = (AST)currentAST.root;
2266 AST tmp39_AST = null;
2267 AST tmp39_AST_in = null;
2268 tmp39_AST = astFactory.create((AST)_t);
2269 tmp39_AST_in = (AST)_t;
2270 astFactory.addASTChild(currentAST, tmp39_AST);
2271 ASTPair __currentAST9894 = currentAST.copy();
2272 currentAST.root = currentAST.child;
2273 currentAST.child = null;
2275 _t = _t.getFirstChild();
2278 astFactory.addASTChild(currentAST, returnAST);
2280 AST tmp40_AST = null;
2281 AST tmp40_AST_in = null;
2282 tmp40_AST = astFactory.create((AST)_t);
2283 tmp40_AST_in = (AST)_t;
2284 astFactory.addASTChild(currentAST, tmp40_AST);
2285 ASTPair __currentAST9895 = currentAST.copy();
2286 currentAST.root = currentAST.child;
2287 currentAST.child = null;
2288 match(_t,EXPRESIONES);
2289 _t = _t.getFirstChild();
2290 l=lista_expresiones(_t);
2292 astFactory.addASTChild(currentAST, returnAST);
2293 currentAST = __currentAST9895;
2295 _t = _t.getNextSibling();
2296 currentAST = __currentAST9894;
2298 _t = _t.getNextSibling();
2299 res=AS_Llamada( e1, l);
2301 if (res.getTipo().getType() == VACIO){
2302 System.out.println("ERROR: No se puede recoger el valor devuelto por un procedimiento (no devuelve nada).");
2307 expresion_AST = (AST)currentAST.root;
2313 AST tmp41_AST = null;
2314 AST tmp41_AST_in = null;
2315 tmp41_AST = astFactory.create((AST)_t);
2316 tmp41_AST_in = (AST)_t;
2317 astFactory.addASTChild(currentAST, tmp41_AST);
2318 ASTPair __currentAST9896 = currentAST.copy();
2319 currentAST.root = currentAST.child;
2320 currentAST.child = null;
2321 match(_t,ACCESO_TABLA);
2322 _t = _t.getFirstChild();
2325 astFactory.addASTChild(currentAST, returnAST);
2327 AST tmp42_AST = null;
2328 AST tmp42_AST_in = null;
2329 tmp42_AST = astFactory.create((AST)_t);
2330 tmp42_AST_in = (AST)_t;
2331 astFactory.addASTChild(currentAST, tmp42_AST);
2332 ASTPair __currentAST9897 = currentAST.copy();
2333 currentAST.root = currentAST.child;
2334 currentAST.child = null;
2335 match(_t,EXPRESIONES);
2336 _t = _t.getFirstChild();
2337 l=lista_expresiones_nv(_t);
2339 astFactory.addASTChild(currentAST, returnAST);
2340 currentAST = __currentAST9897;
2342 _t = _t.getNextSibling();
2343 currentAST = __currentAST9896;
2345 _t = _t.getNextSibling();
2346 res=AS_Acceso_Tabla( e1, l);
2348 expresion_AST = (AST)currentAST.root;
2356 astFactory.addASTChild(currentAST, returnAST);
2358 expresion_AST = (AST)currentAST.root;
2364 AST i_AST_in = null;
2365 i_AST = astFactory.create(i);
2366 astFactory.addASTChild(currentAST, i_AST);
2367 match(_t,LIT_ENTERO);
2368 _t = _t.getNextSibling();
2370 expresion_AST = (AST)currentAST.root;
2376 AST j_AST_in = null;
2377 j_AST = astFactory.create(j);
2378 astFactory.addASTChild(currentAST, j_AST);
2380 _t = _t.getNextSibling();
2382 expresion_AST = (AST)currentAST.root;
2388 AST k_AST_in = null;
2389 k_AST = astFactory.create(k);
2390 astFactory.addASTChild(currentAST, k_AST);
2392 _t = _t.getNextSibling();
2394 expresion_AST = (AST)currentAST.root;
2400 AST m_AST_in = null;
2401 m_AST = astFactory.create(m);
2402 astFactory.addASTChild(currentAST, m_AST);
2404 _t = _t.getNextSibling();
2406 expresion_AST = (AST)currentAST.root;
2412 AST n_AST_in = null;
2413 n_AST = astFactory.create(n);
2414 astFactory.addASTChild(currentAST, n_AST);
2416 _t = _t.getNextSibling();
2418 expresion_AST = (AST)currentAST.root;
2424 AST tmp43_AST = null;
2425 AST tmp43_AST_in = null;
2426 tmp43_AST = astFactory.create((AST)_t);
2427 tmp43_AST_in = (AST)_t;
2428 astFactory.addASTChild(currentAST, tmp43_AST);
2429 ASTPair __currentAST9898 = currentAST.copy();
2430 currentAST.root = currentAST.child;
2431 currentAST.child = null;
2432 match(_t,ENTERO_A_REAL);
2433 _t = _t.getFirstChild();
2436 astFactory.addASTChild(currentAST, returnAST);
2437 currentAST = __currentAST9898;
2439 _t = _t.getNextSibling();
2440 res = AS_Entero_A_Real(e1);
2441 expresion_AST = (AST)currentAST.root;
2447 AST tmp44_AST = null;
2448 AST tmp44_AST_in = null;
2449 tmp44_AST = astFactory.create((AST)_t);
2450 tmp44_AST_in = (AST)_t;
2451 astFactory.addASTChild(currentAST, tmp44_AST);
2452 ASTPair __currentAST9899 = currentAST.copy();
2453 currentAST.root = currentAST.child;
2454 currentAST.child = null;
2455 match(_t,REAL_A_ENTERO);
2456 _t = _t.getFirstChild();
2459 astFactory.addASTChild(currentAST, returnAST);
2460 currentAST = __currentAST9899;
2462 _t = _t.getNextSibling();
2463 res = AS_Real_A_Entero(e1);
2464 expresion_AST = (AST)currentAST.root;
2469 AST tmp45_AST = null;
2470 AST tmp45_AST_in = null;
2471 tmp45_AST = astFactory.create((AST)_t);
2472 tmp45_AST_in = (AST)_t;
2473 astFactory.addASTChild(currentAST, tmp45_AST);
2475 _t = _t.getNextSibling();
2476 expresion_AST = (AST)currentAST.root;
2481 throw new NoViableAltException(_t);
2485 catch (RecognitionException ex) {
2487 if (_t!=null) {_t = _t.getNextSibling();}
2489 returnAST = expresion_AST;
2494 public final void condicion(AST _t,
2496 ) throws RecognitionException {
2498 AST condicion_AST_in = (_t == ASTNULL) ? null : (AST)_t;
2500 ASTPair currentAST = new ASTPair();
2501 AST condicion_AST = null;
2504 try { // for error handling
2506 AST tmp46_AST = null;
2507 AST tmp46_AST_in = null;
2508 tmp46_AST = astFactory.create((AST)_t);
2509 tmp46_AST_in = (AST)_t;
2510 astFactory.addASTChild(currentAST, tmp46_AST);
2511 ASTPair __currentAST9872 = currentAST.copy();
2512 currentAST.root = currentAST.child;
2513 currentAST.child = null;
2515 _t = _t.getFirstChild();
2518 astFactory.addASTChild(currentAST, returnAST);
2520 AST tmp47_AST = null;
2521 AST tmp47_AST_in = null;
2522 tmp47_AST = astFactory.create((AST)_t);
2523 tmp47_AST_in = (AST)_t;
2524 astFactory.addASTChild(currentAST, tmp47_AST);
2525 ASTPair __currentAST9873 = currentAST.copy();
2526 currentAST.root = currentAST.child;
2527 currentAST.child = null;
2528 match(_t,INSTRUCCIONES);
2529 _t = _t.getFirstChild();
2530 instrucciones(_t,tipodev);
2532 astFactory.addASTChild(currentAST, returnAST);
2533 currentAST = __currentAST9873;
2535 _t = _t.getNextSibling();
2537 if (_t==null) _t=ASTNULL;
2538 switch ( _t.getType()) {
2542 AST tmp48_AST = null;
2543 AST tmp48_AST_in = null;
2544 tmp48_AST = astFactory.create((AST)_t);
2545 tmp48_AST_in = (AST)_t;
2546 astFactory.addASTChild(currentAST, tmp48_AST);
2547 ASTPair __currentAST9875 = currentAST.copy();
2548 currentAST.root = currentAST.child;
2549 currentAST.child = null;
2550 match(_t,INSTRUCCIONES);
2551 _t = _t.getFirstChild();
2552 instrucciones(_t,tipodev);
2554 astFactory.addASTChild(currentAST, returnAST);
2555 currentAST = __currentAST9875;
2557 _t = _t.getNextSibling();
2566 throw new NoViableAltException(_t);
2570 currentAST = __currentAST9872;
2572 _t = _t.getNextSibling();
2575 condicion_AST = (AST)currentAST.root;
2577 catch (RecognitionException ex) {
2579 if (_t!=null) {_t = _t.getNextSibling();}
2581 returnAST = condicion_AST;
2585 public final void iteracion(AST _t,
2587 ) throws RecognitionException {
2589 AST iteracion_AST_in = (_t == ASTNULL) ? null : (AST)_t;
2591 ASTPair currentAST = new ASTPair();
2592 AST iteracion_AST = null;
2595 try { // for error handling
2597 AST tmp49_AST = null;
2598 AST tmp49_AST_in = null;
2599 tmp49_AST = astFactory.create((AST)_t);
2600 tmp49_AST_in = (AST)_t;
2601 astFactory.addASTChild(currentAST, tmp49_AST);
2602 ASTPair __currentAST9877 = currentAST.copy();
2603 currentAST.root = currentAST.child;
2604 currentAST.child = null;
2606 _t = _t.getFirstChild();
2609 astFactory.addASTChild(currentAST, returnAST);
2611 AST tmp50_AST = null;
2612 AST tmp50_AST_in = null;
2613 tmp50_AST = astFactory.create((AST)_t);
2614 tmp50_AST_in = (AST)_t;
2615 astFactory.addASTChild(currentAST, tmp50_AST);
2616 ASTPair __currentAST9878 = currentAST.copy();
2617 currentAST.root = currentAST.child;
2618 currentAST.child = null;
2619 match(_t,INSTRUCCIONES);
2620 _t = _t.getFirstChild();
2621 instrucciones(_t,tipodev);
2623 astFactory.addASTChild(currentAST, returnAST);
2624 currentAST = __currentAST9878;
2626 _t = _t.getNextSibling();
2627 currentAST = __currentAST9877;
2629 _t = _t.getNextSibling();
2632 iteracion_AST = (AST)currentAST.root;
2634 catch (RecognitionException ex) {
2636 if (_t!=null) {_t = _t.getNextSibling();}
2638 returnAST = iteracion_AST;
2642 public final Atr_Expr acceso(AST _t) throws RecognitionException {
2645 AST acceso_AST_in = (_t == ASTNULL) ? null : (AST)_t;
2647 ASTPair currentAST = new ASTPair();
2648 AST acceso_AST = null;
2655 try { // for error handling
2656 if (_t==null) _t=ASTNULL;
2657 switch ( _t.getType()) {
2660 e=acceso_simple(_t);
2662 astFactory.addASTChild(currentAST, returnAST);
2664 acceso_AST = (AST)currentAST.root;
2670 AST tmp51_AST = null;
2671 AST tmp51_AST_in = null;
2672 tmp51_AST = astFactory.create((AST)_t);
2673 tmp51_AST_in = (AST)_t;
2674 astFactory.addASTChild(currentAST, tmp51_AST);
2675 ASTPair __currentAST9901 = currentAST.copy();
2676 currentAST.root = currentAST.child;
2677 currentAST.child = null;
2678 match(_t,ACCESO_OBJETO);
2679 _t = _t.getFirstChild();
2680 r = _t==ASTNULL ? null : (AST)_t;
2681 e=acceso_simple(_t);
2683 r_AST = (AST)returnAST;
2684 astFactory.addASTChild(currentAST, returnAST);
2686 AST a_AST_in = null;
2687 a_AST = astFactory.create(a);
2688 astFactory.addASTChild(currentAST, a_AST);
2690 _t = _t.getNextSibling();
2691 currentAST = __currentAST9901;
2693 _t = _t.getNextSibling();
2695 res=AS_Acceso_Objeto( e, r, a);
2697 acceso_AST = (AST)currentAST.root;
2702 throw new NoViableAltException(_t);
2706 catch (RecognitionException ex) {
2708 if (_t!=null) {_t = _t.getNextSibling();}
2710 returnAST = acceso_AST;
2715 public final LinkedList lista_expresiones(AST _t) throws RecognitionException {
2716 LinkedList l= new LinkedList();
2718 AST lista_expresiones_AST_in = (_t == ASTNULL) ? null : (AST)_t;
2720 ASTPair currentAST = new ASTPair();
2721 AST lista_expresiones_AST = null;
2724 try { // for error handling
2728 if (_t==null) _t=ASTNULL;
2729 if ((_tokenSet_0.member(_t.getType()))) {
2732 astFactory.addASTChild(currentAST, returnAST);
2741 lista_expresiones_AST = (AST)currentAST.root;
2743 catch (RecognitionException ex) {
2745 if (_t!=null) {_t = _t.getNextSibling();}
2747 returnAST = lista_expresiones_AST;
2752 public final LinkedList lista_expresiones_nv(AST _t) throws RecognitionException {
2753 LinkedList l= new LinkedList();
2755 AST lista_expresiones_nv_AST_in = (_t == ASTNULL) ? null : (AST)_t;
2757 ASTPair currentAST = new ASTPair();
2758 AST lista_expresiones_nv_AST = null;
2761 try { // for error handling
2766 if (_t==null) _t=ASTNULL;
2767 if ((_tokenSet_0.member(_t.getType()))) {
2770 astFactory.addASTChild(currentAST, returnAST);
2774 if ( _cnt9907>=1 ) { break _loop9907; } else {throw new NoViableAltException(_t);}
2780 lista_expresiones_nv_AST = (AST)currentAST.root;
2782 catch (RecognitionException ex) {
2784 if (_t!=null) {_t = _t.getNextSibling();}
2786 returnAST = lista_expresiones_nv_AST;
2791 public final Atr_Expr acceso_simple(AST _t) throws RecognitionException {
2794 AST acceso_simple_AST_in = (_t == ASTNULL) ? null : (AST)_t;
2796 ASTPair currentAST = new ASTPair();
2797 AST acceso_simple_AST = null;
2801 try { // for error handling
2803 AST tmp52_AST = null;
2804 AST tmp52_AST_in = null;
2805 tmp52_AST = astFactory.create((AST)_t);
2806 tmp52_AST_in = (AST)_t;
2807 astFactory.addASTChild(currentAST, tmp52_AST);
2808 ASTPair __currentAST9903 = currentAST.copy();
2809 currentAST.root = currentAST.child;
2810 currentAST.child = null;
2811 match(_t,ACCESO_SIMPLE);
2812 _t = _t.getFirstChild();
2813 AST tmp53_AST = null;
2814 AST tmp53_AST_in = null;
2815 tmp53_AST = astFactory.create((AST)_t);
2816 tmp53_AST_in = (AST)_t;
2817 astFactory.addASTChild(currentAST, tmp53_AST);
2819 _t = _t.getNextSibling();
2820 d = _t==ASTNULL ? null : (AST)_t;
2821 declaracion_acceso(_t);
2823 d_AST = (AST)returnAST;
2824 astFactory.addASTChild(currentAST, returnAST);
2825 currentAST = __currentAST9903;
2827 _t = _t.getNextSibling();
2828 res=AS_Acceso_Simple(d_AST);
2829 acceso_simple_AST = (AST)currentAST.root;
2831 catch (RecognitionException ex) {
2833 if (_t!=null) {_t = _t.getNextSibling();}
2835 returnAST = acceso_simple_AST;
2840 public final void declaracion_acceso(AST _t) throws RecognitionException {
2842 AST declaracion_acceso_AST_in = (_t == ASTNULL) ? null : (AST)_t;
2844 ASTPair currentAST = new ASTPair();
2845 AST declaracion_acceso_AST = null;
2847 try { // for error handling
2848 if (_t==null) _t=ASTNULL;
2849 switch ( _t.getType()) {