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

io.resys.wrench.assets.flow.api.model.FlowAst Maven / Gradle / Ivy

There is a newer version: 3.1.4
Show newest version
package io.resys.wrench.assets.flow.api.model;

/*-
 * #%L
 * wrench-assets-flow
 * %%
 * Copyright (C) 2016 - 2018 Copyright 2016 ReSys OÜ
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import java.io.Serializable;
import java.util.List;

import javax.annotation.Nullable;

import org.immutables.value.Value;

import io.resys.wrench.assets.datatype.api.AstType;
import io.resys.wrench.assets.flow.api.FlowAstFactory.Node;
import io.resys.wrench.assets.flow.api.FlowAstFactory.NodeFlow;


@Value.Immutable
public interface FlowAst extends AstType, Serializable {
  Node getSrc();
  List getCommands();
  List getMessages();
  List getAutocomplete();

  @Value.Immutable
  interface FlowAutocomplete extends Serializable {
    String getId();
    List getRange();
    List getValue();
  }

  @Value.Immutable
  interface FlowCommandMessage extends Serializable {
    int getLine();
    String getValue();
    FlowCommandMessageType getType();
    @Nullable
    FlowCommandRange getRange();
  }

  @Value.Immutable
  interface FlowCommandRange extends Serializable {
    int getStart();
    int getEnd();
    @Nullable
    Integer getColumn();
    @Nullable
    Boolean getInsert();
  }

  @Value.Immutable
  interface FlowCommand extends Serializable {
    int getId();
    @Nullable
    String getValue();
    FlowCommandType getType();

  }

  enum FlowCommandMessageType { ERROR, WARNING }

  enum FlowCommandType { SET, ADD, DELETE }
  
  interface NodeFlowVisitor {
    void visit(NodeFlow node, ImmutableFlowAst.Builder nodesBuilder);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy