private static String parseTypeFQN(final IAST<Type> node) { String fqn = ""; for (IAST<Type> child: node.getChildren()) { if (child.getChildren().isEmpty()) { fqn += child.toString(); } else { fqn += child.childrenAsString(); } } return fqn; } }
private static String parseTypeFQN(final IAST<Type> node) { String fqn = ""; for (IAST<Type> child: node.getChildren()) { if (child.getChildren().isEmpty()) { fqn += child.toString(); } else { fqn += child.childrenAsString(); } } return fqn; } }
public static Map<String, String> interpret(final IAST<Type> declNode, final Map<String, String> ctxVars) throws KevScriptException { Map<String, String> versions = new HashMap<>(); if (!declNode.getChildren().isEmpty()) { versions.putAll(VersionLinesExpr.interpret(declNode.getChildren().get(0), ctxVars)); } return versions; } }
public static Map<String, String> interpret(final IAST<Type> linesNode, final Map<String, String> ctxVars) throws KevScriptException { Map<String, String> versions = new HashMap<>(); for (final IAST<Type> lineNode : linesNode.getChildren()) { Map.Entry<String, String> entry = VersionLineExpr.interpret(lineNode, ctxVars); versions.put(entry.getKey(), entry.getValue()); } return versions; } }
public static TypeFQN.Version interpret(final IAST<Type> versNode, final Map<String, String> ctxVars) { TypeFQN.Version version = new TypeFQN.Version(); version.tdef = TdefVersionExpr.interpret(versNode.getChildren().get(0), ctxVars); if (versNode.getChildren().size() == 1) { version.du = "RELEASE"; } else { version.du = DuVersionExpr.interpret(versNode.getChildren().get(1), ctxVars); } return version; } }
public static List<List<String>> interpret(IAST<Type> expr, Map<String, String> ctxVars) throws Exception { List<List<String>> nameList = new ArrayList<>(); for (IAST<Type> instancePath : expr.getChildren()) { nameList.add(InstancePathExpr.interpret(instancePath, ctxVars)); } return nameList; } }
public static List<List<String>> interpret(IAST<Type> expr, Map<String, String> ctxVars) throws KevScriptException { List<List<String>> nameList = new ArrayList<>(); for (IAST<Type> instancePath : expr.getChildren()) { nameList.add(InstancePathExpr.interpret(instancePath, ctxVars)); } return nameList; } }
public static List<String> interpret(final IAST<Type> expr, final Map<String, String> ctxVars) throws KevScriptException { final List<String> instancePath = new ArrayList<>(); for (IAST<Type> child : expr.getChildren()) { instancePath.add(InterpretExpr.interpret(child, ctxVars)); } return instancePath; } }
/** {@inheritDoc} */ public void visitAST(final IAST<?> tree) { buf.append('('); buf.append(tree.getType()); for (IAST<?> child : tree.getChildren()) { buf.append(' '); child.acceptASTVisitor(this); } buf.append(')'); }
/** {@inheritDoc} */ public void visitAST(final IAST<?> tree) { buf.append('('); buf.append(tree.getType()); for (IAST<?> child : tree.getChildren()) { buf.append(' '); child.acceptASTVisitor(this); } buf.append(')'); }
public static String interpret(final IAST<Type> node, final Map<String, String> ctxVars) { IAST<Type> ctxVar = node.getChildren().get(0); String key = ctxVar.childrenAsString(); String value = ctxVars.get(key); if (value == null) { value = ShortId.gen(); ctxVars.put(key, value); } return value; } }
public static String interpret(final IAST<Type> node, final Map<String, String> ctxVars) { IAST<Type> ctxVar = node.getChildren().get(0); String key = ctxVar.childrenAsString(); String value = ctxVars.get(key); if (value == null) { value = ShortId.gen(); ctxVars.put(key, value); } return value; } }
public static void interpret(IAST<Type> stmt, ContainerRoot model, Map<String, String> ctxVars) throws KevScriptException { final List<Instance> instances = InstanceResolver.resolve(stmt.getChildren().get(0), model, ctxVars); for (final Instance i : instances) { i.setStarted(true); } } }
public static void interpret(IAST<Type> stmt, ContainerRoot model, Map<String, String> ctxVars) throws Exception { final List<Instance> instances = InstanceResolver.resolve(stmt.getChildren().get(0), model, ctxVars); for (final Instance i : instances) { i.setStarted(true); } } }
public static void interpret(IAST<Type> stmt, ContainerRoot model, Map<String, String> ctxVars) throws Exception { final List<Instance> instances1 = InstanceResolver.resolve(stmt.getChildren().get(0), model, ctxVars); for (final Instance i : instances1) { i.setStarted(false); } } }
public static void interpret(IAST<Type> stmt, ContainerRoot model, Map<String, String> ctxVars) throws KevScriptException { final List<Instance> instances1 = InstanceResolver.resolve(stmt.getChildren().get(0), model, ctxVars); for (final Instance i : instances1) { i.setStarted(false); } } }
public static String interpret(final IAST<Type> node, final Map<String, String> ctxVars) { IAST<Type> ctxVar = node.getChildren().get(0); String key = ctxVar.childrenAsString(); String value = ctxVars.get(key); if (value == null) { throw new KevScriptError("Missing value for context variable %"+ctxVar.childrenAsString()+"%"); } return value; } }
public static String interpret(final IAST<Type> node, final Map<String, String> ctxVars) throws KevScriptException { IAST<Type> ctxVar = node.getChildren().get(0); String key = ctxVar.childrenAsString(); String value = ctxVars.get(key); if (value == null) { throw new KevScriptException("Missing value for context variable %"+ctxVar.childrenAsString()+"%"); } return value; } }
public static void interpret(IAST<Type> stmt, ContainerRoot model, Map<String, String> ctxVars) throws KevScriptException { DefaultKevoreeFactory factory = new DefaultKevoreeFactory(); final List<Instance> channelsInstance = InstanceResolver.resolve(stmt.getChildren().get(1), model, ctxVars); for (final Instance instance : channelsInstance) { final Channel channel = (Channel) instance; final List<Port> ports = PortResolver.resolve(model, stmt.getChildren().get(0)); for (final Port p : ports) { final MBinding mb = factory.createMBinding(); mb.setPort(p); mb.setHub(channel); model.addMBindings(mb); } } } }
public static void interpret(IAST<Type> stmt, ContainerRoot model, Map<String, String> ctxVars) throws Exception { DefaultKevoreeFactory factory = new DefaultKevoreeFactory(); final List<Instance> channelsInstance = InstanceResolver.resolve(stmt.getChildren().get(1), model, ctxVars); for (final Instance instance : channelsInstance) { final Channel channel = (Channel) instance; final List<Port> ports = PortResolver.resolve(model, stmt.getChildren().get(0)); for (final Port p : ports) { final MBinding mb = factory.createMBinding(); mb.setPort(p); mb.setHub(channel); model.addMBindings(mb); } } } }