Package bm.vm

Examples of bm.vm.Context


        {
            throw new IllegalArgumentException( "Operation needs exactly two arguments" );
        }
        else
        {
            final Context context = getContext();
            operand1.setContext( context );
            operand2.setContext( context );
            Instance value1 = operand1.run();
            Instance value2 = operand2.run();
View Full Code Here


     * @throws bm.vm.VirtualMachineException on errors
     */
    public Instance run()
            throws VirtualMachineException
    {
        final Context context = getContext();
        condition.setContext( context );
        body.setContext( context );
        Instance retval;
        while( Conversor.toBoolean( condition.run() ) )
        {
View Full Code Here

        {
            throw new IllegalArgumentException( "And needs exactly two arguments" );
        }
        else
        {
            final Context context = getContext();
            operand1.setContext( context );
            operand2.setContext( context );
            Boolean value;
            if( Conversor.toBoolean( operand1.run() ) )
            {
View Full Code Here

     * @throws bm.vm.VirtualMachineException on errors
     */
    public Instance run()
            throws VirtualMachineException
    {
        final Context localContext = new Context( getContext() );
        final int length = children != null ? children.size() : 0;
        for( int i = 0; i < length; i++ )
        {
            //noinspection ConstantConditions
            final Command child = (Command) children.elementAt( i );
View Full Code Here

     * @throws bm.vm.VirtualMachineException on errors
     */
    public Instance run()
            throws VirtualMachineException
    {
        final Context context = getContext();
        condition.setContext( context );
        final Instance cond = condition.run();
        Instance retval = null;
        if( cond != null && Conversor.toBoolean( cond ) )
        {
View Full Code Here

        {
            throw new IllegalArgumentException( "Operation needs exactly two arguments" );
        }
        else
        {
            final Context context = getContext();
            operand1.setContext( context );
            operand2.setContext( context );
            Instance value1 = operand1.run();
            Instance value2 = operand2.run();
View Full Code Here

     * @throws bm.vm.VirtualMachineException on errors
     */
    public Instance run()
            throws VirtualMachineException
    {
        final Context context = getContext();
        target.setContext( context );
        final Instance instance = target.run();
        return Conversor.toInstance( context, instance.get( propertyName ) );
    }
View Full Code Here

        {
            throw new IllegalArgumentException( "And needs exactly two arguments" );
        }
        else
        {
            final Context context = getContext();
            operand1.setContext( context );
            operand2.setContext( context );
            final Boolean value = Conversor.toBoolean( operand1.run() ) &&
                   Conversor.toBoolean( operand2.run() ) ?
                         CoreConstants.TRUE :
View Full Code Here

            instance.set( "value", CoreConstants.FALSE );
            return instance;
        }
        else
        {
            final Context context = getContext();
            if( context.contains( item ) )
            {
                return Conversor.toInstance( context, context.get( item ) );
            }
            else
            {
                final Instance thisInstance = (Instance) context.get( "this" );
                if( thisInstance.getScriptingClass().hasProperty( item ) )
                {
                    return Conversor.toInstance(
                            context,
                            thisInstance.get( item )
View Full Code Here

     * @throws bm.vm.VirtualMachineException on errors
     */
    public Instance run()
            throws VirtualMachineException
    {
        final Context context = getContext();
        Object value = null;
        if( expression != null )
        {
            expression.setContext( context );
            value = expression.run();
        }

        if( context.contains( name ) )
        {
            context.set( name, value );
            return null;
        }
        else if( getMethod().getClazz().hasProperty( name ) )
        {
            final Instance instance = (Instance) context.get( "this" );
            instance.set( name, value );
            return null;
        }
        else
        {
View Full Code Here

TOP

Related Classes of bm.vm.Context

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.