コード例 #1
0
ファイル: PrettyPrintAST.cs プロジェクト: jerivemo/Compilador
 Object VisitVarIdentAST(varIdentAST var, object arg)
 {
     int numaux = ((Integer)arg).intValue(); printtab(numaux); System.out.println(c.getClass().getName());  if(c.- !=null)  c.-.visit(this,new Integer(numaux+1)); else{printtab(numaux+1);  Console.WriteLine(“NULL”);} return null;
 }
コード例 #2
0
ファイル: parser.cs プロジェクト: jerivemo/Compilador
 public declAST parseVarDecl()
 {
     typeAST type = parseType();
     identListAST result= new unIdentAST(currentToken);
     accept(sym.ID);
     while (currentToken.sym == sym.COMA)
     {
         acceptIt();
         unIdentAST temp = new unIdentAST(currentToken);
         result = new varIdentAST(result, temp);
         accept(sym.ID);
     }
     accept(sym.PYCOMA);
     return new varDeclAST(type,result);
 }