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

org.kaazing.robot.lang.ast.builder.AstAcceptableNodeBuilder Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2014 "Kaazing Corporation," (www.kaazing.com)
 *
 * This file is part of Robot.
 *
 * Robot is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see .
 */

package org.kaazing.robot.lang.ast.builder;

import org.kaazing.robot.lang.ast.AstAcceptNode;
import org.kaazing.robot.lang.ast.AstAcceptableNode;
import org.kaazing.robot.lang.ast.AstScriptNode;

public final class AstAcceptableNodeBuilder extends AbstractAstAcceptableNodeBuilder {

    private int line;

    public AstAcceptableNodeBuilder() {
        this(new AstAcceptableNode());
    }

    @Override
    public AstAcceptableNodeBuilder setLocationInfo(int line, int column) {
        node.setLocationInfo(line, column);
        internalSetLineInfo(line);
        return this;
    }

    @Override
    public AstAcceptableNodeBuilder setNextLineInfo(int linesToSkip, int column) {
        internalSetNextLineInfo(linesToSkip, column);
        return this;
    }

    public AstAcceptableNodeBuilder setAcceptName(String acceptName) {
        node.setAcceptName(acceptName);
        return this;
    }

    @Override
    public AstOpenedNodeBuilder.StreamNested addOpenedEvent() {
        return new AstOpenedNodeBuilder.StreamNested(this);
    }

    @Override
    public AstBoundNodeBuilder.StreamNested addBoundEvent() {
        return new AstBoundNodeBuilder.StreamNested(this);
    }

    @Override
    public AstConnectedNodeBuilder.StreamNested addConnectedEvent() {
        return new AstConnectedNodeBuilder.StreamNested(this);
    }

    @Override
    public AstReadNodeBuilder.StreamNested addReadEvent() {
        return new AstReadNodeBuilder.StreamNested(this);
    }

    @Override
    public AstDisconnectedNodeBuilder.StreamNested addDisconnectedEvent() {
        return new AstDisconnectedNodeBuilder.StreamNested(this);
    }

    @Override
    public AstUnboundNodeBuilder.StreamNested addUnboundEvent() {
        return new AstUnboundNodeBuilder.StreamNested(this);
    }

    @Override
    public AstClosedNodeBuilder.StreamNested addClosedEvent() {
        return new AstClosedNodeBuilder.StreamNested(this);
    }

    @Override
    public AstWriteNodeBuilder.StreamNested addWriteCommand() {
        return new AstWriteNodeBuilder.StreamNested(this);
    }

    @Override
    public AstDisconnectNodeBuilder.StreamNested addDisconnectCommand() {
        return new AstDisconnectNodeBuilder.StreamNested(this);
    }

    @Override
    public AstUnbindNodeBuilder.StreamNested addUnbindCommand() {
        return new AstUnbindNodeBuilder.StreamNested(this);
    }

    @Override
    public AstCloseNodeBuilder.StreamNested addCloseCommand() {
        return new AstCloseNodeBuilder.StreamNested(this);
    }

    @Override
    public AstReadAwaitNodeBuilder.StreamNested addReadAwaitBarrier() {
        return new AstReadAwaitNodeBuilder.StreamNested(this);
    }

    @Override
    public AstReadNotifyNodeBuilder.StreamNested addReadNotifyBarrier() {
        return new AstReadNotifyNodeBuilder.StreamNested(this);
    }

    @Override
    public AstWriteAwaitNodeBuilder.StreamNested addWriteAwaitBarrier() {
        return new AstWriteAwaitNodeBuilder.StreamNested(this);
    }

    @Override
    public AstWriteNotifyNodeBuilder.StreamNested addWriteNotifyBarrier() {
        return new AstWriteNotifyNodeBuilder.StreamNested(this);
    }

    @Override
    public AstReadOptionNodeBuilder.StreamNested addReadOption() {
        return new AstReadOptionNodeBuilder.StreamNested(this);
    }

    @Override
    public AstWriteOptionNodeBuilder.StreamNested addWriteOption() {
        return new AstWriteOptionNodeBuilder.StreamNested(this);
    }

