private Ref newOp() throws PageException { int start = cfml.getPos(); String name = null; cfml.removeSpace(); // first identifier name = identifier(true); Ref refName = null; if (name != null) { StringBuilder fullName = new StringBuilder(); fullName.append(name); // Loop over addional identifier while (cfml.isValidIndex()) { if (cfml.forwardIfCurrent('.')) { cfml.removeSpace(); name = identifier(true); if (name == null) throw new ExpressionException("invalid Component declaration"); cfml.removeSpace(); fullName.append('.'); fullName.append(name); } else break; } refName = new LString(fullName.toString()); } else { if (cfml.isCurrentQuoter()) refName = string(); if (refName == null) { cfml.setPos(start); return null; } } cfml.removeSpace(); if (cfml.isCurrent('(')) { FunctionLibFunction function = fld.getFunction("_createComponent"); Ref[] arguments = functionArg("_createComponent", true, function, ')'); Ref[] args = new Ref[arguments.length + 1]; for (int i = 0; i < arguments.length; i++) { args[i] = arguments[i]; } args[args.length - 1] = refName; BIFCall bif = new BIFCall(pc, function, args); cfml.removeSpace(); return bif; } throw new ExpressionException("invalid Component declaration "); }
/** * <font f>Transfomiert eine Vergleichs Operation. <br> * EBNF:<br> * <code>concatOp {("neq"|"eq"|"gte"|"gt"|"lte"|"lt"|"ct"| * "contains"|"nct"|"does not contain") spaces concatOp}; * (* "ct"=conatains und "nct"=does not contain; Existiert in CFMX nicht *)</code> * * @return CFXD Element * @throws PageException */ private Ref decsionOp() throws PageException { Ref ref = concatOp(); boolean hasChanged = false; // ct, contains if (cfml.isValidIndex()) { do { hasChanged = false; if (cfml.isCurrent('c')) { if (cfml.forwardIfCurrent("ct")) { cfml.removeSpace(); ref = new CT(ref, concatOp()); hasChanged = true; } else if (cfml.forwardIfCurrent("contains")) { cfml.removeSpace(); ref = new CT(ref, concatOp()); hasChanged = true; } } // does not contain else if (cfml.forwardIfCurrent("does", "not", "contain")) { cfml.removeSpace(); ref = new NCT(ref, concatOp()); hasChanged = true; } // equal, eq else if (cfml.isCurrent("eq") && !cfml.isCurrent("eqv")) { cfml.setPos(cfml.getPos() + 2); cfml.forwardIfCurrent("ual"); cfml.removeSpace(); ref = new EQ(ref, concatOp()); hasChanged = true; } // == else if (cfml.forwardIfCurrent("==")) { if (cfml.forwardIfCurrent('=')) { cfml.removeSpace(); ref = new EEQ(ref, concatOp()); } else { cfml.removeSpace(); ref = new EQ(ref, concatOp()); } hasChanged = true; } // != else if (cfml.forwardIfCurrent("!=")) { if (cfml.forwardIfCurrent('=')) { cfml.removeSpace(); ref = new NEEQ(ref, concatOp()); } else { cfml.removeSpace(); ref = new NEQ(ref, concatOp()); } hasChanged = true; } // <=/</<> else if (cfml.forwardIfCurrent('<')) { if (cfml.forwardIfCurrent('=')) { cfml.removeSpace(); ref = new LTE(ref, concatOp()); } else if (cfml.forwardIfCurrent('>')) { cfml.removeSpace(); ref = new NEQ(ref, concatOp()); } else { cfml.removeSpace(); ref = new LT(ref, concatOp()); } hasChanged = true; } // >/>= else if (cfml.forwardIfCurrent('>')) { if (cfml.forwardIfCurrent('=')) { cfml.removeSpace(); ref = new GTE(ref, concatOp()); } else { cfml.removeSpace(); ref = new GT(ref, concatOp()); } hasChanged = true; } // gt, gte, greater than or equal to, greater than else if (cfml.isCurrent('g')) { if (cfml.forwardIfCurrent("gt")) { if (cfml.forwardIfCurrent('e')) { cfml.removeSpace(); ref = new GTE(ref, concatOp()); } else { cfml.removeSpace(); ref = new GT(ref, concatOp()); } hasChanged = true; } else if (cfml.forwardIfCurrent("greater", "than")) { if (cfml.forwardIfCurrent("or", "equal", "to", true)) { cfml.removeSpace(); ref = new GTE(ref, concatOp()); } else { cfml.removeSpace(); ref = new GT(ref, concatOp()); } hasChanged = true; } else if (cfml.forwardIfCurrent("ge")) { cfml.removeSpace(); ref = new GTE(ref, concatOp()); hasChanged = true; } } // is, is not else if (cfml.forwardIfCurrent("is")) { if (cfml.forwardIfCurrent("not", true)) { cfml.removeSpace(); ref = new NEQ(ref, concatOp()); } else { cfml.removeSpace(); ref = new EQ(ref, concatOp()); } hasChanged = true; } // lt, lte, less than, less than or equal to else if (cfml.isCurrent('l')) { if (cfml.forwardIfCurrent("lt")) { if (cfml.forwardIfCurrent('e')) { cfml.removeSpace(); ref = new LTE(ref, concatOp()); } else { cfml.removeSpace(); ref = new LT(ref, concatOp()); } hasChanged = true; } else if (cfml.forwardIfCurrent("less", "than")) { if (cfml.forwardIfCurrent("or", "equal", "to", true)) { cfml.removeSpace(); ref = new LTE(ref, concatOp()); } else { cfml.removeSpace(); ref = new LT(ref, concatOp()); } hasChanged = true; } else if (cfml.forwardIfCurrent("le")) { cfml.removeSpace(); ref = new LTE(ref, concatOp()); hasChanged = true; } } // neq, not equal, nct else if (cfml.isCurrent('n')) { // Not Equal if (cfml.forwardIfCurrent("neq")) { cfml.removeSpace(); ref = new NEQ(ref, concatOp()); hasChanged = true; } // Not Equal (Alias) else if (cfml.forwardIfCurrent("not", "equal")) { cfml.removeSpace(); ref = new NEQ(ref, concatOp()); hasChanged = true; } // nct else if (cfml.forwardIfCurrent("nct")) { cfml.removeSpace(); ref = new NCT(ref, concatOp()); hasChanged = true; } } } while (hasChanged); } return ref; }