Beispiel #1
0
 public Object visitName(Name node) throws Exception {
   expr_contextType type = node.getInternalCtx();
   switch (type) {
     case AugLoad:
       System.err.println("AugLoad");
       break;
     case AugStore:
       addLine("PUSHPOINTER " + node.getInternalId());
       break;
     case Del:
       addLine("DEL " + node.getInternalId());
       break;
     case Load:
       addLine("PUSH " + node.getInternalId());
       break;
     case Param:
       System.err.println("param name");
       break;
     case Store:
       addLine("POP " + node.getInternalId());
       break;
     case UNDEFINED:
       break;
   }
   return null;
 }
Beispiel #2
0
 List<keyword> makeKeywords(List args) {
   List<keyword> keywords = new ArrayList<keyword>();
   if (args != null) {
     for (Object o : args) {
       List e = (List) o;
       Object k = e.get(0);
       Object v = e.get(1);
       checkAssign(castExpr(k));
       if (k instanceof Name) {
         Name arg = (Name) k;
         keywords.add(new keyword(arg, arg.getInternalId(), castExpr(v)));
       } else {
         errorHandler.error("keyword must be a name", (PythonTree) k);
       }
     }
   }
   return keywords;
 }
Beispiel #3
0
 public Object visitGlobal(Global node) throws Exception {
   for (Name n : node.getInternalNameNodes()) {
     addLine("FLAGGLOBAL " + n.getInternalId());
   }
   return null;
 }