Package org.codehaus.groovy

Examples of org.codehaus.groovy.GroovyBugError


    }

    public void removeVar(int tempIndex) {
        final Variable head = (Variable) temporaryVariables.removeFirst();
        if (head.getIndex() != tempIndex)
            throw new GroovyBugError("CompileStack#removeVar: tried to remove a temporary variable in wrong order");

        currentVariableIndex = head.getPrevIndex ();
        nextVariableIndex = tempIndex;
    }
View Full Code Here


    public Variable getVariable(String variableName, boolean mustExist) {
        if (variableName.equals("this")) return Variable.THIS_VARIABLE;
        if (variableName.equals("super")) return Variable.SUPER_VARIABLE;
        Variable v = (Variable) stackVariables.get(variableName);
        if (v == null && mustExist)
            throw new GroovyBugError("tried to get a variable with the name " + variableName + " as stack variable, but a variable with this name was not created");
        return v;
    }
View Full Code Here

     * fail if clear is not called before
     */
    public void clear() {
        if (stateStack.size()>1) {
            int size = stateStack.size()-1;
            throw new GroovyBugError("the compile stack contains "+size+" more push instruction"+(size==1?"":"s")+" than pops.");
        }
        clear = true;
        // br experiment with local var table so debuggers can retrieve variable names
        if (true) {//AsmClassGenerator.CREATE_DEBUG_INFO) {
            if (thisEndLabel==null) setEndLabels();
View Full Code Here

     * and will create references if needed.  The created variables
     * can be accessed by calling getVariable().
     *
     */
    protected void init(VariableScope el, Parameter[] parameters, MethodVisitor mv, ClassNode cn) {
        if (!clear) throw new GroovyBugError("CompileStack#init called without calling clear before");
        clear=false;
        pushVariableScope(el);
        this.mv = mv;
        this.helper = new BytecodeHelper(mv);
        defineMethodVariables(parameters,el.isInStaticContext());
View Full Code Here

     * @param value - the meta data value
     * @throws GroovyBugError if key is null or there is already meta
     *                        data under that key
     */
    public void setNodeMetaData(Object key, Object value) {
        if (key==null) throw new GroovyBugError("Tried to set meta data with null key on "+this+".");
        Object old = metaDataMap.put(key,value);
        if (old!=null) throw new GroovyBugError("Tried to overwrite existing meta data "+this+".");
    }
View Full Code Here

     *
     * @param key - the meta data key
     * @throws GroovyBugError if the key is null
     */
    public void removeNodeMetaData(Object key) {
        if (key==null) throw new GroovyBugError("Tried to remove meta data with null key.");
        metaDataMap.remove(key);
        if (metaDataMap.size()==0) metaDataMap=null;
    }
View Full Code Here

                node.setMeaning( PREFIX_MINUS_MINUS );
                break;

            default:
                if( throwIfInvalid ) {
                    throw new GroovyBugError( "cannot convert to prefix for type [" + node.getMeaning() + "]" );
                }
        }

    }
View Full Code Here

                node.setMeaning( POSTFIX_MINUS_MINUS );
                break;

            default:
                if( throwIfInvalid ) {
                    throw new GroovyBugError( "cannot convert to postfix for type [" + node.getMeaning() + "]" );
                }
        }

    }
View Full Code Here

            case KEYWORD_NEW:
                return 85;
        }

        if( throwIfInvalid ) {
            throw new GroovyBugError( "precedence requested for non-operator" );
        }

        return -1;
    }
View Full Code Here

                try {
                    body.call(source);
                } catch (CompilationFailedException e) {
                    throw e;
                } catch (Exception e) {
                    GroovyBugError gbe = new GroovyBugError(e);
                    changeBugText(gbe, source);
                    throw gbe;
                } catch (GroovyBugError e) {
                    changeBugText(e, source);
                    throw e;
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.GroovyBugError

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.