Search in sources :

Example 1 with ConnectorNode

use of org.ballerinalang.model.tree.ConnectorNode in project ballerina by ballerina-lang.

the class BLangPackageBuilder method startConnectorDef.

public void startConnectorDef() {
    ConnectorNode connectorNode = TreeBuilder.createConnectorNode();
    attachAnnotations(connectorNode);
    attachDocumentations(connectorNode);
    attachDeprecatedNode(connectorNode);
    this.connectorNodeStack.push(connectorNode);
    startEndpointDeclarationScope(((BLangConnector) connectorNode).endpoints);
}
Also used : ConnectorNode(org.ballerinalang.model.tree.ConnectorNode)

Example 2 with ConnectorNode

use of org.ballerinalang.model.tree.ConnectorNode in project ballerina by ballerina-lang.

the class BLangPackageBuilder method startConnectorBody.

public void startConnectorBody() {
    /* end of connector definition header, so let's populate
         * the connector information before processing the body */
    ConnectorNode connectorNode = this.connectorNodeStack.peek();
    if (!this.varListStack.empty()) {
        this.varListStack.pop().forEach(variableNode -> {
            ((BLangVariable) variableNode).docTag = DocTag.PARAM;
            connectorNode.addParameter(variableNode);
        });
    }
    /* add a temporary block node to contain connector variable definitions */
    this.blockNodeStack.add(TreeBuilder.createBlockNode());
    /* action node list to contain the actions of the connector */
    this.actionNodeStack.add(new ArrayList<>());
}
Also used : ConnectorNode(org.ballerinalang.model.tree.ConnectorNode)

Example 3 with ConnectorNode

use of org.ballerinalang.model.tree.ConnectorNode in project ballerina by ballerina-lang.

the class BLangPackageBuilder method endConnectorBody.

public void endConnectorBody(Set<Whitespace> ws) {
    ConnectorNode connectorNode = this.connectorNodeStack.peek();
    connectorNode.addWS(ws);
    this.blockNodeStack.pop().getStatements().forEach(e -> connectorNode.addVariableDef((VariableDefinitionNode) e));
    this.actionNodeStack.pop().forEach(connectorNode::addAction);
}
Also used : VariableDefinitionNode(org.ballerinalang.model.tree.statements.VariableDefinitionNode) ConnectorNode(org.ballerinalang.model.tree.ConnectorNode)

Aggregations

ConnectorNode (org.ballerinalang.model.tree.ConnectorNode)3 VariableDefinitionNode (org.ballerinalang.model.tree.statements.VariableDefinitionNode)1