/** {@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> expr) { StringBuilder builder = new StringBuilder(); for (IAST<Type> child : expr.getChildren()) { switch (child.getType()) { case SingleQuoteLine: case DoubleQuoteLine: builder.append(child.childrenAsString()); break; case NewLine: builder.append('\n'); break; } } return builder.toString(); } }
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 String interpret(final IAST<Type> node, final Map<String, String> ctxVars) { String version = TypeFQN.Version.RELEASE; // vNode => (Release | Latest | CtxVar) IAST<Type> vNode = node.getChildren().get(0); switch (vNode.getType()) { case Release: version = TypeFQN.Version.RELEASE; break; case Latest: version = TypeFQN.Version.LATEST; break; case CtxVar: version = CtxVarExpr.interpret(vNode, ctxVars); break; } return version; } }
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 void interpret(IAST<Type> stmt, ContainerRoot model, Map<String, String> ctxVars, KevoreeRegistryResolver resolver) throws Exception { switch (stmt.getType()) { case Add: AddStmt.interpret(stmt, model, ctxVars, resolver); Log.info("Deprecated KevScript statement: {} ({})", stmt.getType().name(), stmt.getPosition()); break;
/** * Creates a new SexprPrinter. * * @param tree The ast to print. */ public SexprPrinter(final IAST<?> tree) { this.buf = new StringBuilder(); tree.acceptASTVisitor(this); }
public static String interpret(final IAST<Type> node) { return node.childrenAsString(); } }
public static String interpret(IAST<Type> expr, Map<String, String> ctxVars) throws KevScriptException { switch (expr.getType()) { case Wildcard: return WildcardExpr.interpret(expr); case String: return StringExpr.interpret(expr); case RealString: return RealStringExpr.interpret(expr); case CtxVar: return CtxVarExpr.interpret(expr, ctxVars); case GenCtxVar: return GenCtxVarExpr.interpret(expr, ctxVars); default: return null; } } }
public static String interpret(final IAST<Type> tdefVers, final Map<String, String> ctxVars) { String version = TypeFQN.Version.LATEST; // vNode => (Integer | Latest | CtxVar) IAST<Type> vNode = tdefVers.getChildren().get(0); switch (vNode.getType()) { case Integer: String intStr = ""; for (IAST<Type> c : vNode.getChildren()) { intStr += c.toString(); } version = intStr; break; case Latest: version = TypeFQN.Version.LATEST; break; case CtxVar: version = CtxVarExpr.interpret(vNode, ctxVars); break; } return version; } }
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; } }
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 void interpret(IAST<Type> stmt, ContainerRoot model, Map<String, String> ctxVars, Resolver resolver) throws KevScriptException { switch (stmt.getType()) { case Add: AddStmt.interpret(stmt, model, ctxVars, resolver); Log.info("Deprecated KevScript statement: {} ({})", stmt.getType().name(), stmt.getPosition()); break;
/** * Creates a new ArrowPrinter. * * @param tree The ast to print. */ public ArrowPrinter(final IAST<?> tree) { this.buf = new StringBuilder(); this.indentLevel = 0; tree.acceptASTVisitor(this); }
public static String interpret(final IAST<Type> node) { return node.childrenAsString(); } }
public static String interpret(IAST<Type> expr, Map<String, String> ctxVars) throws Exception { switch (expr.getType()) { case Wildcard: return WildcardExpr.interpret(expr); case String: return StringExpr.interpret(expr); case RealString: return RealStringExpr.interpret(expr); case CtxVar: return CtxVarExpr.interpret(expr, ctxVars); case GenCtxVar: return GenCtxVarExpr.interpret(expr, ctxVars); default: return null; } } }
public static String interpret(final IAST<Type> expr) { StringBuilder builder = new StringBuilder(); for (IAST<Type> child : expr.getChildren()) { switch (child.getType()) { case SingleQuoteLine: case DoubleQuoteLine: builder.append(child.childrenAsString()); break; case NewLine: builder.append('\n'); break; } } return builder.toString(); } }
public static String interpret(final IAST<Type> tdefVers, final Map<String, String> ctxVars) throws KevScriptException { String version = TypeFQN.Version.LATEST; // vNode => (Integer | Latest | CtxVar) IAST<Type> vNode = tdefVers.getChildren().get(0); switch (vNode.getType()) { case Integer: String intStr = ""; for (IAST<Type> c : vNode.getChildren()) { intStr += c.toString(); } version = intStr; break; case Latest: version = TypeFQN.Version.LATEST; break; case CtxVar: version = CtxVarExpr.interpret(vNode, ctxVars); break; } return version; } }
/** {@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 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; } }