Package com.sun.org.apache.xalan.internal.xsltc.compiler.util

Examples of com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError


  if (_arg instanceof LiteralExpr) {
      return _type = Type.Boolean;
  }
  ErrorMsg err = new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR,
      "function-available", this);
  throw new TypeCheckError(err);
    }
View Full Code Here


          name, this);
  }
  if ((_ref = resolve(getParser(), stable)) != null) {
      return (_type = _ref.typeCheck(stable));
  }
  throw new TypeCheckError(reportError());
    }
View Full Code Here

      if (!arg2.identicalTo(tright))
    _right = new CastExpr(_right, arg1);
      // Return the result type for the operator we will use
      return _type = haveType.resultType();
  }
  throw new TypeCheckError(this);
    }
View Full Code Here

      break;
  case 1:
      _paramType = _param.typeCheck(stable);
      break;
  default:
      throw new TypeCheckError(this);
  }

  // The argument has to be a node, a node-set or a node reference
  if ((_paramType != Type.NodeSet) &&
      (_paramType != Type.Node) &&
      (_paramType != Type.Reference)) {
      throw new TypeCheckError(this);
  }

  return (_type = Type.String);
    }
View Full Code Here

        }
        if (_type instanceof NodeSetType||_type instanceof ResultTreeType) {
            typeCheckContents(stable);
            return Type.Void;
        }
        throw new TypeCheckError(this);
    }
View Full Code Here

            */
            else if (ftype instanceof NodeType)  {
                _filterExpr = new CastExpr(_filterExpr, Type.NodeSet);
            }
            else {
                throw new TypeCheckError(this);
            }
        }

        // Wrap single node path in a node set
        final Type ptype = _path.typeCheck(stable);
View Full Code Here

    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
        // At least one argument - two at most
        final int ac = argumentCount();
        if ((ac < 1) || (ac > 2)) {
            ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this);
            throw new TypeCheckError(msg);
        }
        if (getStylesheet() == null) {
            ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this);
            throw new TypeCheckError(msg);
        }

        // Parse the first argument
        _arg1 = argument(0);

        if (_arg1 == null) {// should not happened
            ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this);
            throw new TypeCheckError(msg);
        }

        _arg1Type = _arg1.typeCheck(stable);
        if ((_arg1Type != Type.NodeSet) && (_arg1Type != Type.String)) {
            _arg1 = new CastExpr(_arg1, Type.String);
        }

        // Parse the second argument
        if (ac == 2) {
            _arg2 = argument(1);

            if (_arg2 == null) {// should not happened
                ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this);
                throw new TypeCheckError(msg);
            }

            final Type arg2Type = _arg2.typeCheck(stable);

            if (arg2Type.identicalTo(Type.Node)) {
                _arg2 = new CastExpr(_arg2, Type.NodeSet);
            } else if (arg2Type.identicalTo(Type.NodeSet)) {
                // falls through
            } else {
                ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this);
                throw new TypeCheckError(msg);
            }
        }

        return _type = Type.NodeSet;
    }
View Full Code Here

        if (template != null) {
            typeCheckContents(stable);
        }
        else {
            ErrorMsg err = new ErrorMsg(ErrorMsg.TEMPLATE_UNDEF_ERR,_name,this);
            throw new TypeCheckError(err);
        }
        return Type.Void;
    }
View Full Code Here

        if (_arg instanceof LiteralExpr) {
            return _type = Type.Boolean;
        }
        ErrorMsg err = new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR,
                        "function-available", this);
        throw new TypeCheckError(err);
    }
View Full Code Here

        // Check that the function was passed exactly two arguments
        if (argumentCount() != 2) {
            ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR,
                                        getName(), this);
            throw new TypeCheckError(err);
        }

        // The first argument must be a String, or cast to a String
        _base = argument(0);
        Type baseType = _base.typeCheck(stable);
View Full Code Here

TOP

Related Classes of com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.