Package org.apache.xalan.xsltc.compiler.util

Examples of org.apache.xalan.xsltc.compiler.util.TypeCheckError


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


      if (!arg2.identicalTo(tright)) {
    _right = new CastExpr(_right, arg1);
      }
      return _type = ptype.resultType();
  }
  throw new TypeCheckError(this);
    }
View Full Code Here

      }
      if (_type instanceof NodeSetType||_type instanceof ResultTreeType) {
    typeCheckContents(stable); // with-params
    return Type.Void;
      }
      throw new TypeCheckError(this);
  }
  else {
      typeCheckContents(stable);    // with-params
      return Type.Void;
  }
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 (_type instanceof NodeSetType||_type instanceof ResultTreeType) {
      typeCheckContents(stable);
      return Type.Void;
  }
  throw new TypeCheckError(this);
    }
View Full Code Here

  if (ptype instanceof NodeSetType == false) {
      if (ptype instanceof ReferenceType)  {
    _primary = new CastExpr(_primary, Type.NodeSet);
      }
      else {
    throw new TypeCheckError(this);
      }
  }

  int n = _predicates.size();
  for (int i = 0; i < n; i++) {
View Full Code Here

  }
  if (InternalTypeMap.maps(tleft, _type) != null) {
      return _type;
  }
  // throw new TypeCheckError(this); 
  throw new TypeCheckError(new ErrorMsg(
      ErrorMsg.DATA_CONVERSION_ERR, tleft.toString(), _type.toString()));
    }
View Full Code Here

      if (!arg2.identicalTo(tright)) {
    _right = new CastExpr(_right, arg1);       
      }
      return _type = ptype.resultType();
  }
  throw new TypeCheckError(this);
    }
View Full Code Here

    _left = new CastExpr(_left, arg1);
      }
      return _type = ptype.resultType();
  }

  throw new TypeCheckError(this);
    }
View Full Code Here

TOP

Related Classes of org.apache.xalan.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.