public boolean evalBoolean(VTDNavHuge vn){ switch(opCode){ case FuncName.STARTS_WITH: if (argCount()!=2){ throw new IllegalArgumentException("starts-with()'s argument count is invalid"); return startsWith(vn); case FuncName.CONTAINS: if (argCount()!=2){ throw new IllegalArgumentException("contains()'s argument count is invalid"); return contains(vn); case FuncName.TRUE: if (argCount()!=0){ throw new IllegalArgumentException("true() doesn't take any argument"); case FuncName.FALSE:if (argCount()!=0){ throw new IllegalArgumentException("false() doesn't take any argument"); case FuncName.BOOLEAN: if (argCount()!=1){ throw new IllegalArgumentException("boolean() doesn't take any argument"); case FuncName.NOT: if (argCount()!=1){ throw new IllegalArgumentException("not() doesn't take any argument"); if (argCount()!=1){ throw new IllegalArgumentException("lang()'s argument count is invalid"); return lang(vn,argumentList.e.evalString(vn)); case FuncName.COMPARE:throw new com.ximpleware.extended.xpath.UnsupportedException("not yet implemented"); case FuncName.ENDS_WITH:
return concat(vn); return getLocalName(vn); return getNameSpaceURI(vn); return getName(vn); return getString(vn); case FuncName.SUBSTRING_BEFORE: return subStringBefore(vn); case FuncName.SUBSTRING_AFTER: return subStringAfter(vn); case FuncName.SUBSTRING: return subString(vn); case FuncName.TRANSLATE: return translate(vn); case FuncName.NORMALIZE_SPACE: return normalizeSpace(vn); case FuncName.UPPER_CASE:return upperCase(vn); case FuncName.LOWER_CASE:return lowerCase(vn); case FuncName.QNAME: case FuncName.LOCAL_NAME_FROM_QNAME: case FuncName.ENCODE_FOR_URI: throw new com.ximpleware.extended.xpath.UnsupportedException("not yet implemented"); default: if (isBoolean()){ if (evalBoolean(vn)== true) return "true"; else return "false"; } else {
public double evalNumber(VTDNavHuge vn){ int ac = 0; switch(opCode){ case FuncName.LAST: if (argCount()!=0 ) throw new IllegalArgumentException ("floor()'s argument count is invalid"); return contextSize; case FuncName.POSITION: if (argCount()!=0 ) throw new IllegalArgumentException ("position()'s argument count is invalid"); return position; case FuncName.COUNT: return count(vn); case FuncName.NUMBER: if (argCount()!=1) throw new IllegalArgumentException ("number()'s argument count is invalid"); return argumentList.e.evalNumber(vn); case FuncName.SUM: return sum(vn); case FuncName.FLOOR: if (argCount()!=1 ) throw new IllegalArgumentException("floor()'s argument count is invalid"); return Math.floor(argumentList.e.evalNumber(vn)); case FuncName.CEILING: if (argCount()!=1 ) throw new IllegalArgumentException("ceiling()'s argument count is invalid"); return Math.ceil(argumentList.e.evalNumber(vn)); ac = argCount(); if (ac == 0){ try{
private String upperCase(VTDNavHuge vn){ if (argCount()==1){ if (argumentList.e.isNodeSet()){ int a = evalFirstArgumentListNodeSet(vn); if (a==-1) return ""; else{ try{ return vn.toStringUpperCase(a); }catch(Exception e){ } return ""; } }else { return (argumentList.e.evalString(vn)).toUpperCase(); } }else throw new IllegalArgumentException ("upperCase()'s argument count is invalid"); }
private String concat(VTDNavHuge vn){ StringBuffer sb = new StringBuffer(); if (argCount()>=2){ Alist temp = argumentList; while(temp!=null){ sb.append(temp.e.evalString(vn)); temp = temp.next; } return sb.toString(); } else throw new IllegalArgumentException ("concat()'s argument count is invalid"); }
private String normalizeSpace(VTDNavHuge vn){ if (argCount()== 0){ String s =null; try{ return ""; // this will almost never occur } else if (argCount() == 1){ String s=""; if (argumentList.e.isNodeSet()){ int a = evalFirstArgumentListNodeSet(vn); if (a==-1) return ""; return normalize(s);
private String getName(VTDNavHuge vn){ int a; if (argCount()==0){ a = vn.getCurrentIndex(); int type = vn.getTokenType(a); } else if (argCount() == 1){ a = evalFirstArgumentListNodeSet2(vn); try { if (a == -1 || vn.ns == false)
private boolean endsWith(VTDNavHuge vn){ String s2 = argumentList.next.e.evalString(vn); if (argumentList.e.isNodeSet()){ int a = evalFirstArgumentListNodeSet(vn); if (a==-1) return "".startsWith(s2); else{ try{ return vn.endsWith(a, s2); }catch(Exception e){ } return false; } } String s1 = argumentList.e.evalString(vn); return s1.endsWith(s2); }
int alright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right; Alist al = (Alist)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value; RESULT = new FuncExpr(fn.i, al); CUP$parser$result = new java_cup.runtime.Symbol(1/*FunctionCall*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
private String concat(VTDNavHuge vn){ StringBuffer sb = new StringBuffer(); if (argCount()>=2){ Alist temp = argumentList; while(temp!=null){ sb.append(temp.e.evalString(vn)); temp = temp.next; } return sb.toString(); } else throw new IllegalArgumentException ("concat()'s argument count is invalid"); }
private String normalizeSpace(VTDNavHuge vn){ if (argCount()== 0){ String s =null; try{ return ""; // this will almost never occur } else if (argCount() == 1){ String s=""; if (argumentList.e.isNodeSet()){ int a = evalFirstArgumentListNodeSet(vn); if (a==-1) return ""; return normalize(s);
private String upperCase(VTDNavHuge vn){ if (argCount()==1){ if (argumentList.e.isNodeSet()){ int a = evalFirstArgumentListNodeSet(vn); if (a==-1) return ""; else{ try{ return vn.toStringUpperCase(a); }catch(Exception e){ } return ""; } }else { return (argumentList.e.evalString(vn)).toUpperCase(); } }else throw new IllegalArgumentException ("upperCase()'s argument count is invalid"); }
private String getName(VTDNavHuge vn){ int a; if (argCount()==0){ a = vn.getCurrentIndex(); int type = vn.getTokenType(a); } else if (argCount() == 1){ a = evalFirstArgumentListNodeSet2(vn); try { if (a == -1 || vn.ns == false)
private boolean endsWith(VTDNavHuge vn){ String s2 = argumentList.next.e.evalString(vn); if (argumentList.e.isNodeSet()){ int a = evalFirstArgumentListNodeSet(vn); if (a==-1) return "".startsWith(s2); else{ try{ return vn.endsWith(a, s2); }catch(Exception e){ } return false; } } String s1 = argumentList.e.evalString(vn); return s1.endsWith(s2); }
int alright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right; Alist al = (Alist)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value; RESULT = new FuncExpr(fn.i, al); CUP$parser$result = new java_cup.runtime.Symbol(1/*FunctionCall*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
return concat(vn); return getLocalName(vn); return getNameSpaceURI(vn); return getName(vn); return getString(vn); case FuncName.SUBSTRING_BEFORE: return subStringBefore(vn); case FuncName.SUBSTRING_AFTER: return subStringAfter(vn); case FuncName.SUBSTRING: return subString(vn); case FuncName.TRANSLATE: return translate(vn); case FuncName.NORMALIZE_SPACE: return normalizeSpace(vn); case FuncName.UPPER_CASE:return upperCase(vn); case FuncName.LOWER_CASE:return lowerCase(vn); case FuncName.QNAME: case FuncName.LOCAL_NAME_FROM_QNAME: case FuncName.ENCODE_FOR_URI: throw new com.ximpleware.extended.xpath.UnsupportedException("not yet implemented"); default: if (isBoolean()){ if (evalBoolean(vn)== true) return "true"; else return "false"; } else {
public boolean evalBoolean(VTDNavHuge vn){ switch(opCode){ case FuncName.STARTS_WITH: if (argCount()!=2){ throw new IllegalArgumentException("starts-with()'s argument count is invalid"); return startsWith(vn); case FuncName.CONTAINS: if (argCount()!=2){ throw new IllegalArgumentException("contains()'s argument count is invalid"); return contains(vn); case FuncName.TRUE: if (argCount()!=0){ throw new IllegalArgumentException("true() doesn't take any argument"); case FuncName.FALSE:if (argCount()!=0){ throw new IllegalArgumentException("false() doesn't take any argument"); case FuncName.BOOLEAN: if (argCount()!=1){ throw new IllegalArgumentException("boolean() doesn't take any argument"); case FuncName.NOT: if (argCount()!=1){ throw new IllegalArgumentException("not() doesn't take any argument"); if (argCount()!=1){ throw new IllegalArgumentException("lang()'s argument count is invalid"); return lang(vn,argumentList.e.evalString(vn)); case FuncName.COMPARE:throw new com.ximpleware.extended.xpath.UnsupportedException("not yet implemented"); case FuncName.ENDS_WITH:
public double evalNumber(VTDNavHuge vn){ int ac = 0; switch(opCode){ case FuncName.LAST: if (argCount()!=0 ) throw new IllegalArgumentException ("floor()'s argument count is invalid"); return contextSize; case FuncName.POSITION: if (argCount()!=0 ) throw new IllegalArgumentException ("position()'s argument count is invalid"); return position; case FuncName.COUNT: return count(vn); case FuncName.NUMBER: if (argCount()!=1) throw new IllegalArgumentException ("number()'s argument count is invalid"); return argumentList.e.evalNumber(vn); case FuncName.SUM: return sum(vn); case FuncName.FLOOR: if (argCount()!=1 ) throw new IllegalArgumentException("floor()'s argument count is invalid"); return Math.floor(argumentList.e.evalNumber(vn)); case FuncName.CEILING: if (argCount()!=1 ) throw new IllegalArgumentException("ceiling()'s argument count is invalid"); return Math.ceil(argumentList.e.evalNumber(vn)); ac = argCount(); if (ac == 0){ try{
private String concat(VTDNavHuge vn){ StringBuffer sb = new StringBuffer(); if (argCount()>=2){ Alist temp = argumentList; while(temp!=null){ sb.append(temp.e.evalString(vn)); temp = temp.next; } return sb.toString(); } else throw new IllegalArgumentException ("concat()'s argument count is invalid"); }
private String normalizeSpace(VTDNavHuge vn){ if (argCount()== 0){ String s =null; try{ return ""; // this will almost never occur } else if (argCount() == 1){ String s=""; if (argumentList.e.isNodeSet()){ int a = evalFirstArgumentListNodeSet(vn); if (a==-1) return ""; return normalize(s);