incluidos todos, que no lo habĂ­a hecho antes
[PL2.git] / Anasint.java
1 // $ANTLR : "Anasint.g" -> "Anasint.java"$
2
3         import java.util.*;
4         import antlr.*;
5         import java.io.*;
6
7 import antlr.TokenBuffer;
8 import antlr.TokenStreamException;
9 import antlr.TokenStreamIOException;
10 import antlr.ANTLRException;
11 import antlr.LLkParser;
12 import antlr.Token;
13 import antlr.TokenStream;
14 import antlr.RecognitionException;
15 import antlr.NoViableAltException;
16 import antlr.MismatchedTokenException;
17 import antlr.SemanticException;
18 import antlr.ParserSharedInputState;
19 import antlr.collections.impl.BitSet;
20 import antlr.collections.AST;
21 import java.util.Hashtable;
22 import antlr.ASTFactory;
23 import antlr.ASTPair;
24 import antlr.collections.impl.ASTArray;
25
26 public class Anasint extends antlr.LLkParser       implements AnasintTokenTypes
27  {
28
29         logFile log;
30         int margen = 0;
31         Pila_Ambitos pilaambitos = new Pila_Ambitos();
32         
33         void ambito_abrir_programa(){
34                 if(pilaambitos.vacia() == true){
35                         Ambito a = new Ambito("programa","PROGRAMA",null,null);
36                         pilaambitos.apilar_ambito(a);
37                 }
38         }
39   
40         void ambito_abrir(AST nombre, String tipo){
41                 Ambito act = pilaambitos.ambito_actual();
42                 String tipoAct = act.getTipo();
43                 if(tipo.equals("MODULO") && tipoAct.equals("PROGRAMA")
44                         || tipo.equals("CLASE") && tipoAct.equals("MODULO")
45                         || tipo.equals("METODO") && tipoAct.equals("CLASE")){
46                         Ambito A = new Ambito(nombre.getText(), tipo, null, act);
47                         pilaambitos.apilar_ambito(A);
48                 }
49         }
50         
51         void ambito_cerrar(){
52                 if(pilaambitos.vacia() == false){
53                         pilaambitos.desapilar_ambito();
54                 }
55         }
56         void ambito_cerrar_programa(){
57                 if(pilaambitos.vacia() == false && pilaambitos.ambito_actual().getTipo().equals("PROGRAMA"))
58                         pilaambitos.desapilar_ambito();
59         }
60         
61         AST crear_declaracion_modulo(AST nombre_modulo, AST definicion_modulo){
62                 String m = nombre_modulo.getText();
63                 AST M = (AST)astFactory.make( (new ASTArray(3)).add(astFactory.create(MODULO,"modulo")).add(nombre_modulo).add(definicion_modulo));
64                 Simbolo S = new Simbolo(m, M);
65                 pilaambitos.ambito_actual().setDeclaracion(S);
66                 return M;
67         }
68         
69         AST crear_declaracion_clase (AST nombre_clase, AST cualificador_clase, AST definicion_clase){
70                 String c = nombre_clase.getText();
71                 AST C = (AST)astFactory.make( (new ASTArray(4)).add(astFactory.create(CLASE,"clase")).add(nombre_clase).add(cualificador_clase).add(definicion_clase));
72                 Simbolo S = new Simbolo(c,C);
73                 pilaambitos.ambito_actual().setDeclaracion(S);
74                 return C;
75         }
76
77         AST crear_declaracion_metodo (AST declaracion_metodo, AST cualificador_metodo){
78                 AST MT = (AST)astFactory.make( (new ASTArray(3)).add(astFactory.create(METODO,"metodo")).add(declaracion_metodo).add(cualificador_metodo));
79                 String mt = MT.getFirstChild().getFirstChild().getText();
80                 Simbolo S = new Simbolo(mt,MT);
81                 pilaambitos.ambito_actual().setDeclaracion(S);
82                 return MT;
83         }
84         
85         AST crear_declaracion_atributo (AST nombre_atributo, AST tipo_atributo, AST cualificador_atributo){
86         String a = nombre_atributo.getText();
87         AST A = (AST)astFactory.make( (new ASTArray(4)).add(astFactory.create(ATRIBUTO,"atributo")).add(nombre_atributo).add(tipo_atributo).add(cualificador_atributo));
88         Simbolo S = new Simbolo(a, A);
89         pilaambitos.ambito_actual().setDeclaracion(S);
90         return A;
91         }
92
93         AST crear_declaracion_parametro (AST nombre_parametro, AST tipo_parametro){
94                 String p = nombre_parametro.getText();
95                 AST P = (AST)astFactory.make( (new ASTArray(3)).add(astFactory.create(PARAMETRO,"parametro")).add(nombre_parametro).add(tipo_parametro));
96                 Simbolo S = new Simbolo(p, P);
97                 pilaambitos.ambito_actual().setDeclaracion(S);
98                 return P;
99                 
100         }
101         
102         
103         AST crear_declaracion_variable_local (AST nombre_variable, AST tipo_variable){
104                 String v = nombre_variable.getText();
105                 AST V = (AST)astFactory.make( (new ASTArray(3)).add(astFactory.create(VARIABLE_LOCAL,"variable_local")).add(nombre_variable).add(tipo_variable));
106                 Simbolo S = new Simbolo(v, V);
107                 pilaambitos.ambito_actual().setDeclaracion(S);
108                 return V;
109         }
110
111         AST ambito_tratar_acceso_simple (AST ident){
112                 String acc = ident.getText();
113                 AST dec_acc = null;
114                 Simbolo s;
115                 if ((s=pilaambitos.buscar_simbolo(acc)) != null){
116                 dec_acc = s.getDeclaracion(); // AST de la declaracion del acceso simple
117                         log.writeNoIndent(" ("+dec_acc.getText()+")\n");
118                 }
119                 else{
120                         String men = "ERROR RN: Identificador " +acc+ " no declarado";
121                         dec_acc = (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(ERROR,"error")));
122                         System.out.println(men); // identificador no declarado
123                         log.writeNoIndent(" (error)\n");
124                 }
125                 AST ACC = (AST)astFactory.make( (new ASTArray(3)).add(astFactory.create(ACCESO_SIMPLE,"acceso_simple")).add(ident).add(dec_acc));
126                 return ACC;
127         }
128
129         AST ambito_tratar_ident_tipo (AST ident){
130                 String men = "";
131                 String tipo = ident.getText();
132                 men = "ERROR RN: Identificador de tipo "+tipo+" no declarado";
133                 Ambito amb = pilaambitos.ambito_actual();
134                 while (amb != null && !amb.getTipo().equals("MODULO"))
135                         amb = amb.getContenedor();
136                 if (amb == null){
137                         System.out.println(men); // el tipo no es un tipo clase
138                         return (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(ERROR,"error")));
139                 }
140                 Simbolo simb = amb.getDeclaracion(tipo);
141                 if (simb == null){
142                         System.out.println(men); // el tipo no es un tipo clase
143                         return (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(ERROR,"error"))); //#(#[ERROR,"error"]);
144                 }
145                 AST C = simb.getDeclaracion();
146                 return C;
147         }
148         
149         
150         public AST arbol_crear(AST e1, AST e2){
151                 if(e2 == null){
152                         return (AST)astFactory.make( (new ASTArray(3)).add(astFactory.create(CREAR,"crear")).add(e1).add(astFactory.create(ERROR,"error")));
153                 }else
154                         return  (AST)astFactory.make( (new ASTArray(3)).add(astFactory.create(CREAR,"crear")).add(e1).add(e2));
155         }
156         
157         public AST arbol_escribir(AST e){
158                 if(e == null){
159                         return (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(ERROR,"error")));
160                 }else
161                         return  (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(ESCRIBIR,"escribir")).add(e));
162         }
163
164         //comprueba que existe la clase programa y el metodo inicio en esta
165         public void comprobarPrograma(AST modulo){
166                 boolean programa=false;
167                 AST clase = modulo.getFirstChild().getNextSibling().getNextSibling().getFirstChild();
168                 String nombre = clase.getFirstChild().getText();
169                 while(true){
170                         if(nombre.equals("Programa") && !programa){
171                                 programa = true;
172                                 if(clase.getFirstChild().getNextSibling().getText().equals("inst")){
173                                         System.out.println("ERROR AS: La clase Programa tiene que ser no instanciable");
174                                 }
175                                 comprobarInicio(clase);
176                         }
177                         
178                         clase = clase.getNextSibling();
179                         if(clase == null)
180                                 break;
181                         nombre = clase.getFirstChild().getText();
182                 }
183                 if(!programa){
184                         System.out.println("ERROR AS: No se ha definido la clase Programa");
185                 }
186         }
187         
188         public void comprobarInicio(AST Prog){
189                 boolean inicio = false;
190
191                 AST modulo = Prog.getFirstChild().getNextSibling().getNextSibling();
192                 if(modulo != null){
193                         while(modulo.getType() != METODO && modulo != null){
194                                 modulo = modulo.getNextSibling();
195                         }
196                         if(modulo != null && !modulo.getFirstChild().getFirstChild().getText().equals("inicio")){
197                                 System.out.println("ERROR AS: Debe haber un metodo inicio en la clase Programa, y debe ser unico");
198                         }if(modulo.getNextSibling() != null){
199                                 System.out.println("ERROR AS: Debe haber un metodo inicio en la clase Programa, y debe ser unico");
200                         }
201                 }
202         }
203         
204         
205
206 protected Anasint(TokenBuffer tokenBuf, int k) {
207   super(tokenBuf,k);
208   tokenNames = _tokenNames;
209   buildTokenTypeASTClassMap();
210   astFactory = new ASTFactory(getTokenTypeToASTClassMap());
211 }
212
213 public Anasint(TokenBuffer tokenBuf) {
214   this(tokenBuf,1);
215 }
216
217 protected Anasint(TokenStream lexer, int k) {
218   super(lexer,k);
219   tokenNames = _tokenNames;
220   buildTokenTypeASTClassMap();
221   astFactory = new ASTFactory(getTokenTypeToASTClassMap());
222 }
223
224 public Anasint(TokenStream lexer) {
225   this(lexer,1);
226 }
227
228 public Anasint(ParserSharedInputState state) {
229   super(state,1);
230   tokenNames = _tokenNames;
231   buildTokenTypeASTClassMap();
232   astFactory = new ASTFactory(getTokenTypeToASTClassMap());
233 }
234
235         public final void declaracion_modulo(
236                 String f
237         ) throws RecognitionException, TokenStreamException {
238                 
239                 returnAST = null;
240                 ASTPair currentAST = new ASTPair();
241                 AST declaracion_modulo_AST = null;
242                 AST n_AST = null;
243                 AST d_AST = null;
244                 
245                 try {      // for error handling
246                         if ( inputState.guessing==0 ) {
247                                 
248                                         ambito_abrir_programa();
249                                         log = new logFile(f);
250                                 
251                         }
252                         nombre_modulo();
253                         n_AST = (AST)returnAST;
254                         if ( inputState.guessing==0 ) {
255                                 
256                                         ambito_abrir (n_AST,"MODULO");
257                                         log.write("MODULO: "+n_AST.getText()+"\n");
258                                         log.incNivel();
259                                 
260                         }
261                         definicion_modulo();
262                         d_AST = (AST)returnAST;
263                         AST tmp1_AST = null;
264                         tmp1_AST = astFactory.create(LT(1));
265                         match(Token.EOF_TYPE);
266                         if ( inputState.guessing==0 ) {
267                                 declaracion_modulo_AST = (AST)currentAST.root;
268                                 
269                                         ambito_cerrar();
270                                 declaracion_modulo_AST=crear_declaracion_modulo(n_AST,d_AST);
271                                 comprobarPrograma(declaracion_modulo_AST);
272                                 ambito_cerrar_programa();
273                                 log.decNivel();
274                                 log.close();
275                                 
276                                 currentAST.root = declaracion_modulo_AST;
277                                 currentAST.child = declaracion_modulo_AST!=null &&declaracion_modulo_AST.getFirstChild()!=null ?
278                                         declaracion_modulo_AST.getFirstChild() : declaracion_modulo_AST;
279                                 currentAST.advanceChildToEnd();
280                         }
281                 }
282                 catch (RecognitionException ex) {
283                         if (inputState.guessing==0) {
284                                 reportError(ex);
285                                 recover(ex,_tokenSet_0);
286                         } else {
287                           throw ex;
288                         }
289                 }
290                 returnAST = declaracion_modulo_AST;
291         }
292         
293         public final void nombre_modulo() throws RecognitionException, TokenStreamException {
294                 
295                 returnAST = null;
296                 ASTPair currentAST = new ASTPair();
297                 AST nombre_modulo_AST = null;
298                 
299                 try {      // for error handling
300                         match(MODULO);
301                         AST tmp3_AST = null;
302                         tmp3_AST = astFactory.create(LT(1));
303                         astFactory.addASTChild(currentAST, tmp3_AST);
304                         match(IDENT);
305                         nombre_modulo_AST = (AST)currentAST.root;
306                 }
307                 catch (RecognitionException ex) {
308                         if (inputState.guessing==0) {
309                                 reportError(ex);
310                                 recover(ex,_tokenSet_1);
311                         } else {
312                           throw ex;
313                         }
314                 }
315                 returnAST = nombre_modulo_AST;
316         }
317         
318         public final void definicion_modulo() throws RecognitionException, TokenStreamException {
319                 
320                 returnAST = null;
321                 ASTPair currentAST = new ASTPair();
322                 AST definicion_modulo_AST = null;
323                 
324                 try {      // for error handling
325                         importacion();
326                         astFactory.addASTChild(currentAST, returnAST);
327                         {
328                         int _cnt10079=0;
329                         _loop10079:
330                         do {
331                                 if ((LA(1)==EXPORTACION)) {
332                                         exportacion();
333                                         astFactory.addASTChild(currentAST, returnAST);
334                                 }
335                                 else {
336                                         if ( _cnt10079>=1 ) { break _loop10079; } else {throw new NoViableAltException(LT(1), getFilename());}
337                                 }
338                                 
339                                 _cnt10079++;
340                         } while (true);
341                         }
342                         {
343                         switch ( LA(1)) {
344                         case IMPLEMENTACION:
345                         {
346                                 implementacion();
347                                 astFactory.addASTChild(currentAST, returnAST);
348                                 break;
349                         }
350                         case EOF:
351                         {
352                                 break;
353                         }
354                         default:
355                         {
356                                 throw new NoViableAltException(LT(1), getFilename());
357                         }
358                         }
359                         }
360                         definicion_modulo_AST = (AST)currentAST.root;
361                 }
362                 catch (RecognitionException ex) {
363                         if (inputState.guessing==0) {
364                                 reportError(ex);
365                                 recover(ex,_tokenSet_0);
366                         } else {
367                           throw ex;
368                         }
369                 }
370                 returnAST = definicion_modulo_AST;
371         }
372         
373         public final void importacion() throws RecognitionException, TokenStreamException {
374                 
375                 returnAST = null;
376                 ASTPair currentAST = new ASTPair();
377                 AST importacion_AST = null;
378                 AST l_AST = null;
379                 
380                 try {      // for error handling
381                         {
382                         switch ( LA(1)) {
383                         case IMPORTACION:
384                         {
385                                 AST tmp4_AST = null;
386                                 tmp4_AST = astFactory.create(LT(1));
387                                 match(IMPORTACION);
388                                 AST tmp5_AST = null;
389                                 tmp5_AST = astFactory.create(LT(1));
390                                 match(DOS_PUNTOS);
391                                 lista_ident();
392                                 l_AST = (AST)returnAST;
393                                 break;
394                         }
395                         case EXPORTACION:
396                         {
397                                 break;
398                         }
399                         default:
400                         {
401                                 throw new NoViableAltException(LT(1), getFilename());
402                         }
403                         }
404                         }
405                         if ( inputState.guessing==0 ) {
406                                 importacion_AST = (AST)currentAST.root;
407                                 importacion_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(IMPORTACION,"importacion")).add(l_AST));
408                                 currentAST.root = importacion_AST;
409                                 currentAST.child = importacion_AST!=null &&importacion_AST.getFirstChild()!=null ?
410                                         importacion_AST.getFirstChild() : importacion_AST;
411                                 currentAST.advanceChildToEnd();
412                         }
413                 }
414                 catch (RecognitionException ex) {
415                         if (inputState.guessing==0) {
416                                 reportError(ex);
417                                 recover(ex,_tokenSet_2);
418                         } else {
419                           throw ex;
420                         }
421                 }
422                 returnAST = importacion_AST;
423         }
424         
425         public final void exportacion() throws RecognitionException, TokenStreamException {
426                 
427                 returnAST = null;
428                 ASTPair currentAST = new ASTPair();
429                 AST exportacion_AST = null;
430                 AST l_AST = null;
431                 
432                 try {      // for error handling
433                         AST tmp6_AST = null;
434                         tmp6_AST = astFactory.create(LT(1));
435                         astFactory.makeASTRoot(currentAST, tmp6_AST);
436                         match(EXPORTACION);
437                         match(DOS_PUNTOS);
438                         lista_declaraciones_clases();
439                         l_AST = (AST)returnAST;
440                         astFactory.addASTChild(currentAST, returnAST);
441                         exportacion_AST = (AST)currentAST.root;
442                 }
443                 catch (RecognitionException ex) {
444                         if (inputState.guessing==0) {
445                                 reportError(ex);
446                                 recover(ex,_tokenSet_3);
447                         } else {
448                           throw ex;
449                         }
450                 }
451                 returnAST = exportacion_AST;
452         }
453         
454         public final void implementacion() throws RecognitionException, TokenStreamException {
455                 
456                 returnAST = null;
457                 ASTPair currentAST = new ASTPair();
458                 AST implementacion_AST = null;
459                 AST l_AST = null;
460                 
461                 try {      // for error handling
462                         AST tmp8_AST = null;
463                         tmp8_AST = astFactory.create(LT(1));
464                         astFactory.makeASTRoot(currentAST, tmp8_AST);
465                         match(IMPLEMENTACION);
466                         match(DOS_PUNTOS);
467                         lista_declaraciones_clases();
468                         l_AST = (AST)returnAST;
469                         astFactory.addASTChild(currentAST, returnAST);
470                         implementacion_AST = (AST)currentAST.root;
471                 }
472                 catch (RecognitionException ex) {
473                         if (inputState.guessing==0) {
474                                 reportError(ex);
475                                 recover(ex,_tokenSet_0);
476                         } else {
477                           throw ex;
478                         }
479                 }
480                 returnAST = implementacion_AST;
481         }
482         
483         public final void lista_ident() throws RecognitionException, TokenStreamException {
484                 
485                 returnAST = null;
486                 ASTPair currentAST = new ASTPair();
487                 AST lista_ident_AST = null;
488                 
489                 try {      // for error handling
490                         AST tmp10_AST = null;
491                         tmp10_AST = astFactory.create(LT(1));
492                         astFactory.addASTChild(currentAST, tmp10_AST);
493                         match(IDENT);
494                         {
495                         _loop10083:
496                         do {
497                                 if ((LA(1)==COMA)) {
498                                         match(COMA);
499                                         AST tmp12_AST = null;
500                                         tmp12_AST = astFactory.create(LT(1));
501                                         astFactory.addASTChild(currentAST, tmp12_AST);
502                                         match(IDENT);
503                                 }
504                                 else {
505                                         break _loop10083;
506                                 }
507                                 
508                         } while (true);
509                         }
510                         lista_ident_AST = (AST)currentAST.root;
511                 }
512                 catch (RecognitionException ex) {
513                         if (inputState.guessing==0) {
514                                 reportError(ex);
515                                 recover(ex,_tokenSet_2);
516                         } else {
517                           throw ex;
518                         }
519                 }
520                 returnAST = lista_ident_AST;
521         }
522         
523         public final void lista_declaraciones_clases() throws RecognitionException, TokenStreamException {
524                 
525                 returnAST = null;
526                 ASTPair currentAST = new ASTPair();
527                 AST lista_declaraciones_clases_AST = null;
528                 
529                 try {      // for error handling
530                         {
531                         _loop10090:
532                         do {
533                                 if ((LA(1)==INST||LA(1)==CLASE)) {
534                                         declaracion_clase();
535                                         astFactory.addASTChild(currentAST, returnAST);
536                                 }
537                                 else {
538                                         break _loop10090;
539                                 }
540                                 
541                         } while (true);
542                         }
543                         lista_declaraciones_clases_AST = (AST)currentAST.root;
544                 }
545                 catch (RecognitionException ex) {
546                         if (inputState.guessing==0) {
547                                 reportError(ex);
548                                 recover(ex,_tokenSet_3);
549                         } else {
550                           throw ex;
551                         }
552                 }
553                 returnAST = lista_declaraciones_clases_AST;
554         }
555         
556         public final void declaracion_clase() throws RecognitionException, TokenStreamException {
557                 
558                 returnAST = null;
559                 ASTPair currentAST = new ASTPair();
560                 AST declaracion_clase_AST = null;
561                 AST c_AST = null;
562                 AST n_AST = null;
563                 AST d_AST = null;
564                 
565                 try {      // for error handling
566                         cualificador_clase();
567                         c_AST = (AST)returnAST;
568                         nombre_clase();
569                         n_AST = (AST)returnAST;
570                         if ( inputState.guessing==0 ) {
571                                 
572                                         ambito_abrir(n_AST,"CLASE");
573                                         log.write("CLASE: "+n_AST.getText()+"\n");
574                                         log.incNivel();
575                                         
576                         }
577                         definicion_clase();
578                         d_AST = (AST)returnAST;
579                         if ( inputState.guessing==0 ) {
580                                 declaracion_clase_AST = (AST)currentAST.root;
581                                 
582                                         ambito_cerrar();
583                                 log.decNivel();
584                                 declaracion_clase_AST = crear_declaracion_clase(n_AST,c_AST,d_AST);
585                                 
586                                 currentAST.root = declaracion_clase_AST;
587                                 currentAST.child = declaracion_clase_AST!=null &&declaracion_clase_AST.getFirstChild()!=null ?
588                                         declaracion_clase_AST.getFirstChild() : declaracion_clase_AST;
589                                 currentAST.advanceChildToEnd();
590                         }
591                 }
592                 catch (RecognitionException ex) {
593                         if (inputState.guessing==0) {
594                                 reportError(ex);
595                                 recover(ex,_tokenSet_4);
596                         } else {
597                           throw ex;
598                         }
599                 }
600                 returnAST = declaracion_clase_AST;
601         }
602         
603         public final void cualificador_clase() throws RecognitionException, TokenStreamException {
604                 
605                 returnAST = null;
606                 ASTPair currentAST = new ASTPair();
607                 AST cualificador_clase_AST = null;
608                 
609                 try {      // for error handling
610                         switch ( LA(1)) {
611                         case INST:
612                         {
613                                 AST tmp13_AST = null;
614                                 tmp13_AST = astFactory.create(LT(1));
615                                 match(INST);
616                                 if ( inputState.guessing==0 ) {
617                                         cualificador_clase_AST = (AST)currentAST.root;
618                                         cualificador_clase_AST = (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(tmp13_AST)));
619                                         currentAST.root = cualificador_clase_AST;
620                                         currentAST.child = cualificador_clase_AST!=null &&cualificador_clase_AST.getFirstChild()!=null ?
621                                                 cualificador_clase_AST.getFirstChild() : cualificador_clase_AST;
622                                         currentAST.advanceChildToEnd();
623                                 }
624                                 break;
625                         }
626                         case CLASE:
627                         {
628                                 if ( inputState.guessing==0 ) {
629                                         cualificador_clase_AST = (AST)currentAST.root;
630                                         cualificador_clase_AST = (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(NO_INST,"no_inst")));
631                                         currentAST.root = cualificador_clase_AST;
632                                         currentAST.child = cualificador_clase_AST!=null &&cualificador_clase_AST.getFirstChild()!=null ?
633                                                 cualificador_clase_AST.getFirstChild() : cualificador_clase_AST;
634                                         currentAST.advanceChildToEnd();
635                                 }
636                                 break;
637                         }
638                         default:
639                         {
640                                 throw new NoViableAltException(LT(1), getFilename());
641                         }
642                         }
643                 }
644                 catch (RecognitionException ex) {
645                         if (inputState.guessing==0) {
646                                 reportError(ex);
647                                 recover(ex,_tokenSet_5);
648                         } else {
649                           throw ex;
650                         }
651                 }
652                 returnAST = cualificador_clase_AST;
653         }
654         
655         public final void nombre_clase() throws RecognitionException, TokenStreamException {
656                 
657                 returnAST = null;
658                 ASTPair currentAST = new ASTPair();
659                 AST nombre_clase_AST = null;
660                 
661                 try {      // for error handling
662                         match(CLASE);
663                         AST tmp15_AST = null;
664                         tmp15_AST = astFactory.create(LT(1));
665                         astFactory.addASTChild(currentAST, tmp15_AST);
666                         match(IDENT);
667                         nombre_clase_AST = (AST)currentAST.root;
668                 }
669                 catch (RecognitionException ex) {
670                         if (inputState.guessing==0) {
671                                 reportError(ex);
672                                 recover(ex,_tokenSet_6);
673                         } else {
674                           throw ex;
675                         }
676                 }
677                 returnAST = nombre_clase_AST;
678         }
679         
680         public final void definicion_clase() throws RecognitionException, TokenStreamException {
681                 
682                 returnAST = null;
683                 ASTPair currentAST = new ASTPair();
684                 AST definicion_clase_AST = null;
685                 
686                 try {      // for error handling
687                         match(LLAVE_ABIERTA);
688                         declaraciones_elemento_clase();
689                         astFactory.addASTChild(currentAST, returnAST);
690                         match(LLAVE_CERRADA);
691                         definicion_clase_AST = (AST)currentAST.root;
692                 }
693                 catch (RecognitionException ex) {
694                         if (inputState.guessing==0) {
695                                 reportError(ex);
696                                 recover(ex,_tokenSet_4);
697                         } else {
698                           throw ex;
699                         }
700                 }
701                 returnAST = definicion_clase_AST;
702         }
703         
704         public final void declaraciones_elemento_clase() throws RecognitionException, TokenStreamException {
705                 
706                 returnAST = null;
707                 ASTPair currentAST = new ASTPair();
708                 AST declaraciones_elemento_clase_AST = null;
709                 
710                 try {      // for error handling
711                         {
712                         _loop10097:
713                         do {
714                                 if ((_tokenSet_7.member(LA(1)))) {
715                                         declaracion_elemento_clase();
716                                         astFactory.addASTChild(currentAST, returnAST);
717                                 }
718                                 else {
719                                         break _loop10097;
720                                 }
721                                 
722                         } while (true);
723                         }
724                         declaraciones_elemento_clase_AST = (AST)currentAST.root;
725                 }
726                 catch (RecognitionException ex) {
727                         if (inputState.guessing==0) {
728                                 reportError(ex);
729                                 recover(ex,_tokenSet_8);
730                         } else {
731                           throw ex;
732                         }
733                 }
734                 returnAST = declaraciones_elemento_clase_AST;
735         }
736         
737         public final void declaracion_elemento_clase() throws RecognitionException, TokenStreamException {
738                 
739                 returnAST = null;
740                 ASTPair currentAST = new ASTPair();
741                 AST declaracion_elemento_clase_AST = null;
742                 AST c_AST = null;
743                 AST a_AST = null;
744                 AST t_AST = null;
745                 Token  i = null;
746                 AST i_AST = null;
747                 
748                 try {      // for error handling
749                         cualificador_elemento_clase();
750                         c_AST = (AST)returnAST;
751                         {
752                         boolean synPredMatched10101 = false;
753                         if (((LA(1)==IDENT))) {
754                                 int _m10101 = mark();
755                                 synPredMatched10101 = true;
756                                 inputState.guessing++;
757                                 try {
758                                         {
759                                         match(IDENT);
760                                         match(PARENTESIS_ABIERTO);
761                                         }
762                                 }
763                                 catch (RecognitionException pe) {
764                                         synPredMatched10101 = false;
765                                 }
766                                 rewind(_m10101);
767 inputState.guessing--;
768                         }
769                         if ( synPredMatched10101 ) {
770                                 declaracion_metodo();
771                                 a_AST = (AST)returnAST;
772                                 if ( inputState.guessing==0 ) {
773                                         declaracion_elemento_clase_AST = (AST)currentAST.root;
774                                         
775                                                 ambito_cerrar();
776                                         declaracion_elemento_clase_AST = crear_declaracion_metodo(a_AST,c_AST);
777                                         
778                                         currentAST.root = declaracion_elemento_clase_AST;
779                                         currentAST.child = declaracion_elemento_clase_AST!=null &&declaracion_elemento_clase_AST.getFirstChild()!=null ?
780                                                 declaracion_elemento_clase_AST.getFirstChild() : declaracion_elemento_clase_AST;
781                                         currentAST.advanceChildToEnd();
782                                 }
783                         }
784                         else if ((_tokenSet_9.member(LA(1)))) {
785                                 tipo();
786                                 t_AST = (AST)returnAST;
787                                 i = LT(1);
788                                 i_AST = astFactory.create(i);
789                                 match(IDENT);
790                                 AST tmp18_AST = null;
791                                 tmp18_AST = astFactory.create(LT(1));
792                                 match(PUNTO_Y_COMA);
793                                 if ( inputState.guessing==0 ) {
794                                         declaracion_elemento_clase_AST = (AST)currentAST.root;
795                                         
796                                         declaracion_elemento_clase_AST = crear_declaracion_atributo(i_AST,t_AST,c_AST);
797                                         log.write("ATRIBUTO: "+i_AST.getText()+"\n");
798                                         
799                                         currentAST.root = declaracion_elemento_clase_AST;
800                                         currentAST.child = declaracion_elemento_clase_AST!=null &&declaracion_elemento_clase_AST.getFirstChild()!=null ?
801                                                 declaracion_elemento_clase_AST.getFirstChild() : declaracion_elemento_clase_AST;
802                                         currentAST.advanceChildToEnd();
803                                 }
804                         }
805                         else {
806                                 throw new NoViableAltException(LT(1), getFilename());
807                         }
808                         
809                         }
810                 }
811                 catch (RecognitionException ex) {
812                         if (inputState.guessing==0) {
813                                 reportError(ex);
814                                 recover(ex,_tokenSet_10);
815                         } else {
816                           throw ex;
817                         }
818                 }
819                 returnAST = declaracion_elemento_clase_AST;
820         }
821         
822         public final void cualificador_elemento_clase() throws RecognitionException, TokenStreamException {
823                 
824                 returnAST = null;
825                 ASTPair currentAST = new ASTPair();
826                 AST cualificador_elemento_clase_AST = null;
827                 
828                 try {      // for error handling
829                         switch ( LA(1)) {
830                         case OCULTO:
831                         {
832                                 AST tmp19_AST = null;
833                                 tmp19_AST = astFactory.create(LT(1));
834                                 match(OCULTO);
835                                 if ( inputState.guessing==0 ) {
836                                         cualificador_elemento_clase_AST = (AST)currentAST.root;
837                                         cualificador_elemento_clase_AST = (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(tmp19_AST)));
838                                         currentAST.root = cualificador_elemento_clase_AST;
839                                         currentAST.child = cualificador_elemento_clase_AST!=null &&cualificador_elemento_clase_AST.getFirstChild()!=null ?
840                                                 cualificador_elemento_clase_AST.getFirstChild() : cualificador_elemento_clase_AST;
841                                         currentAST.advanceChildToEnd();
842                                 }
843                                 break;
844                         }
845                         case IDENT:
846                         case ENTERO:
847                         case REAL:
848                         case LOGICO:
849                         case CARACTER:
850                         case FORMACION:
851                         {
852                                 if ( inputState.guessing==0 ) {
853                                         cualificador_elemento_clase_AST = (AST)currentAST.root;
854                                         cualificador_elemento_clase_AST = (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(VISIBLE,"visible")));
855                                         currentAST.root = cualificador_elemento_clase_AST;
856                                         currentAST.child = cualificador_elemento_clase_AST!=null &&cualificador_elemento_clase_AST.getFirstChild()!=null ?
857                                                 cualificador_elemento_clase_AST.getFirstChild() : cualificador_elemento_clase_AST;
858                                         currentAST.advanceChildToEnd();
859                                 }
860                                 break;
861                         }
862                         default:
863                         {
864                                 throw new NoViableAltException(LT(1), getFilename());
865                         }
866                         }
867                 }
868                 catch (RecognitionException ex) {
869                         if (inputState.guessing==0) {
870                                 reportError(ex);
871                                 recover(ex,_tokenSet_9);
872                         } else {
873                           throw ex;
874                         }
875                 }
876                 returnAST = cualificador_elemento_clase_AST;
877         }
878         
879         public final void declaracion_metodo() throws RecognitionException, TokenStreamException {
880                 
881                 returnAST = null;
882                 ASTPair currentAST = new ASTPair();
883                 AST declaracion_metodo_AST = null;
884                 
885                 try {      // for error handling
886                         prototipo_metodo();
887                         astFactory.addASTChild(currentAST, returnAST);
888                         definicion_metodo();
889                         astFactory.addASTChild(currentAST, returnAST);
890                         declaracion_metodo_AST = (AST)currentAST.root;
891                 }
892                 catch (RecognitionException ex) {
893                         if (inputState.guessing==0) {
894                                 reportError(ex);
895                                 recover(ex,_tokenSet_10);
896                         } else {
897                           throw ex;
898                         }
899                 }
900                 returnAST = declaracion_metodo_AST;
901         }
902         
903         public final void tipo() throws RecognitionException, TokenStreamException {
904                 
905                 returnAST = null;
906                 ASTPair currentAST = new ASTPair();
907                 AST tipo_AST = null;
908                 Token  i = null;
909                 AST i_AST = null;
910                 
911                 try {      // for error handling
912                         switch ( LA(1)) {
913                         case ENTERO:
914                         case REAL:
915                         case LOGICO:
916                         case CARACTER:
917                         {
918                                 tipo_predefinido_simple();
919                                 astFactory.addASTChild(currentAST, returnAST);
920                                 tipo_AST = (AST)currentAST.root;
921                                 break;
922                         }
923                         case FORMACION:
924                         {
925                                 tipo_predefinido_compuesto();
926                                 astFactory.addASTChild(currentAST, returnAST);
927                                 tipo_AST = (AST)currentAST.root;
928                                 break;
929                         }
930                         case IDENT:
931                         {
932                                 i = LT(1);
933                                 i_AST = astFactory.create(i);
934                                 astFactory.addASTChild(currentAST, i_AST);
935                                 match(IDENT);
936                                 if ( inputState.guessing==0 ) {
937                                         tipo_AST = (AST)currentAST.root;
938                                         tipo_AST = ambito_tratar_ident_tipo(i_AST);
939                                         log.write("IDENTIFICADOR TIPO: "+i_AST.getText()+"\n");
940                                         
941                                         currentAST.root = tipo_AST;
942                                         currentAST.child = tipo_AST!=null &&tipo_AST.getFirstChild()!=null ?
943                                                 tipo_AST.getFirstChild() : tipo_AST;
944                                         currentAST.advanceChildToEnd();
945                                 }
946                                 tipo_AST = (AST)currentAST.root;
947                                 break;
948                         }
949                         default:
950                         {
951                                 throw new NoViableAltException(LT(1), getFilename());
952                         }
953                         }
954                 }
955                 catch (RecognitionException ex) {
956                         if (inputState.guessing==0) {
957                                 reportError(ex);
958                                 recover(ex,_tokenSet_11);
959                         } else {
960                           throw ex;
961                         }
962                 }
963                 returnAST = tipo_AST;
964         }
965         
966         public final void prototipo_metodo() throws RecognitionException, TokenStreamException {
967                 
968                 returnAST = null;
969                 ASTPair currentAST = new ASTPair();
970                 AST prototipo_metodo_AST = null;
971                 Token  i = null;
972                 AST i_AST = null;
973                 AST p_AST = null;
974                 AST t_AST = null;
975                 
976                 try {      // for error handling
977                         i = LT(1);
978                         i_AST = astFactory.create(i);
979                         match(IDENT);
980                         if ( inputState.guessing==0 ) {
981                                 
982                                 ambito_abrir(i_AST,"METODO");
983                                 log.write("METODO: "+i_AST.getText()+"\n");
984                                 
985                         }
986                         AST tmp20_AST = null;
987                         tmp20_AST = astFactory.create(LT(1));
988                         match(PARENTESIS_ABIERTO);
989                         declaracion_parametros();
990                         p_AST = (AST)returnAST;
991                         AST tmp21_AST = null;
992                         tmp21_AST = astFactory.create(LT(1));
993                         match(PARENTESIS_CERRADO);
994                         {
995                         switch ( LA(1)) {
996                         case DEV:
997                         {
998                                 AST tmp22_AST = null;
999                                 tmp22_AST = astFactory.create(LT(1));
1000                                 match(DEV);
1001                                 tipo();
1002                                 t_AST = (AST)returnAST;
1003                                 if ( inputState.guessing==0 ) {
1004                                         prototipo_metodo_AST = (AST)currentAST.root;
1005                                         prototipo_metodo_AST = (AST)astFactory.make( (new ASTArray(4)).add(astFactory.create(PROTOTIPO,"prototipo")).add(i_AST).add((AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(PARAMETROS,"parametros")).add(p_AST))).add((AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(RESULTADO,"resultado")).add(t_AST))));
1006                                         currentAST.root = prototipo_metodo_AST;
1007                                         currentAST.child = prototipo_metodo_AST!=null &&prototipo_metodo_AST.getFirstChild()!=null ?
1008                                                 prototipo_metodo_AST.getFirstChild() : prototipo_metodo_AST;
1009                                         currentAST.advanceChildToEnd();
1010                                 }
1011                                 break;
1012                         }
1013                         case LLAVE_ABIERTA:
1014                         {
1015                                 if ( inputState.guessing==0 ) {
1016                                         prototipo_metodo_AST = (AST)currentAST.root;
1017                                         prototipo_metodo_AST = (AST)astFactory.make( (new ASTArray(4)).add(astFactory.create(PROTOTIPO,"prototipo")).add(i_AST).add((AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(PARAMETROS,"parametros")).add(p_AST))).add((AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(RESULTADO,"resultado")).add(astFactory.create(VACIO,"vacio")))));
1018                                         currentAST.root = prototipo_metodo_AST;
1019                                         currentAST.child = prototipo_metodo_AST!=null &&prototipo_metodo_AST.getFirstChild()!=null ?
1020                                                 prototipo_metodo_AST.getFirstChild() : prototipo_metodo_AST;
1021                                         currentAST.advanceChildToEnd();
1022                                 }
1023                                 break;
1024                         }
1025                         default:
1026                         {
1027                                 throw new NoViableAltException(LT(1), getFilename());
1028                         }
1029                         }
1030                         }
1031                 }
1032                 catch (RecognitionException ex) {
1033                         if (inputState.guessing==0) {
1034                                 reportError(ex);
1035                                 recover(ex,_tokenSet_6);
1036                         } else {
1037                           throw ex;
1038                         }
1039                 }
1040                 returnAST = prototipo_metodo_AST;
1041         }
1042         
1043         public final void definicion_metodo() throws RecognitionException, TokenStreamException {
1044                 
1045                 returnAST = null;
1046                 ASTPair currentAST = new ASTPair();
1047                 AST definicion_metodo_AST = null;
1048                 AST d_AST = null;
1049                 AST b_AST = null;
1050                 
1051                 try {      // for error handling
1052                         AST tmp23_AST = null;
1053                         tmp23_AST = astFactory.create(LT(1));
1054                         match(LLAVE_ABIERTA);
1055                         if ( inputState.guessing==0 ) {
1056                                 log.incNivel();
1057                         }
1058                         declaraciones_variables_locales();
1059                         d_AST = (AST)returnAST;
1060                         bloque();
1061                         b_AST = (AST)returnAST;
1062                         AST tmp24_AST = null;
1063                         tmp24_AST = astFactory.create(LT(1));
1064                         match(LLAVE_CERRADA);
1065                         if ( inputState.guessing==0 ) {
1066                                 log.decNivel();
1067                         }
1068                         if ( inputState.guessing==0 ) {
1069                                 definicion_metodo_AST = (AST)currentAST.root;
1070                                 definicion_metodo_AST=   (AST)astFactory.make( (new ASTArray(3)).add(astFactory.create(DEFINICION,"definicion")).add((AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(VARIABLES_LOCALES,"variables_locales")).add(d_AST))).add(b_AST));
1071                                 currentAST.root = definicion_metodo_AST;
1072                                 currentAST.child = definicion_metodo_AST!=null &&definicion_metodo_AST.getFirstChild()!=null ?
1073                                         definicion_metodo_AST.getFirstChild() : definicion_metodo_AST;
1074                                 currentAST.advanceChildToEnd();
1075                         }
1076                 }
1077                 catch (RecognitionException ex) {
1078                         if (inputState.guessing==0) {
1079                                 reportError(ex);
1080                                 recover(ex,_tokenSet_10);
1081                         } else {
1082                           throw ex;
1083                         }
1084                 }
1085                 returnAST = definicion_metodo_AST;
1086         }
1087         
1088         public final void declaracion_parametros() throws RecognitionException, TokenStreamException {
1089                 
1090                 returnAST = null;
1091                 ASTPair currentAST = new ASTPair();
1092                 AST declaracion_parametros_AST = null;
1093                 
1094                 try {      // for error handling
1095                         switch ( LA(1)) {
1096                         case IDENT:
1097                         case ENTERO:
1098                         case REAL:
1099                         case LOGICO:
1100                         case CARACTER:
1101                         case FORMACION:
1102                         {
1103                                 declaracion_parametro();
1104                                 astFactory.addASTChild(currentAST, returnAST);
1105                                 {
1106                                 _loop10108:
1107                                 do {
1108                                         if ((LA(1)==COMA)) {
1109                                                 match(COMA);
1110                                                 declaracion_parametro();
1111                                                 astFactory.addASTChild(currentAST, returnAST);
1112                                         }
1113                                         else {
1114                                                 break _loop10108;
1115                                         }
1116                                         
1117                                 } while (true);
1118                                 }
1119                                 declaracion_parametros_AST = (AST)currentAST.root;
1120                                 break;
1121                         }
1122                         case PARENTESIS_CERRADO:
1123                         {
1124                                 declaracion_parametros_AST = (AST)currentAST.root;
1125                                 break;
1126                         }
1127                         default:
1128                         {
1129                                 throw new NoViableAltException(LT(1), getFilename());
1130                         }
1131                         }
1132                 }
1133                 catch (RecognitionException ex) {
1134                         if (inputState.guessing==0) {
1135                                 reportError(ex);
1136                                 recover(ex,_tokenSet_12);
1137                         } else {
1138                           throw ex;
1139                         }
1140                 }
1141                 returnAST = declaracion_parametros_AST;
1142         }
1143         
1144         public final void declaracion_parametro() throws RecognitionException, TokenStreamException {
1145                 
1146                 returnAST = null;
1147                 ASTPair currentAST = new ASTPair();
1148                 AST declaracion_parametro_AST = null;
1149                 AST t_AST = null;
1150                 Token  i = null;
1151                 AST i_AST = null;
1152                 
1153                 try {      // for error handling
1154                         tipo();
1155                         t_AST = (AST)returnAST;
1156                         i = LT(1);
1157                         i_AST = astFactory.create(i);
1158                         match(IDENT);
1159                         if ( inputState.guessing==0 ) {
1160                                 declaracion_parametro_AST = (AST)currentAST.root;
1161                                 declaracion_parametro_AST = crear_declaracion_parametro(i_AST,t_AST);
1162                                 currentAST.root = declaracion_parametro_AST;
1163                                 currentAST.child = declaracion_parametro_AST!=null &&declaracion_parametro_AST.getFirstChild()!=null ?
1164                                         declaracion_parametro_AST.getFirstChild() : declaracion_parametro_AST;
1165                                 currentAST.advanceChildToEnd();
1166                         }
1167                 }
1168                 catch (RecognitionException ex) {
1169                         if (inputState.guessing==0) {
1170                                 reportError(ex);
1171                                 recover(ex,_tokenSet_13);
1172                         } else {
1173                           throw ex;
1174                         }
1175                 }
1176                 returnAST = declaracion_parametro_AST;
1177         }
1178         
1179         public final void declaraciones_variables_locales() throws RecognitionException, TokenStreamException {
1180                 
1181                 returnAST = null;
1182                 ASTPair currentAST = new ASTPair();
1183                 AST declaraciones_variables_locales_AST = null;
1184                 
1185                 try {      // for error handling
1186                         boolean synPredMatched10113 = false;
1187                         if (((_tokenSet_9.member(LA(1))))) {
1188                                 int _m10113 = mark();
1189                                 synPredMatched10113 = true;
1190                                 inputState.guessing++;
1191                                 try {
1192                                         {
1193                                         declaracion_variables_locales();
1194                                         tipo();
1195                                         match(IDENT);
1196                                         }
1197                                 }
1198                                 catch (RecognitionException pe) {
1199                                         synPredMatched10113 = false;
1200                                 }
1201                                 rewind(_m10113);
1202 inputState.guessing--;
1203                         }
1204                         if ( synPredMatched10113 ) {
1205                                 declaracion_variables_locales();
1206                                 astFactory.addASTChild(currentAST, returnAST);
1207                                 declaraciones_variables_locales();
1208                                 astFactory.addASTChild(currentAST, returnAST);
1209                                 declaraciones_variables_locales_AST = (AST)currentAST.root;
1210                         }
1211                         else {
1212                                 boolean synPredMatched10115 = false;
1213                                 if (((_tokenSet_9.member(LA(1))))) {
1214                                         int _m10115 = mark();
1215                                         synPredMatched10115 = true;
1216                                         inputState.guessing++;
1217                                         try {
1218                                                 {
1219                                                 declaracion_variables_locales();
1220                                                 }
1221                                         }
1222                                         catch (RecognitionException pe) {
1223                                                 synPredMatched10115 = false;
1224                                         }
1225                                         rewind(_m10115);
1226 inputState.guessing--;
1227                                 }
1228                                 if ( synPredMatched10115 ) {
1229                                         declaracion_variables_locales();
1230                                         astFactory.addASTChild(currentAST, returnAST);
1231                                         declaraciones_variables_locales_AST = (AST)currentAST.root;
1232                                 }
1233                                 else if ((_tokenSet_14.member(LA(1)))) {
1234                                         declaraciones_variables_locales_AST = (AST)currentAST.root;
1235                                 }
1236                                 else {
1237                                         throw new NoViableAltException(LT(1), getFilename());
1238                                 }
1239                                 }
1240                         }
1241                         catch (RecognitionException ex) {
1242                                 if (inputState.guessing==0) {
1243                                         reportError(ex);
1244                                         recover(ex,_tokenSet_14);
1245                                 } else {
1246                                   throw ex;
1247                                 }
1248                         }
1249                         returnAST = declaraciones_variables_locales_AST;
1250                 }
1251                 
1252         public final void bloque() throws RecognitionException, TokenStreamException {
1253                 
1254                 returnAST = null;
1255                 ASTPair currentAST = new ASTPair();
1256                 AST bloque_AST = null;
1257                 AST i_AST = null;
1258                 
1259                 try {      // for error handling
1260                         instrucciones();
1261                         i_AST = (AST)returnAST;
1262                         if ( inputState.guessing==0 ) {
1263                                 bloque_AST = (AST)currentAST.root;
1264                                 bloque_AST=(AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(INSTRUCCIONES,"instrucciones")).add(i_AST));
1265                                 currentAST.root = bloque_AST;
1266                                 currentAST.child = bloque_AST!=null &&bloque_AST.getFirstChild()!=null ?
1267                                         bloque_AST.getFirstChild() : bloque_AST;
1268                                 currentAST.advanceChildToEnd();
1269                         }
1270                 }
1271                 catch (RecognitionException ex) {
1272                         if (inputState.guessing==0) {
1273                                 reportError(ex);
1274                                 recover(ex,_tokenSet_15);
1275                         } else {
1276                           throw ex;
1277                         }
1278                 }
1279                 returnAST = bloque_AST;
1280         }
1281         
1282         public final void declaracion_variables_locales() throws RecognitionException, TokenStreamException {
1283                 
1284                 returnAST = null;
1285                 ASTPair currentAST = new ASTPair();
1286                 AST declaracion_variables_locales_AST = null;
1287                 AST t_AST = null;
1288                 
1289                 try {      // for error handling
1290                         tipo();
1291                         t_AST = (AST)returnAST;
1292                         lista_nombres_variables_locales(t_AST);
1293                         astFactory.addASTChild(currentAST, returnAST);
1294                         match(PUNTO_Y_COMA);
1295                         declaracion_variables_locales_AST = (AST)currentAST.root;
1296                 }
1297                 catch (RecognitionException ex) {
1298                         if (inputState.guessing==0) {
1299                                 reportError(ex);
1300                                 recover(ex,_tokenSet_16);
1301                         } else {
1302                           throw ex;
1303                         }
1304                 }
1305                 returnAST = declaracion_variables_locales_AST;
1306         }
1307         
1308         public final void lista_nombres_variables_locales(
1309                 AST t
1310         ) throws RecognitionException, TokenStreamException {
1311                 
1312                 returnAST = null;
1313                 ASTPair currentAST = new ASTPair();
1314                 AST lista_nombres_variables_locales_AST = null;
1315                 
1316                 try {      // for error handling
1317                         nombre_variable_local(t);
1318                         astFactory.addASTChild(currentAST, returnAST);
1319                         {
1320                         _loop10119:
1321                         do {
1322                                 if ((LA(1)==COMA)) {
1323                                         match(COMA);
1324                                         nombre_variable_local(t);
1325                                         astFactory.addASTChild(currentAST, returnAST);
1326                                 }
1327                                 else {
1328                                         break _loop10119;
1329                                 }
1330                                 
1331                         } while (true);
1332                         }
1333                         lista_nombres_variables_locales_AST = (AST)currentAST.root;
1334                 }
1335                 catch (RecognitionException ex) {
1336                         if (inputState.guessing==0) {
1337                                 reportError(ex);
1338                                 recover(ex,_tokenSet_17);
1339                         } else {
1340                           throw ex;
1341                         }
1342                 }
1343                 returnAST = lista_nombres_variables_locales_AST;
1344         }
1345         
1346         public final void nombre_variable_local(
1347                 AST t
1348         ) throws RecognitionException, TokenStreamException {
1349                 
1350                 returnAST = null;
1351                 ASTPair currentAST = new ASTPair();
1352                 AST nombre_variable_local_AST = null;
1353                 Token  i = null;
1354                 AST i_AST = null;
1355                 
1356                 try {      // for error handling
1357                         i = LT(1);
1358                         i_AST = astFactory.create(i);
1359                         match(IDENT);
1360                         if ( inputState.guessing==0 ) {
1361                                 nombre_variable_local_AST = (AST)currentAST.root;
1362                                 nombre_variable_local_AST = crear_declaracion_variable_local(i_AST,t);
1363                                 currentAST.root = nombre_variable_local_AST;
1364                                 currentAST.child = nombre_variable_local_AST!=null &&nombre_variable_local_AST.getFirstChild()!=null ?
1365                                         nombre_variable_local_AST.getFirstChild() : nombre_variable_local_AST;
1366                                 currentAST.advanceChildToEnd();
1367                         }
1368                 }
1369                 catch (RecognitionException ex) {
1370                         if (inputState.guessing==0) {
1371                                 reportError(ex);
1372                                 recover(ex,_tokenSet_18);
1373                         } else {
1374                           throw ex;
1375                         }
1376                 }
1377                 returnAST = nombre_variable_local_AST;
1378         }
1379         
1380         public final void instrucciones() throws RecognitionException, TokenStreamException {
1381                 
1382                 returnAST = null;
1383                 ASTPair currentAST = new ASTPair();
1384                 AST instrucciones_AST = null;
1385                 
1386                 try {      // for error handling
1387                         {
1388                         _loop10123:
1389                         do {
1390                                 if ((_tokenSet_19.member(LA(1)))) {
1391                                         instruccion();
1392                                         astFactory.addASTChild(currentAST, returnAST);
1393                                 }
1394                                 else {
1395                                         break _loop10123;
1396                                 }
1397                                 
1398                         } while (true);
1399                         }
1400                         instrucciones_AST = (AST)currentAST.root;
1401                 }
1402                 catch (RecognitionException ex) {
1403                         if (inputState.guessing==0) {
1404                                 reportError(ex);
1405                                 recover(ex,_tokenSet_15);
1406                         } else {
1407                           throw ex;
1408                         }
1409                 }
1410                 returnAST = instrucciones_AST;
1411         }
1412         
1413         public final void instruccion() throws RecognitionException, TokenStreamException {
1414                 
1415                 returnAST = null;
1416                 ASTPair currentAST = new ASTPair();
1417                 AST instruccion_AST = null;
1418                 AST i_AST = null;
1419                 AST j_AST = null;
1420                 
1421                 try {      // for error handling
1422                         switch ( LA(1)) {
1423                         case IDENT:
1424                         case PARENTESIS_ABIERTO:
1425                         case DEV:
1426                         case NO:
1427                         case MENOS:
1428                         case LIT_ENTERO:
1429                         case LIT_REAL:
1430                         case LIT_CAR:
1431                         case CIERTO:
1432                         case FALSO:
1433                         case ESCRIBIR:
1434                         case ENTERO_A_REAL:
1435                         case REAL_A_ENTERO:
1436                         {
1437                                 instruccion_simple();
1438                                 i_AST = (AST)returnAST;
1439                                 AST tmp28_AST = null;
1440                                 tmp28_AST = astFactory.create(LT(1));
1441                                 match(PUNTO_Y_COMA);
1442                                 if ( inputState.guessing==0 ) {
1443                                         instruccion_AST = (AST)currentAST.root;
1444                                         instruccion_AST=(AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(INSTRUCCION,"instruccion")).add(i_AST));
1445                                         currentAST.root = instruccion_AST;
1446                                         currentAST.child = instruccion_AST!=null &&instruccion_AST.getFirstChild()!=null ?
1447                                                 instruccion_AST.getFirstChild() : instruccion_AST;
1448                                         currentAST.advanceChildToEnd();
1449                                 }
1450                                 break;
1451                         }
1452                         case SI:
1453                         case MIENTRAS:
1454                         {
1455                                 instruccion_compuesta();
1456                                 j_AST = (AST)returnAST;
1457                                 if ( inputState.guessing==0 ) {
1458                                         instruccion_AST = (AST)currentAST.root;
1459                                         instruccion_AST=(AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(INSTRUCCION,"instruccion")).add(j_AST));
1460                                         currentAST.root = instruccion_AST;
1461                                         currentAST.child = instruccion_AST!=null &&instruccion_AST.getFirstChild()!=null ?
1462                                                 instruccion_AST.getFirstChild() : instruccion_AST;
1463                                         currentAST.advanceChildToEnd();
1464                                 }
1465                                 break;
1466                         }
1467                         default:
1468                         {
1469                                 throw new NoViableAltException(LT(1), getFilename());
1470                         }
1471                         }
1472                 }
1473                 catch (RecognitionException ex) {
1474                         if (inputState.guessing==0) {
1475                                 reportError(ex);
1476                                 recover(ex,_tokenSet_20);
1477                         } else {
1478                           throw ex;
1479                         }
1480                 }
1481                 returnAST = instruccion_AST;
1482         }
1483         
1484         public final void instruccion_simple() throws RecognitionException, TokenStreamException {
1485                 
1486                 returnAST = null;
1487                 ASTPair currentAST = new ASTPair();
1488                 AST instruccion_simple_AST = null;
1489                 
1490                 try {      // for error handling
1491                         switch ( LA(1)) {
1492                         case ESCRIBIR:
1493                         {
1494                                 escribir();
1495                                 astFactory.addASTChild(currentAST, returnAST);
1496                                 instruccion_simple_AST = (AST)currentAST.root;
1497                                 break;
1498                         }
1499                         case DEV:
1500                         {
1501                                 retorno();
1502                                 astFactory.addASTChild(currentAST, returnAST);
1503                                 instruccion_simple_AST = (AST)currentAST.root;
1504                                 break;
1505                         }
1506                         default:
1507                                 boolean synPredMatched10127 = false;
1508                                 if (((_tokenSet_21.member(LA(1))))) {
1509                                         int _m10127 = mark();
1510                                         synPredMatched10127 = true;
1511                                         inputState.guessing++;
1512                                         try {
1513                                                 {
1514                                                 expresion();
1515                                                 match(ASIGNACION);
1516                                                 match(CREAR);
1517                                                 }
1518                                         }
1519                                         catch (RecognitionException pe) {
1520                                                 synPredMatched10127 = false;
1521                                         }
1522                                         rewind(_m10127);
1523 inputState.guessing--;
1524                                 }
1525                                 if ( synPredMatched10127 ) {
1526                                         crear();
1527                                         astFactory.addASTChild(currentAST, returnAST);
1528                                         instruccion_simple_AST = (AST)currentAST.root;
1529                                 }
1530                                 else {
1531                                         boolean synPredMatched10129 = false;
1532                                         if (((_tokenSet_21.member(LA(1))))) {
1533                                                 int _m10129 = mark();
1534                                                 synPredMatched10129 = true;
1535                                                 inputState.guessing++;
1536                                                 try {
1537                                                         {
1538                                                         expresion();
1539                                                         match(ASIGNACION);
1540                                                         }
1541                                                 }
1542                                                 catch (RecognitionException pe) {
1543                                                         synPredMatched10129 = false;
1544                                                 }
1545                                                 rewind(_m10129);
1546 inputState.guessing--;
1547                                         }
1548                                         if ( synPredMatched10129 ) {
1549                                                 asignacion();
1550                                                 astFactory.addASTChild(currentAST, returnAST);
1551                                                 instruccion_simple_AST = (AST)currentAST.root;
1552                                         }
1553                                         else if ((LA(1)==IDENT)) {
1554                                                 llamada_metodo();
1555                                                 astFactory.addASTChild(currentAST, returnAST);
1556                                                 instruccion_simple_AST = (AST)currentAST.root;
1557                                         }
1558                                 else {
1559                                         throw new NoViableAltException(LT(1), getFilename());
1560                                 }
1561                                 }}
1562                         }
1563                         catch (RecognitionException ex) {
1564                                 if (inputState.guessing==0) {
1565                                         reportError(ex);
1566                                         recover(ex,_tokenSet_17);
1567                                 } else {
1568                                   throw ex;
1569                                 }
1570                         }
1571                         returnAST = instruccion_simple_AST;
1572                 }
1573                 
1574         public final void instruccion_compuesta() throws RecognitionException, TokenStreamException {
1575                 
1576                 returnAST = null;
1577                 ASTPair currentAST = new ASTPair();
1578                 AST instruccion_compuesta_AST = null;
1579                 
1580                 try {      // for error handling
1581                         switch ( LA(1)) {
1582                         case SI:
1583                         {
1584                                 condicion();
1585                                 astFactory.addASTChild(currentAST, returnAST);
1586                                 instruccion_compuesta_AST = (AST)currentAST.root;
1587                                 break;
1588                         }
1589                         case MIENTRAS:
1590                         {
1591                                 iteracion();
1592                                 astFactory.addASTChild(currentAST, returnAST);
1593                                 instruccion_compuesta_AST = (AST)currentAST.root;
1594                                 break;
1595                         }
1596                         default:
1597                         {
1598                                 throw new NoViableAltException(LT(1), getFilename());
1599                         }
1600                         }
1601                 }
1602                 catch (RecognitionException ex) {
1603                         if (inputState.guessing==0) {
1604                                 reportError(ex);
1605                                 recover(ex,_tokenSet_20);
1606                         } else {
1607                           throw ex;
1608                         }
1609                 }
1610                 returnAST = instruccion_compuesta_AST;
1611         }
1612         
1613         public final void expresion() throws RecognitionException, TokenStreamException {
1614                 
1615                 returnAST = null;
1616                 ASTPair currentAST = new ASTPair();
1617                 AST expresion_AST = null;
1618                 
1619                 try {      // for error handling
1620                         expresion_nivel_1();
1621                         astFactory.addASTChild(currentAST, returnAST);
1622                         {
1623                         _loop10143:
1624                         do {
1625                                 if ((LA(1)==O)) {
1626                                         AST tmp29_AST = null;
1627                                         tmp29_AST = astFactory.create(LT(1));
1628                                         astFactory.makeASTRoot(currentAST, tmp29_AST);
1629                                         match(O);
1630                                         expresion_nivel_1();
1631                                         astFactory.addASTChild(currentAST, returnAST);
1632                                 }
1633                                 else {
1634                                         break _loop10143;
1635                                 }
1636                                 
1637                         } while (true);
1638                         }
1639                         expresion_AST = (AST)currentAST.root;
1640                 }
1641                 catch (RecognitionException ex) {
1642                         if (inputState.guessing==0) {
1643                                 reportError(ex);
1644                                 recover(ex,_tokenSet_22);
1645                         } else {
1646                           throw ex;
1647                         }
1648                 }
1649                 returnAST = expresion_AST;
1650         }
1651         
1652         public final void crear() throws RecognitionException, TokenStreamException {
1653                 
1654                 returnAST = null;
1655                 ASTPair currentAST = new ASTPair();
1656                 AST crear_AST = null;
1657                 AST e1_AST = null;
1658                 AST i_AST = null;
1659                 
1660                 try {      // for error handling
1661                         expresion();
1662                         e1_AST = (AST)returnAST;
1663                         AST tmp30_AST = null;
1664                         tmp30_AST = astFactory.create(LT(1));
1665                         match(ASIGNACION);
1666                         AST tmp31_AST = null;
1667                         tmp31_AST = astFactory.create(LT(1));
1668                         match(CREAR);
1669                         AST tmp32_AST = null;
1670                         tmp32_AST = astFactory.create(LT(1));
1671                         match(PARENTESIS_ABIERTO);
1672                         expresion();
1673                         i_AST = (AST)returnAST;
1674                         AST tmp33_AST = null;
1675                         tmp33_AST = astFactory.create(LT(1));
1676                         match(PARENTESIS_CERRADO);
1677                         if ( inputState.guessing==0 ) {
1678                                 crear_AST = (AST)currentAST.root;
1679                                 
1680                                         crear_AST = arbol_crear(e1_AST,i_AST);
1681                                         try{
1682                                                 log.write("IDENTIFICADOR TIPO: "+i_AST.getFirstChild().getNextSibling().getFirstChild().getText()+"\n");
1683                                         }catch(NullPointerException n){}
1684                                 
1685                                 
1686                                 currentAST.root = crear_AST;
1687                                 currentAST.child = crear_AST!=null &&crear_AST.getFirstChild()!=null ?
1688                                         crear_AST.getFirstChild() : crear_AST;
1689                                 currentAST.advanceChildToEnd();
1690                         }
1691                 }
1692                 catch (RecognitionException ex) {
1693                         if (inputState.guessing==0) {
1694                                 reportError(ex);
1695                                 recover(ex,_tokenSet_17);
1696                         } else {
1697                           throw ex;
1698                         }
1699                 }
1700                 returnAST = crear_AST;
1701         }
1702         
1703         public final void asignacion() throws RecognitionException, TokenStreamException {
1704                 
1705                 returnAST = null;
1706                 ASTPair currentAST = new ASTPair();
1707                 AST asignacion_AST = null;
1708                 AST e1_AST = null;
1709                 AST e2_AST = null;
1710                 
1711                 try {      // for error handling
1712                         expresion();
1713                         e1_AST = (AST)returnAST;
1714                         AST tmp34_AST = null;
1715                         tmp34_AST = astFactory.create(LT(1));
1716                         match(ASIGNACION);
1717                         expresion();
1718                         e2_AST = (AST)returnAST;
1719                         if ( inputState.guessing==0 ) {
1720                                 asignacion_AST = (AST)currentAST.root;
1721                                 asignacion_AST = (AST)astFactory.make( (new ASTArray(3)).add(astFactory.create(tmp34_AST)).add(e1_AST).add(e2_AST));
1722                                 currentAST.root = asignacion_AST;
1723                                 currentAST.child = asignacion_AST!=null &&asignacion_AST.getFirstChild()!=null ?
1724                                         asignacion_AST.getFirstChild() : asignacion_AST;
1725                                 currentAST.advanceChildToEnd();
1726                         }
1727                 }
1728                 catch (RecognitionException ex) {
1729                         if (inputState.guessing==0) {
1730                                 reportError(ex);
1731                                 recover(ex,_tokenSet_17);
1732                         } else {
1733                           throw ex;
1734                         }
1735                 }
1736                 returnAST = asignacion_AST;
1737         }
1738         
1739         public final void llamada_metodo() throws RecognitionException, TokenStreamException {
1740                 
1741                 returnAST = null;
1742                 ASTPair currentAST = new ASTPair();
1743                 AST llamada_metodo_AST = null;
1744                 AST i_AST = null;
1745                 AST s_AST = null;
1746                 
1747                 try {      // for error handling
1748                         acceso();
1749                         i_AST = (AST)returnAST;
1750                         AST tmp35_AST = null;
1751                         tmp35_AST = astFactory.create(LT(1));
1752                         match(PARENTESIS_ABIERTO);
1753                         lista_expresiones();
1754                         s_AST = (AST)returnAST;
1755                         AST tmp36_AST = null;
1756                         tmp36_AST = astFactory.create(LT(1));
1757                         match(PARENTESIS_CERRADO);
1758                         if ( inputState.guessing==0 ) {
1759                                 llamada_metodo_AST = (AST)currentAST.root;
1760                                 llamada_metodo_AST = (AST)astFactory.make( (new ASTArray(3)).add(astFactory.create(LLAMADA,"llamada")).add(i_AST).add((AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(EXPRESIONES,"expresiones")).add(s_AST))));
1761                                 currentAST.root = llamada_metodo_AST;
1762                                 currentAST.child = llamada_metodo_AST!=null &&llamada_metodo_AST.getFirstChild()!=null ?
1763                                         llamada_metodo_AST.getFirstChild() : llamada_metodo_AST;
1764                                 currentAST.advanceChildToEnd();
1765                         }
1766                 }
1767                 catch (RecognitionException ex) {
1768                         if (inputState.guessing==0) {
1769                                 reportError(ex);
1770                                 recover(ex,_tokenSet_23);
1771                         } else {
1772                           throw ex;
1773                         }
1774                 }
1775                 returnAST = llamada_metodo_AST;
1776         }
1777         
1778         public final void escribir() throws RecognitionException, TokenStreamException {
1779                 
1780                 returnAST = null;
1781                 ASTPair currentAST = new ASTPair();
1782                 AST escribir_AST = null;
1783                 AST e_AST = null;
1784                 
1785                 try {      // for error handling
1786                         AST tmp37_AST = null;
1787                         tmp37_AST = astFactory.create(LT(1));
1788                         match(ESCRIBIR);
1789                         AST tmp38_AST = null;
1790                         tmp38_AST = astFactory.create(LT(1));
1791                         match(PARENTESIS_ABIERTO);
1792                         expresion();
1793                         e_AST = (AST)returnAST;
1794                         AST tmp39_AST = null;
1795                         tmp39_AST = astFactory.create(LT(1));
1796                         match(PARENTESIS_CERRADO);
1797                         if ( inputState.guessing==0 ) {
1798                                 escribir_AST = (AST)currentAST.root;
1799                                 
1800                                         escribir_AST = arbol_escribir(e_AST);
1801                                         try{
1802                                                 log.write("IDENTIFICADOR TIPO: "+e_AST.getFirstChild().getNextSibling().getFirstChild().getText()+"\n");
1803                                         }catch(NullPointerException n){}
1804                                 
1805                                 currentAST.root = escribir_AST;
1806                                 currentAST.child = escribir_AST!=null &&escribir_AST.getFirstChild()!=null ?
1807                                         escribir_AST.getFirstChild() : escribir_AST;
1808                                 currentAST.advanceChildToEnd();
1809                         }
1810                 }
1811                 catch (RecognitionException ex) {
1812                         if (inputState.guessing==0) {
1813                                 reportError(ex);
1814                                 recover(ex,_tokenSet_17);
1815                         } else {
1816                           throw ex;
1817                         }
1818                 }
1819                 returnAST = escribir_AST;
1820         }
1821         
1822         public final void retorno() throws RecognitionException, TokenStreamException {
1823                 
1824                 returnAST = null;
1825                 ASTPair currentAST = new ASTPair();
1826                 AST retorno_AST = null;
1827                 AST e_AST = null;
1828                 
1829                 try {      // for error handling
1830                         AST tmp40_AST = null;
1831                         tmp40_AST = astFactory.create(LT(1));
1832                         match(DEV);
1833                         expresion();
1834                         e_AST = (AST)returnAST;
1835                         if ( inputState.guessing==0 ) {
1836                                 retorno_AST = (AST)currentAST.root;
1837                                 retorno_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(tmp40_AST)).add(e_AST));
1838                                 currentAST.root = retorno_AST;
1839                                 currentAST.child = retorno_AST!=null &&retorno_AST.getFirstChild()!=null ?
1840                                         retorno_AST.getFirstChild() : retorno_AST;
1841                                 currentAST.advanceChildToEnd();
1842                         }
1843                 }
1844                 catch (RecognitionException ex) {
1845                         if (inputState.guessing==0) {
1846                                 reportError(ex);
1847                                 recover(ex,_tokenSet_17);
1848                         } else {
1849                           throw ex;
1850                         }
1851                 }
1852                 returnAST = retorno_AST;
1853         }
1854         
1855         public final void condicion() throws RecognitionException, TokenStreamException {
1856                 
1857                 returnAST = null;
1858                 ASTPair currentAST = new ASTPair();
1859                 AST condicion_AST = null;
1860                 
1861                 try {      // for error handling
1862                         AST tmp41_AST = null;
1863                         tmp41_AST = astFactory.create(LT(1));
1864                         astFactory.makeASTRoot(currentAST, tmp41_AST);
1865                         match(SI);
1866                         match(PARENTESIS_ABIERTO);
1867                         expresion();
1868                         astFactory.addASTChild(currentAST, returnAST);
1869                         match(PARENTESIS_CERRADO);
1870                         match(ENTONCES);
1871                         bloque();
1872                         astFactory.addASTChild(currentAST, returnAST);
1873                         {
1874                         switch ( LA(1)) {
1875                         case SINO:
1876                         {
1877                                 match(SINO);
1878                                 bloque();
1879                                 astFactory.addASTChild(currentAST, returnAST);
1880                                 break;
1881                         }
1882                         case FINSI:
1883                         {
1884                                 break;
1885                         }
1886                         default:
1887                         {
1888                                 throw new NoViableAltException(LT(1), getFilename());
1889                         }
1890                         }
1891                         }
1892                         match(FINSI);
1893                         condicion_AST = (AST)currentAST.root;
1894                 }
1895                 catch (RecognitionException ex) {
1896                         if (inputState.guessing==0) {
1897                                 reportError(ex);
1898                                 recover(ex,_tokenSet_20);
1899                         } else {
1900                           throw ex;
1901                         }
1902                 }
1903                 returnAST = condicion_AST;
1904         }
1905         
1906         public final void iteracion() throws RecognitionException, TokenStreamException {
1907                 
1908                 returnAST = null;
1909                 ASTPair currentAST = new ASTPair();
1910                 AST iteracion_AST = null;
1911                 
1912                 try {      // for error handling
1913                         AST tmp47_AST = null;
1914                         tmp47_AST = astFactory.create(LT(1));
1915                         astFactory.makeASTRoot(currentAST, tmp47_AST);
1916                         match(MIENTRAS);
1917                         match(PARENTESIS_ABIERTO);
1918                         expresion();
1919                         astFactory.addASTChild(currentAST, returnAST);
1920                         match(PARENTESIS_CERRADO);
1921                         match(HACER);
1922                         bloque();
1923                         astFactory.addASTChild(currentAST, returnAST);
1924                         match(FINMIENTRAS);
1925                         iteracion_AST = (AST)currentAST.root;
1926                 }
1927                 catch (RecognitionException ex) {
1928                         if (inputState.guessing==0) {
1929                                 reportError(ex);
1930                                 recover(ex,_tokenSet_20);
1931                         } else {
1932                           throw ex;
1933                         }
1934                 }
1935                 returnAST = iteracion_AST;
1936         }
1937         
1938         public final void acceso() throws RecognitionException, TokenStreamException {
1939                 
1940                 returnAST = null;
1941                 ASTPair currentAST = new ASTPair();
1942                 AST acceso_AST = null;
1943                 Token  i1 = null;
1944                 AST i1_AST = null;
1945                 Token  i2 = null;
1946                 AST i2_AST = null;
1947                 Token  i = null;
1948                 AST i_AST = null;
1949                 
1950                 try {      // for error handling
1951                         boolean synPredMatched10169 = false;
1952                         if (((LA(1)==IDENT))) {
1953                                 int _m10169 = mark();
1954                                 synPredMatched10169 = true;
1955                                 inputState.guessing++;
1956                                 try {
1957                                         {
1958                                         match(IDENT);
1959                                         match(PUNTO);
1960                                         }
1961                                 }
1962                                 catch (RecognitionException pe) {
1963                                         synPredMatched10169 = false;
1964                                 }
1965                                 rewind(_m10169);
1966 inputState.guessing--;
1967                         }
1968                         if ( synPredMatched10169 ) {
1969                                 i1 = LT(1);
1970                                 i1_AST = astFactory.create(i1);
1971                                 match(IDENT);
1972                                 AST tmp52_AST = null;
1973                                 tmp52_AST = astFactory.create(LT(1));
1974                                 match(PUNTO);
1975                                 i2 = LT(1);
1976                                 i2_AST = astFactory.create(i2);
1977                                 match(IDENT);
1978                                 if ( inputState.guessing==0 ) {
1979                                         acceso_AST = (AST)currentAST.root;
1980                                         
1981                                                 log.write("ACCESO SIMPLE: "+i1_AST.getText());
1982                                                 acceso_AST=(AST)astFactory.make( (new ASTArray(3)).add(astFactory.create(ACCESO_OBJETO,"acceso_objeto")).add(ambito_tratar_acceso_simple(i1_AST)).add(i2_AST));
1983                                         
1984                                         currentAST.root = acceso_AST;
1985                                         currentAST.child = acceso_AST!=null &&acceso_AST.getFirstChild()!=null ?
1986                                                 acceso_AST.getFirstChild() : acceso_AST;
1987                                         currentAST.advanceChildToEnd();
1988                                 }
1989                         }
1990                         else if ((LA(1)==IDENT)) {
1991                                 i = LT(1);
1992                                 i_AST = astFactory.create(i);
1993                                 match(IDENT);
1994                                 if ( inputState.guessing==0 ) {
1995                                         acceso_AST = (AST)currentAST.root;
1996                                         
1997                                         log.write("ACCESO SIMPLE: "+i_AST.getText());
1998                                                 acceso_AST = ambito_tratar_acceso_simple(i_AST);
1999                                         
2000                                         currentAST.root = acceso_AST;
2001                                         currentAST.child = acceso_AST!=null &&acceso_AST.getFirstChild()!=null ?
2002                                                 acceso_AST.getFirstChild() : acceso_AST;
2003                                         currentAST.advanceChildToEnd();
2004                                 }
2005                         }
2006                         else {
2007                                 throw new NoViableAltException(LT(1), getFilename());
2008                         }
2009                         
2010                 }
2011                 catch (RecognitionException ex) {
2012                         if (inputState.guessing==0) {
2013                                 reportError(ex);
2014                                 recover(ex,_tokenSet_24);
2015                         } else {
2016                           throw ex;
2017                         }
2018                 }
2019                 returnAST = acceso_AST;
2020         }
2021         
2022         public final void lista_expresiones() throws RecognitionException, TokenStreamException {
2023                 
2024                 returnAST = null;
2025                 ASTPair currentAST = new ASTPair();
2026                 AST lista_expresiones_AST = null;
2027                 
2028                 try {      // for error handling
2029                         switch ( LA(1)) {
2030                         case IDENT:
2031                         case PARENTESIS_ABIERTO:
2032                         case NO:
2033                         case MENOS:
2034                         case LIT_ENTERO:
2035                         case LIT_REAL:
2036                         case LIT_CAR:
2037                         case CIERTO:
2038                         case FALSO:
2039                         case ENTERO_A_REAL:
2040                         case REAL_A_ENTERO:
2041                         {
2042                                 expresion();
2043                                 astFactory.addASTChild(currentAST, returnAST);
2044                                 {
2045                                 _loop10136:
2046                                 do {
2047                                         if ((LA(1)==COMA)) {
2048                                                 match(COMA);
2049                                                 expresion();
2050                                                 astFactory.addASTChild(currentAST, returnAST);
2051                                         }
2052                                         else {
2053                                                 break _loop10136;
2054                                         }
2055                                         
2056                                 } while (true);
2057                                 }
2058                                 lista_expresiones_AST = (AST)currentAST.root;
2059                                 break;
2060                         }
2061                         case PARENTESIS_CERRADO:
2062                         {
2063                                 lista_expresiones_AST = (AST)currentAST.root;
2064                                 break;
2065                         }
2066                         default:
2067                         {
2068                                 throw new NoViableAltException(LT(1), getFilename());
2069                         }
2070                         }
2071                 }
2072                 catch (RecognitionException ex) {
2073                         if (inputState.guessing==0) {
2074                                 reportError(ex);
2075                                 recover(ex,_tokenSet_12);
2076                         } else {
2077                           throw ex;
2078                         }
2079                 }
2080                 returnAST = lista_expresiones_AST;
2081         }
2082         
2083         public final void expresion_nivel_1() throws RecognitionException, TokenStreamException {
2084                 
2085                 returnAST = null;
2086                 ASTPair currentAST = new ASTPair();
2087                 AST expresion_nivel_1_AST = null;
2088                 
2089                 try {      // for error handling
2090                         expresion_nivel_2();
2091                         astFactory.addASTChild(currentAST, returnAST);
2092                         {
2093                         _loop10146:
2094                         do {
2095                                 if ((LA(1)==Y)) {
2096                                         AST tmp54_AST = null;
2097                                         tmp54_AST = astFactory.create(LT(1));
2098                                         astFactory.makeASTRoot(currentAST, tmp54_AST);
2099                                         match(Y);
2100                                         expresion_nivel_2();
2101                                         astFactory.addASTChild(currentAST, returnAST);
2102                                 }
2103                                 else {
2104                                         break _loop10146;
2105                                 }
2106                                 
2107                         } while (true);
2108                         }
2109                         expresion_nivel_1_AST = (AST)currentAST.root;
2110                 }
2111                 catch (RecognitionException ex) {
2112                         if (inputState.guessing==0) {
2113                                 reportError(ex);
2114                                 recover(ex,_tokenSet_25);
2115                         } else {
2116                           throw ex;
2117                         }
2118                 }
2119                 returnAST = expresion_nivel_1_AST;
2120         }
2121         
2122         public final void expresion_nivel_2() throws RecognitionException, TokenStreamException {
2123                 
2124                 returnAST = null;
2125                 ASTPair currentAST = new ASTPair();
2126                 AST expresion_nivel_2_AST = null;
2127                 
2128                 try {      // for error handling
2129                         {
2130                         switch ( LA(1)) {
2131                         case NO:
2132                         {
2133                                 AST tmp55_AST = null;
2134                                 tmp55_AST = astFactory.create(LT(1));
2135                                 astFactory.makeASTRoot(currentAST, tmp55_AST);
2136                                 match(NO);
2137                                 break;
2138                         }
2139                         case IDENT:
2140                         case PARENTESIS_ABIERTO:
2141                         case MENOS:
2142                         case LIT_ENTERO:
2143                         case LIT_REAL:
2144                         case LIT_CAR:
2145                         case CIERTO:
2146                         case FALSO:
2147                         case ENTERO_A_REAL:
2148                         case REAL_A_ENTERO:
2149                         {
2150                                 break;
2151                         }
2152                         default:
2153                         {
2154                                 throw new NoViableAltException(LT(1), getFilename());
2155                         }
2156                         }
2157                         }
2158                         expresion_nivel_3();
2159                         astFactory.addASTChild(currentAST, returnAST);
2160                         expresion_nivel_2_AST = (AST)currentAST.root;
2161                 }
2162                 catch (RecognitionException ex) {
2163                         if (inputState.guessing==0) {
2164                                 reportError(ex);
2165                                 recover(ex,_tokenSet_26);
2166                         } else {
2167                           throw ex;
2168                         }
2169                 }
2170                 returnAST = expresion_nivel_2_AST;
2171         }
2172         
2173         public final void expresion_nivel_3() throws RecognitionException, TokenStreamException {
2174                 
2175                 returnAST = null;
2176                 ASTPair currentAST = new ASTPair();
2177                 AST expresion_nivel_3_AST = null;
2178                 
2179                 try {      // for error handling
2180                         expresion_nivel_4();
2181                         astFactory.addASTChild(currentAST, returnAST);
2182                         {
2183                         switch ( LA(1)) {
2184                         case MAYOR:
2185                         case MAYOR_IGUAL:
2186                         case MENOR:
2187                         case MENOR_IGUAL:
2188                         case IGUAL:
2189                         case DISTINTO:
2190                         {
2191                                 {
2192                                 switch ( LA(1)) {
2193                                 case MAYOR:
2194                                 {
2195                                         AST tmp56_AST = null;
2196                                         tmp56_AST = astFactory.create(LT(1));
2197                                         astFactory.makeASTRoot(currentAST, tmp56_AST);
2198                                         match(MAYOR);
2199                                         break;
2200                                 }
2201                                 case MAYOR_IGUAL:
2202                                 {
2203                                         AST tmp57_AST = null;
2204                                         tmp57_AST = astFactory.create(LT(1));
2205                                         astFactory.makeASTRoot(currentAST, tmp57_AST);
2206                                         match(MAYOR_IGUAL);
2207                                         break;
2208                                 }
2209                                 case MENOR:
2210                                 {
2211                                         AST tmp58_AST = null;
2212                                         tmp58_AST = astFactory.create(LT(1));
2213                                         astFactory.makeASTRoot(currentAST, tmp58_AST);
2214                                         match(MENOR);
2215                                         break;
2216                                 }
2217                                 case MENOR_IGUAL:
2218                                 {
2219                                         AST tmp59_AST = null;
2220                                         tmp59_AST = astFactory.create(LT(1));
2221                                         astFactory.makeASTRoot(currentAST, tmp59_AST);
2222                                         match(MENOR_IGUAL);
2223                                         break;
2224                                 }
2225                                 case IGUAL:
2226                                 {
2227                                         AST tmp60_AST = null;
2228                                         tmp60_AST = astFactory.create(LT(1));
2229                                         astFactory.makeASTRoot(currentAST, tmp60_AST);
2230                                         match(IGUAL);
2231                                         break;
2232                                 }
2233                                 case DISTINTO:
2234                                 {
2235                                         AST tmp61_AST = null;
2236                                         tmp61_AST = astFactory.create(LT(1));
2237                                         astFactory.makeASTRoot(currentAST, tmp61_AST);
2238                                         match(DISTINTO);
2239                                         break;
2240                                 }
2241                                 default:
2242                                 {
2243                                         throw new NoViableAltException(LT(1), getFilename());
2244                                 }
2245                                 }
2246                                 }
2247                                 expresion_nivel_4();
2248                                 astFactory.addASTChild(currentAST, returnAST);
2249                                 break;
2250                         }
2251                         case COMA:
2252                         case PUNTO_Y_COMA:
2253                         case PARENTESIS_CERRADO:
2254                         case ASIGNACION:
2255                         case O:
2256                         case Y:
2257                         case CORCHETE_CERRADO:
2258                         {
2259                                 break;
2260                         }
2261                         default:
2262                         {
2263                                 throw new NoViableAltException(LT(1), getFilename());
2264                         }
2265                         }
2266                         }
2267                         expresion_nivel_3_AST = (AST)currentAST.root;
2268                 }
2269                 catch (RecognitionException ex) {
2270                         if (inputState.guessing==0) {
2271                                 reportError(ex);
2272                                 recover(ex,_tokenSet_26);
2273                         } else {
2274                           throw ex;
2275                         }
2276                 }
2277                 returnAST = expresion_nivel_3_AST;
2278         }
2279         
2280         public final void expresion_nivel_4() throws RecognitionException, TokenStreamException {
2281                 
2282                 returnAST = null;
2283                 ASTPair currentAST = new ASTPair();
2284                 AST expresion_nivel_4_AST = null;
2285                 
2286                 try {      // for error handling
2287                         expresion_nivel_5();
2288                         astFactory.addASTChild(currentAST, returnAST);
2289                         {
2290                         _loop10155:
2291                         do {
2292                                 if ((LA(1)==MAS||LA(1)==MENOS)) {
2293                                         {
2294                                         switch ( LA(1)) {
2295                                         case MAS:
2296                                         {
2297                                                 AST tmp62_AST = null;
2298                                                 tmp62_AST = astFactory.create(LT(1));
2299                                                 astFactory.makeASTRoot(currentAST, tmp62_AST);
2300                                                 match(MAS);
2301                                                 break;
2302                                         }
2303                                         case MENOS:
2304                                         {
2305                                                 AST tmp63_AST = null;
2306                                                 tmp63_AST = astFactory.create(LT(1));
2307                                                 astFactory.makeASTRoot(currentAST, tmp63_AST);
2308                                                 match(MENOS);
2309                                                 break;
2310                                         }
2311                                         default:
2312                                         {
2313                                                 throw new NoViableAltException(LT(1), getFilename());
2314                                         }
2315                                         }
2316                                         }
2317                                         expresion_nivel_5();
2318                                         astFactory.addASTChild(currentAST, returnAST);
2319                                 }
2320                                 else {
2321                                         break _loop10155;
2322                                 }
2323                                 
2324                         } while (true);
2325                         }
2326                         expresion_nivel_4_AST = (AST)currentAST.root;
2327                 }
2328                 catch (RecognitionException ex) {
2329                         if (inputState.guessing==0) {
2330                                 reportError(ex);
2331                                 recover(ex,_tokenSet_27);
2332                         } else {
2333                           throw ex;
2334                         }
2335                 }
2336                 returnAST = expresion_nivel_4_AST;
2337         }
2338         
2339         public final void expresion_nivel_5() throws RecognitionException, TokenStreamException {
2340                 
2341                 returnAST = null;
2342                 ASTPair currentAST = new ASTPair();
2343                 AST expresion_nivel_5_AST = null;
2344                 
2345                 try {      // for error handling
2346                         expresion_nivel_6();
2347                         astFactory.addASTChild(currentAST, returnAST);
2348                         {
2349                         _loop10159:
2350                         do {
2351                                 if ((LA(1)==POR||LA(1)==DIVISION)) {
2352                                         {
2353                                         switch ( LA(1)) {
2354                                         case POR:
2355                                         {
2356                                                 AST tmp64_AST = null;
2357                                                 tmp64_AST = astFactory.create(LT(1));
2358                                                 astFactory.makeASTRoot(currentAST, tmp64_AST);
2359                                                 match(POR);
2360                                                 break;
2361                                         }
2362                                         case DIVISION:
2363                                         {
2364                                                 AST tmp65_AST = null;
2365                                                 tmp65_AST = astFactory.create(LT(1));
2366                                                 astFactory.makeASTRoot(currentAST, tmp65_AST);
2367                                                 match(DIVISION);
2368                                                 break;
2369                                         }
2370                                         default:
2371                                         {
2372                                                 throw new NoViableAltException(LT(1), getFilename());
2373                                         }
2374                                         }
2375                                         }
2376                                         expresion_nivel_6();
2377                                         astFactory.addASTChild(currentAST, returnAST);
2378                                 }
2379                                 else {
2380                                         break _loop10159;
2381                                 }
2382                                 
2383                         } while (true);
2384                         }
2385                         expresion_nivel_5_AST = (AST)currentAST.root;
2386                 }
2387                 catch (RecognitionException ex) {
2388                         if (inputState.guessing==0) {
2389                                 reportError(ex);
2390                                 recover(ex,_tokenSet_28);
2391                         } else {
2392                           throw ex;
2393                         }
2394                 }
2395                 returnAST = expresion_nivel_5_AST;
2396         }
2397         
2398         public final void expresion_nivel_6() throws RecognitionException, TokenStreamException {
2399                 
2400                 returnAST = null;
2401                 ASTPair currentAST = new ASTPair();
2402                 AST expresion_nivel_6_AST = null;
2403                 AST i_AST = null;
2404                 
2405                 try {      // for error handling
2406                         switch ( LA(1)) {
2407                         case MENOS:
2408                         {
2409                                 AST tmp66_AST = null;
2410                                 tmp66_AST = astFactory.create(LT(1));
2411                                 astFactory.addASTChild(currentAST, tmp66_AST);
2412                                 match(MENOS);
2413                                 expresion_nivel_7();
2414                                 i_AST = (AST)returnAST;
2415                                 astFactory.addASTChild(currentAST, returnAST);
2416                                 if ( inputState.guessing==0 ) {
2417                                         expresion_nivel_6_AST = (AST)currentAST.root;
2418                                         expresion_nivel_6_AST=(AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(MENOSUNARIO,"menosunario")).add(i_AST));
2419                                         currentAST.root = expresion_nivel_6_AST;
2420                                         currentAST.child = expresion_nivel_6_AST!=null &&expresion_nivel_6_AST.getFirstChild()!=null ?
2421                                                 expresion_nivel_6_AST.getFirstChild() : expresion_nivel_6_AST;
2422                                         currentAST.advanceChildToEnd();
2423                                 }
2424                                 expresion_nivel_6_AST = (AST)currentAST.root;
2425                                 break;
2426                         }
2427                         case IDENT:
2428                         case PARENTESIS_ABIERTO:
2429                         case LIT_ENTERO:
2430                         case LIT_REAL:
2431                         case LIT_CAR:
2432                         case CIERTO:
2433                         case FALSO:
2434                         case ENTERO_A_REAL:
2435                         case REAL_A_ENTERO:
2436                         {
2437                                 expresion_nivel_7();
2438                                 astFactory.addASTChild(currentAST, returnAST);
2439                                 expresion_nivel_6_AST = (AST)currentAST.root;
2440                                 break;
2441                         }
2442                         default:
2443                         {
2444                                 throw new NoViableAltException(LT(1), getFilename());
2445                         }
2446                         }
2447                 }
2448                 catch (RecognitionException ex) {
2449                         if (inputState.guessing==0) {
2450                                 reportError(ex);
2451                                 recover(ex,_tokenSet_23);
2452                         } else {
2453                           throw ex;
2454                         }
2455                 }
2456                 returnAST = expresion_nivel_6_AST;
2457         }
2458         
2459         public final void expresion_nivel_7() throws RecognitionException, TokenStreamException {
2460                 
2461                 returnAST = null;
2462                 ASTPair currentAST = new ASTPair();
2463                 AST expresion_nivel_7_AST = null;
2464                 
2465                 try {      // for error handling
2466                         switch ( LA(1)) {
2467                         case PARENTESIS_ABIERTO:
2468                         {
2469                                 match(PARENTESIS_ABIERTO);
2470                                 expresion();
2471                                 astFactory.addASTChild(currentAST, returnAST);
2472                                 match(PARENTESIS_CERRADO);
2473                                 expresion_nivel_7_AST = (AST)currentAST.root;
2474                                 break;
2475                         }
2476                         case ENTERO_A_REAL:
2477                         {
2478                                 entero_a_real();
2479                                 astFactory.addASTChild(currentAST, returnAST);
2480                                 expresion_nivel_7_AST = (AST)currentAST.root;
2481                                 break;
2482                         }
2483                         case REAL_A_ENTERO:
2484                         {
2485                                 real_a_entero();
2486                                 astFactory.addASTChild(currentAST, returnAST);
2487                                 expresion_nivel_7_AST = (AST)currentAST.root;
2488                                 break;
2489                         }
2490                         case LIT_ENTERO:
2491                         {
2492                                 AST tmp69_AST = null;
2493                                 tmp69_AST = astFactory.create(LT(1));
2494                                 astFactory.addASTChild(currentAST, tmp69_AST);
2495                                 match(LIT_ENTERO);
2496                                 expresion_nivel_7_AST = (AST)currentAST.root;
2497                                 break;
2498                         }
2499                         case LIT_REAL:
2500                         {
2501                                 AST tmp70_AST = null;
2502                                 tmp70_AST = astFactory.create(LT(1));
2503                                 astFactory.addASTChild(currentAST, tmp70_AST);
2504                                 match(LIT_REAL);
2505                                 expresion_nivel_7_AST = (AST)currentAST.root;
2506                                 break;
2507                         }
2508                         case LIT_CAR:
2509                         {
2510                                 AST tmp71_AST = null;
2511                                 tmp71_AST = astFactory.create(LT(1));
2512                                 astFactory.addASTChild(currentAST, tmp71_AST);
2513                                 match(LIT_CAR);
2514                                 expresion_nivel_7_AST = (AST)currentAST.root;
2515                                 break;
2516                         }
2517                         case CIERTO:
2518                         {
2519                                 AST tmp72_AST = null;
2520                                 tmp72_AST = astFactory.create(LT(1));
2521                                 astFactory.addASTChild(currentAST, tmp72_AST);
2522                                 match(CIERTO);
2523                                 expresion_nivel_7_AST = (AST)currentAST.root;
2524                                 break;
2525                         }
2526                         case FALSO:
2527                         {
2528                                 AST tmp73_AST = null;
2529                                 tmp73_AST = astFactory.create(LT(1));
2530                                 astFactory.addASTChild(currentAST, tmp73_AST);
2531                                 match(FALSO);
2532                                 expresion_nivel_7_AST = (AST)currentAST.root;
2533                                 break;
2534                         }
2535                         default:
2536                                 boolean synPredMatched10163 = false;
2537                                 if (((LA(1)==IDENT))) {
2538                                         int _m10163 = mark();
2539                                         synPredMatched10163 = true;
2540                                         inputState.guessing++;
2541                                         try {
2542                                                 {
2543                                                 acceso();
2544                                                 match(PARENTESIS_ABIERTO);
2545                                                 }
2546                                         }
2547                                         catch (RecognitionException pe) {
2548                                                 synPredMatched10163 = false;
2549                                         }
2550                                         rewind(_m10163);
2551 inputState.guessing--;
2552                                 }
2553                                 if ( synPredMatched10163 ) {
2554                                         llamada_metodo();
2555                                         astFactory.addASTChild(currentAST, returnAST);
2556                                         expresion_nivel_7_AST = (AST)currentAST.root;
2557                                 }
2558                                 else {
2559                                         boolean synPredMatched10165 = false;
2560                                         if (((LA(1)==IDENT))) {
2561                                                 int _m10165 = mark();
2562                                                 synPredMatched10165 = true;
2563                                                 inputState.guessing++;
2564                                                 try {
2565                                                         {
2566                                                         acceso();
2567                                                         match(CORCHETE_ABIERTO);
2568                                                         }
2569                                                 }
2570                                                 catch (RecognitionException pe) {
2571                                                         synPredMatched10165 = false;
2572                                                 }
2573                                                 rewind(_m10165);
2574 inputState.guessing--;
2575                                         }
2576                                         if ( synPredMatched10165 ) {
2577                                                 acceso_tabla();
2578                                                 astFactory.addASTChild(currentAST, returnAST);
2579                                                 expresion_nivel_7_AST = (AST)currentAST.root;
2580                                         }
2581                                         else if ((LA(1)==IDENT)) {
2582                                                 acceso();
2583                                                 astFactory.addASTChild(currentAST, returnAST);
2584                                                 expresion_nivel_7_AST = (AST)currentAST.root;
2585                                         }
2586                                 else {
2587                                         throw new NoViableAltException(LT(1), getFilename());
2588                                 }
2589                                 }}
2590                         }
2591                         catch (RecognitionException ex) {
2592                                 if (inputState.guessing==0) {
2593                                         reportError(ex);
2594                                         recover(ex,_tokenSet_23);
2595                                 } else {
2596                                   throw ex;
2597                                 }
2598                         }
2599                         returnAST = expresion_nivel_7_AST;
2600                 }
2601                 
2602         public final void entero_a_real() throws RecognitionException, TokenStreamException {
2603                 
2604                 returnAST = null;
2605                 ASTPair currentAST = new ASTPair();
2606                 AST entero_a_real_AST = null;
2607                 AST e1_AST = null;
2608                 
2609                 try {      // for error handling
2610                         AST tmp74_AST = null;
2611                         tmp74_AST = astFactory.create(LT(1));
2612                         match(ENTERO_A_REAL);
2613                         AST tmp75_AST = null;
2614                         tmp75_AST = astFactory.create(LT(1));
2615                         match(PARENTESIS_ABIERTO);
2616                         expresion();
2617                         e1_AST = (AST)returnAST;
2618                         AST tmp76_AST = null;
2619                         tmp76_AST = astFactory.create(LT(1));
2620                         match(PARENTESIS_CERRADO);
2621                         if ( inputState.guessing==0 ) {
2622                                 entero_a_real_AST = (AST)currentAST.root;
2623                                 entero_a_real_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(tmp74_AST)).add(e1_AST));
2624                                 currentAST.root = entero_a_real_AST;
2625                                 currentAST.child = entero_a_real_AST!=null &&entero_a_real_AST.getFirstChild()!=null ?
2626                                         entero_a_real_AST.getFirstChild() : entero_a_real_AST;
2627                                 currentAST.advanceChildToEnd();
2628                         }
2629                 }
2630                 catch (RecognitionException ex) {
2631                         if (inputState.guessing==0) {
2632                                 reportError(ex);
2633                                 recover(ex,_tokenSet_23);
2634                         } else {
2635                           throw ex;
2636                         }
2637                 }
2638                 returnAST = entero_a_real_AST;
2639         }
2640         
2641         public final void real_a_entero() throws RecognitionException, TokenStreamException {
2642                 
2643                 returnAST = null;
2644                 ASTPair currentAST = new ASTPair();
2645                 AST real_a_entero_AST = null;
2646                 AST e1_AST = null;
2647                 
2648                 try {      // for error handling
2649                         AST tmp77_AST = null;
2650                         tmp77_AST = astFactory.create(LT(1));
2651                         match(REAL_A_ENTERO);
2652                         AST tmp78_AST = null;
2653                         tmp78_AST = astFactory.create(LT(1));
2654                         match(PARENTESIS_ABIERTO);
2655                         expresion();
2656                         e1_AST = (AST)returnAST;
2657                         AST tmp79_AST = null;
2658                         tmp79_AST = astFactory.create(LT(1));
2659                         match(PARENTESIS_CERRADO);
2660                         if ( inputState.guessing==0 ) {
2661                                 real_a_entero_AST = (AST)currentAST.root;
2662                                 real_a_entero_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(tmp77_AST)).add(e1_AST));
2663                                 currentAST.root = real_a_entero_AST;
2664                                 currentAST.child = real_a_entero_AST!=null &&real_a_entero_AST.getFirstChild()!=null ?
2665                                         real_a_entero_AST.getFirstChild() : real_a_entero_AST;
2666                                 currentAST.advanceChildToEnd();
2667                         }
2668                 }
2669                 catch (RecognitionException ex) {
2670                         if (inputState.guessing==0) {
2671                                 reportError(ex);
2672                                 recover(ex,_tokenSet_23);
2673                         } else {
2674                           throw ex;
2675                         }
2676                 }
2677                 returnAST = real_a_entero_AST;
2678         }
2679         
2680         public final void acceso_tabla() throws RecognitionException, TokenStreamException {
2681                 
2682                 returnAST = null;
2683                 ASTPair currentAST = new ASTPair();
2684                 AST acceso_tabla_AST = null;
2685                 AST c_AST = null;
2686                 AST d_AST = null;
2687                 
2688                 try {      // for error handling
2689                         acceso();
2690                         c_AST = (AST)returnAST;
2691                         AST tmp80_AST = null;
2692                         tmp80_AST = astFactory.create(LT(1));
2693                         match(CORCHETE_ABIERTO);
2694                         lista_expresiones_nv();
2695                         d_AST = (AST)returnAST;
2696                         AST tmp81_AST = null;
2697                         tmp81_AST = astFactory.create(LT(1));
2698                         match(CORCHETE_CERRADO);
2699                         if ( inputState.guessing==0 ) {
2700                                 acceso_tabla_AST = (AST)currentAST.root;
2701                                 acceso_tabla_AST=(AST)astFactory.make( (new ASTArray(3)).add(astFactory.create(ACCESO_TABLA,"acceso_tabla")).add(c_AST).add((AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(EXPRESIONES,"expresiones")).add(d_AST))));
2702                                 currentAST.root = acceso_tabla_AST;
2703                                 currentAST.child = acceso_tabla_AST!=null &&acceso_tabla_AST.getFirstChild()!=null ?
2704                                         acceso_tabla_AST.getFirstChild() : acceso_tabla_AST;
2705                                 currentAST.advanceChildToEnd();
2706                         }
2707                 }
2708                 catch (RecognitionException ex) {
2709                         if (inputState.guessing==0) {
2710                                 reportError(ex);
2711                                 recover(ex,_tokenSet_23);
2712                         } else {
2713                           throw ex;
2714                         }
2715                 }
2716                 returnAST = acceso_tabla_AST;
2717         }
2718         
2719         public final void lista_expresiones_nv() throws RecognitionException, TokenStreamException {
2720                 
2721                 returnAST = null;
2722                 ASTPair currentAST = new ASTPair();
2723                 AST lista_expresiones_nv_AST = null;
2724                 
2725                 try {      // for error handling
2726                         expresion();
2727                         astFactory.addASTChild(currentAST, returnAST);
2728                         {
2729                         _loop10172:
2730                         do {
2731                                 if ((LA(1)==COMA)) {
2732                                         match(COMA);
2733                                         expresion();
2734                                         astFactory.addASTChild(currentAST, returnAST);
2735                                 }
2736                                 else {
2737                                         break _loop10172;
2738                                 }
2739                                 
2740                         } while (true);
2741                         }
2742                         lista_expresiones_nv_AST = (AST)currentAST.root;
2743                 }
2744                 catch (RecognitionException ex) {
2745                         if (inputState.guessing==0) {
2746                                 reportError(ex);
2747                                 recover(ex,_tokenSet_29);
2748                         } else {
2749                           throw ex;
2750                         }
2751                 }
2752                 returnAST = lista_expresiones_nv_AST;
2753         }
2754         
2755         public final void tipo_predefinido_simple() throws RecognitionException, TokenStreamException {
2756                 
2757                 returnAST = null;
2758                 ASTPair currentAST = new ASTPair();
2759                 AST tipo_predefinido_simple_AST = null;
2760                 
2761                 try {      // for error handling
2762                         switch ( LA(1)) {
2763                         case ENTERO:
2764                         {
2765                                 AST tmp83_AST = null;
2766                                 tmp83_AST = astFactory.create(LT(1));
2767                                 astFactory.addASTChild(currentAST, tmp83_AST);
2768                                 match(ENTERO);
2769                                 tipo_predefinido_simple_AST = (AST)currentAST.root;
2770                                 break;
2771                         }
2772                         case REAL:
2773                         {
2774                                 AST tmp84_AST = null;
2775                                 tmp84_AST = astFactory.create(LT(1));
2776                                 astFactory.addASTChild(currentAST, tmp84_AST);
2777                                 match(REAL);
2778                                 tipo_predefinido_simple_AST = (AST)currentAST.root;
2779                                 break;
2780                         }
2781                         case LOGICO:
2782                         {
2783                                 AST tmp85_AST = null;
2784                                 tmp85_AST = astFactory.create(LT(1));
2785                                 astFactory.addASTChild(currentAST, tmp85_AST);
2786                                 match(LOGICO);
2787                                 tipo_predefinido_simple_AST = (AST)currentAST.root;
2788                                 break;
2789                         }
2790                         case CARACTER:
2791                         {
2792                                 AST tmp86_AST = null;
2793                                 tmp86_AST = astFactory.create(LT(1));
2794</