Ejemplo n.º 1
0
 private void updateNames(CompilerStructure struc) {
   Vector procedureCount = new Vector();
   CompilerStructure s, proc;
   if ((struc.type == struc.PROGRAM) && (struc.head != null)) {
     s = struc;
     do {
       proc = s.head.head.head;
       int cnt = getProcedureCount(proc.value, procedureCount);
       setProcedureCount(proc.value, ++cnt, procedureCount);
       proc.value = proc.value + '~' + cnt;
       s = s.tail;
     } while (s != null);
   }
   if ((struc.type == struc.PROGRAM) && (struc.head != null)) {
     s = struc;
     do {
       proc = s.head.head.head;
       String pv = proc.value;
       if (pv.indexOf('~') > 0) pv = pv.substring(0, pv.indexOf('~'));
       proc.value += "/" + getProcedureCount(pv, procedureCount);
       s = s.tail;
     } while (s != null);
   }
 } // end of PrologCompiler.updateNames(CompilerStructure)