    @Override
    public AstAcceptableNode done() {
        return result;
    }

    @Override
    protected int line() {
        return line;
    }

    @Override
    protected int line(int line) {
        this.line = line;
        return line;
    }

    private AstAcceptableNodeBuilder(AstAcceptableNode node) {
        super(node, node);
    }

    @Override
    public AstReadConfigNodeBuilder.StreamNested addReadConfigEvent() {
        return new AstReadConfigNodeBuilder.StreamNested(this);
    }

    @Override
    public AstWriteConfigNodeBuilder.StreamNested addWriteConfigCommand() {
        return new AstWriteConfigNodeBuilder.StreamNested(this);
    }

    @Override
    public AstFlushNodeBuilder.StreamNested addFlushCommand() {
        return new AstFlushNodeBuilder.StreamNested(this);
    }

    @Override
    public AstReadClosedNodeBuilder.StreamNested addReadCloseCommand() {
        return new AstReadClosedNodeBuilder.StreamNested(this);
    }

    @Override
    public AstWriteCloseNodeBuilder.StreamNested addWriteCloseCommand() {
        return new AstWriteCloseNodeBuilder.StreamNested(this);
    }

    public static final class ScriptNested> extends
            AbstractAstAcceptableNodeBuilder {

        public ScriptNested(R builder) {
            super(builder);
        }

        @Override
        public ScriptNested setLocationInfo(int line, int column) {
            node.setLocationInfo(line, column);
            internalSetLineInfo(line);
            return this;
        }

        @Override
        public ScriptNested setNextLineInfo(int linesToSkip, int column) {
            internalSetNextLineInfo(linesToSkip, column);
            return this;
        }

        public ScriptNested setAcceptName(String acceptName) {
            node.setAcceptName(acceptName);
            return this;
        }

        @Override
        public AstOpenedNodeBuilder.StreamNested> addOpenedEvent() {
            return new AstOpenedNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstBoundNodeBuilder.StreamNested> addBoundEvent() {
            return new AstBoundNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstConnectedNodeBuilder.StreamNested> addConnectedEvent() {
            return new AstConnectedNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstReadNodeBuilder.StreamNested> addReadEvent() {
            return new AstReadNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstDisconnectedNodeBuilder.StreamNested> addDisconnectedEvent() {
            return new AstDisconnectedNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstUnboundNodeBuilder.StreamNested> addUnboundEvent() {
            return new AstUnboundNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstClosedNodeBuilder.StreamNested> addClosedEvent() {
            return new AstClosedNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstWriteNodeBuilder.StreamNested> addWriteCommand() {
            return new AstWriteNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstDisconnectNodeBuilder.StreamNested> addDisconnectCommand() {
            return new AstDisconnectNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstUnbindNodeBuilder.StreamNested> addUnbindCommand() {
            return new AstUnbindNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstCloseNodeBuilder.StreamNested> addCloseCommand() {
            return new AstCloseNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstReadAwaitNodeBuilder.StreamNested> addReadAwaitBarrier() {
            return new AstReadAwaitNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstReadNotifyNodeBuilder.StreamNested> addReadNotifyBarrier() {
            return new AstReadNotifyNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstWriteAwaitNodeBuilder.StreamNested> addWriteAwaitBarrier() {
            return new AstWriteAwaitNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstWriteNotifyNodeBuilder.StreamNested> addWriteNotifyBarrier() {
            return new AstWriteNotifyNodeBuilder.StreamNested>(this);
        }

        @Override
        public R done() {
            AstScriptNode scriptNode = result.node;
            scriptNode.getStreams().add(node);
            return result;
        }

        @Override
        protected int line() {
            return result.line();
        }

        @Override
        protected int line(int line) {
            return result.line(line);
        }

        @Override
        public AstReadConfigNodeBuilder.StreamNested> addReadConfigEvent() {
            return new AstReadConfigNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstWriteConfigNodeBuilder.StreamNested> addWriteConfigCommand() {
            return new AstWriteConfigNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstFlushNodeBuilder.StreamNested> addFlushCommand() {
            return new AstFlushNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstReadClosedNodeBuilder.StreamNested> addReadCloseCommand() {
            return new AstReadClosedNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstWriteCloseNodeBuilder.StreamNested> addWriteCloseCommand() {
            return new AstWriteCloseNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstReadOptionNodeBuilder.StreamNested> addReadOption() {
            return new AstReadOptionNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstWriteOptionNodeBuilder.StreamNested> addWriteOption() {
            return new AstWriteOptionNodeBuilder.StreamNested>(this);
        }
    }

    public static final class AcceptNested> extends
            AbstractAstAcceptableNodeBuilder {

        public AcceptNested(R builder) {
            super(builder);
        }

        @Override
        public AcceptNested setLocationInfo(int line, int column) {
            node.setLocationInfo(line, column);
            internalSetLineInfo(line);
            return this;
        }

        @Override
        public AcceptNested setNextLineInfo(int linesToSkip, int column) {
            internalSetNextLineInfo(linesToSkip, column);
            return this;
        }

        public AcceptNested setAcceptName(String acceptName) {
            node.setAcceptName(acceptName);
            return this;
        }

        @Override
        public AstOpenedNodeBuilder.StreamNested> addOpenedEvent() {
            return new AstOpenedNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstBoundNodeBuilder.StreamNested> addBoundEvent() {
            return new AstBoundNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstConnectedNodeBuilder.StreamNested> addConnectedEvent() {
            return new AstConnectedNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstReadNodeBuilder.StreamNested> addReadEvent() {
            return new AstReadNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstDisconnectedNodeBuilder.StreamNested> addDisconnectedEvent() {
            return new AstDisconnectedNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstUnboundNodeBuilder.StreamNested> addUnboundEvent() {
            return new AstUnboundNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstClosedNodeBuilder.StreamNested> addClosedEvent() {
            return new AstClosedNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstWriteNodeBuilder.StreamNested> addWriteCommand() {
            return new AstWriteNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstDisconnectNodeBuilder.StreamNested> addDisconnectCommand() {
            return new AstDisconnectNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstUnbindNodeBuilder.StreamNested> addUnbindCommand() {
            return new AstUnbindNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstCloseNodeBuilder.StreamNested> addCloseCommand() {
            return new AstCloseNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstReadAwaitNodeBuilder.StreamNested> addReadAwaitBarrier() {
            return new AstReadAwaitNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstReadNotifyNodeBuilder.StreamNested> addReadNotifyBarrier() {
            return new AstReadNotifyNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstWriteAwaitNodeBuilder.StreamNested> addWriteAwaitBarrier() {
            return new AstWriteAwaitNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstWriteNotifyNodeBuilder.StreamNested> addWriteNotifyBarrier() {
            return new AstWriteNotifyNodeBuilder.StreamNested>(this);
        }

        @Override
        public R done() {
            AstAcceptNode acceptNode = result.node;
            acceptNode.getAcceptables().add(node);
            return result;
        }

        @Override
        protected int line() {
            return result.line();
        }

        @Override
        protected int line(int line) {
            return result.line(line);
        }

        @Override
        public AstReadOptionNodeBuilder.StreamNested> addReadOption() {
            return new AstReadOptionNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstWriteOptionNodeBuilder.StreamNested> addWriteOption() {
            return new AstWriteOptionNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstReadConfigNodeBuilder.StreamNested> addReadConfigEvent() {
            return new AstReadConfigNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstWriteConfigNodeBuilder.StreamNested> addWriteConfigCommand() {
            return new AstWriteConfigNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstFlushNodeBuilder.StreamNested> addFlushCommand() {
            return new AstFlushNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstReadClosedNodeBuilder.StreamNested> addReadCloseCommand() {
            return new AstReadClosedNodeBuilder.StreamNested>(this);
        }

        @Override
        public AstWriteCloseNodeBuilder.StreamNested> addWriteCloseCommand() {
            return new AstWriteCloseNodeBuilder.StreamNested>(this);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy