tmiller     01/08/23 07:07:05

  Modified:    java/src/org/apache/xalan/xsltc/compiler
                        VariableRefBase.java
  Log:
  added default typeCheck() to this base class
  
  Revision  Changes    Path
  1.3       +17 -1     
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableRefBase.java
  
  Index: VariableRefBase.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableRefBase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- VariableRefBase.java      2001/08/20 14:50:32     1.2
  +++ VariableRefBase.java      2001/08/23 14:07:05     1.3
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: VariableRefBase.java,v 1.2 2001/08/20 14:50:32 morten Exp $
  + * @(#)$Id: VariableRefBase.java,v 1.3 2001/08/23 14:07:05 tmiller Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -98,6 +98,22 @@
        */
       public String toString() {
        return "variable-ref(" + _variable.getName() + ')';
  +    }
  +
  +    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
  +
  +        // Attempt to get the cached variable type
  +        _type = _variable.getType();
  +
  +        // If that does not work we must force a type-check (this is normally
  +        // only needed for globals in included/imported stylesheets
  +        if (_type == null) {
  +            _variable.typeCheck(stable);
  +            _type = _variable.getType();
  +        }
  +
  +        // Return the type of the referenced variable
  +        return _type;
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to