@Override protected void describeLine(StringBuilder sb) { super.describeLine(sb); sb.append("accepted"); if (acceptName != null) { sb.append(" as "); sb.append(acceptName); } sb.append('\n'); }
@Override public R done() { AstStreamNode streamNode = result.node; streamNode.getStreamables().add(node); return result; }
@Override protected int hashTo() { int hashCode = super.hashTo(); if (acceptName != null) { hashCode <<= 4; hashCode ^= acceptName.hashCode(); } return hashCode; }
@Override public AstScriptNode visit(AstScriptNode script, State state) { for (AstStreamNode stream : script.getStreams()) { stream.accept(this, state); } return null; }
protected boolean equalTo(AstAcceptableNode that) { return super.equalTo(that) && equivalent(this.acceptName, that.acceptName); }
@Override protected void describe(StringBuilder buf) { super.describe(buf); if (acceptables != null) { for (AstAcceptableNode acceptable : acceptables) { acceptable.describe(buf); } } }
@Override public AstScriptNode visitStreamNode(StreamNodeContext ctx) { AstStreamNodeVisitor visitor = new AstStreamNodeVisitor(factory, environment); AstStreamNode streamNode = visitor.visitStreamNode(ctx); if (streamNode != null) { node.getStreams().add(streamNode); childInfos().add(streamNode.getRegionInfo()); } return node; }
@Override public Configuration visit(AstScriptNode script, State state) { state.configuration = new Configuration(); for (AstPropertyNode property : script.getProperties()) { property.accept(this, state); } for (AstStreamNode stream : script.getStreams()) { stream.accept(this, state); } return state.configuration; }
protected boolean equalTo(AstConnectNode that) { return super.equalTo(that) && equivalent(this.location, that.location) && equivalent(this.options, that.options); }
@Override protected void describe(StringBuilder buf) { if (properties != null) { for (AstPropertyNode property : properties) { property.describe(buf); } } if (streams != null) { for (AstStreamNode stream : streams) { stream.describe(buf); } } } }
@Override public R done() { AstStreamNode streamNode = result.node; streamNode.getStreamables().add(node); return result; }
@Override public AstScriptNode visit(AstScriptNode script, State state) { AstScriptNode newScript = new AstScriptNode(); newScript.setRegionInfo(script.getRegionInfo()); newScript.getProperties().addAll(script.getProperties()); state.streams = newScript.getStreams(); for (AstStreamNode stream : script.getStreams()) { stream.accept(this, state); } // remove all associated streams from the main script // But this appears to be a NOOP. Acceptables are not added as streams! for (AstAcceptNode accept : state.accepts.values()) { newScript.getStreams().removeAll(accept.getAcceptables()); } return newScript; }
@Override protected void describe(StringBuilder buf) { describeLine(buf); if (streamables != null) { for (AstRegion streamable : streamables) { streamable.describe(buf); } } }
protected boolean equalTo(AstAcceptNode that) { return super.equalTo(that) && equivalent(this.location, that.location) && equivalent(this.options, that.options) && equivalent(this.acceptName, that.acceptName) && equivalent(this.acceptables, that.acceptables); }
@Override protected int hashTo() { int hashCode = super.hashTo(); if (location != null) { hashCode <<= 4; hashCode ^= location.hashCode(); } if (options != null) { hashCode <<= 4; hashCode ^= options.hashCode(); } if (acceptName != null) { hashCode <<= 4; hashCode ^= acceptName.hashCode(); } if (notifyName != null) { hashCode <<= 4; hashCode ^= notifyName.hashCode(); } if (acceptables != null) { hashCode <<= 4; hashCode ^= acceptables.hashCode(); } return hashCode; }
@Override public R done() { AstStreamNode streamNode = result.node; streamNode.getStreamables().add(node); return result; } }
@Override public AstScriptNode visit(AstScriptNode script, State state) { AstScriptNode newScript = new AstScriptNode(); newScript.setRegionInfo(script.getRegionInfo()); newScript.getProperties().addAll(script.getProperties()); state.streams = newScript.getStreams(); for (AstStreamNode stream : script.getStreams()) { stream.accept(this, state); } return newScript; }
@Override protected void describeLine(StringBuilder sb) { super.describeLine(sb); sb.append("accept ").append(location); if (acceptName != null) { sb.append(" as ").append(acceptName); } sb.append('\n'); if (options != null) { for (Map.Entry<String, Object> entry : options.entrySet()) { sb.append(" option ") .append(entry.getKey()) .append(" ") .append(entry.getValue()) .append('\n'); } } }
@Override public R done() { AstStreamNode streamNode = result.node; streamNode.getStreamables().add(node); return result; } }
@Override public AstScriptNode visit(AstScriptNode script, State state) { AstScriptNode newScript = new AstScriptNode(); newScript.setRegionInfo(script.getRegionInfo()); newScript.getProperties().addAll(script.getProperties()); state.streams = newScript.getStreams(); for (AstStreamNode stream : script.getStreams()) { stream.accept(this, state); } return newScript; }