All Downloads are FREE. Search and download functionalities are using the official Maven repository.

webit.script.core.ast.statements.BreakPointStatement Maven / Gradle / Ivy

The newest version!
// Copyright (c) 2013, Webit Team. All Rights Reserved.
package webit.script.core.ast.statements;

import webit.script.Context;
import webit.script.core.ast.Statement;
import webit.script.debug.BreakPointListener;

/**
 *
 * @author zqq
 */
public class BreakPointStatement extends Statement {

    private final BreakPointListener listener;
    private final String label;
    private final Statement statement;

    public BreakPointStatement(BreakPointListener listener, String label, Statement statement, int line, int column) {
        super(line, column);
        this.listener = listener;
        this.label = label;
        this.statement = statement;
    }

    public Object execute(Context context) {
        if (statement != null) {
            statement.execute(context);
        }
        listener.onBreak(label, context, this, null);
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy