if (index >= length) throw new SmartFrogCompileResolutionException("reference not termianted" + fixed + "... on component " + cd.sfCompleteName());
if (index >= length) throw new SmartFrogCompileResolutionException("reference not terminated" + fixed + "... on component " + cd.sfCompleteName());
    private String processReferences(ComponentDescription cd,                                     String pString) throws SmartFrogCompileResolutionException {        int index = 0;        int length = pString.length();        char refDel = referenceDelimiter();        char theChar;        //System.out.println("processing string " + pString);        StringBuffer fixed = new StringBuffer(length);        while (index < length) {            theChar = pString.charAt(index++);            if (theChar == refDel) {                if (index >= length) throw new SmartFrogCompileResolutionException("reference not termianted" + fixed + "... on component " + cd.sfCompleteName());                theChar = pString.charAt(index++);                if (theChar == refDel) { // we don't have a reference                    fixed.append(theChar);                } else {// we have the start of a reference                    fixed.append(' ');                    Reference ref = null;                    try {//extract the reference                        StringBuffer refString = new StringBuffer();                        while (theChar != refDel) {                            refString.append(theChar);                            if (index >= length) throw new SmartFrogCompileResolutionException("reference not termianted " + fixed + "... on component " + cd.sfCompleteName());                            theChar = pString.charAt(index++);                        }                        ref = Reference.fromString(refString.toString());                        //System.out.println("ref is " + ref);                    } catch (SmartFrogResolutionException e) {                        throw new SmartFrogCompileResolutionException("unable to build reference at " + fixed.toString());                    }                    Object o = null;                    try {                        o = cd.sfResolve(ref);                        //System.out.println("found " + o);                    } catch (SmartFrogResolutionException e) {                        throw new SmartFrogCompileResolutionException("unable to resolve reference " + ref.toString() + " on component " + cd.sfCompleteName());                    }                    if (o instanceof FreeVar) {                        fixed.append(freeVariableName((FreeVar) o));                    } else {                        FreeVar fv = new FreeVar();                        String fvname = freeVariableName(fv);                        fixed.append(fvname);                        initialBindings.put(fvname, mapValueIn(o));                    }                    fixed.append(' ');                }            } else {                fixed.append(theChar);            }        }        return fixed.toString();    }