// Path: src/main/java/txr/parser/Expr.java
// public class Expr extends Node {
// 
// 	public final List<SubExpression> subExpressions;
// 	
// 	public Expr(List<SubExpression> subExpressions) {
// 		this.subExpressions = subExpressions;
// 	}
// 
// 	@Override
// 	public boolean isNegativeMatcher() {
// 		return false;
// 	}
// 
// 	public String toString() {
// 		return subExpressions.toString();
// 	}
// }
// 
// Path: src/main/java/txr/parser/StringLiteral.java
// public class StringLiteral extends SubExpression {
// 
// 	public final String value;
// 	
// 	public StringLiteral(String value) {
// 		this.value = value;
// 	}
// 
// 	public String toString() {
// 		return "String: *" + value + "*";
// 	}
// }
// 
// Path: src/main/java/txr/parser/SubExpression.java
// public class SubExpression {
// 
// }
// 
// Path: src/main/java/txr/parser/Symbol.java
// public class Symbol extends SubExpression {
// 
// 	public final String symbolText;
// 	
// 	public Symbol(String symbolText) {
// 		this.symbolText = symbolText;
// 	}
// 
// 	public String toString() {
// 		return "Symbol: " + symbolText;
// 	}
// }


import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import txr.parser.Expr;
import txr.parser.StringLiteral;
import txr.parser.SubExpression;
import txr.parser.Symbol;
package txr.matchers;



public class BindMatcher extends VerticalMatcher {

	private SubExpression target;

	private SubExpression value;

	private List<SubExpression> parameters = new ArrayList<>();
	
	public BindMatcher(Expr expr) {
		Iterator<SubExpression> iter = expr.subExpressions.iterator();

		// The first is the name of the directive, so ignore that.
		iter.next();

		if (iter.hasNext()) {
			this.target = iter.next();
//			if (!(target instanceof Symbol)) {
//				throw new RuntimeException("not a throwable exception type");
//			}
			if (iter.hasNext()) {
				this.value = iter.next();
			}
		}
	}

	@Override
	public void addNextMatcherInMatchSequence(Matcher matcher) {
		// TODO refactor so we don't need to implement this.
		throw new RuntimeException();
	}

	@Override
	public void addNextDirective(int txrLineIndex, Expr expr) {
		// TODO refactor so we don't need to implement this.
		throw new RuntimeException();
	}
	
	@Override
	public MatcherResult match(LinesFromInputReader reader, MatchContext context) {
		// TODO implement this
		
		if (target instanceof Symbol && value instanceof StringLiteral) {
// Path: src/main/java/txr/parser/Expr.java
// public class Expr extends Node {
// 
// 	public final List<SubExpression> subExpressions;
// 	
// 	public Expr(List<SubExpression> subExpressions) {
// 		this.subExpressions = subExpressions;
// 	}
// 
// 	@Override
// 	public boolean isNegativeMatcher() {
// 		return false;
// 	}
// 
// 	public String toString() {
// 		return subExpressions.toString();
// 	}
// }
// 
// Path: src/main/java/txr/parser/StringLiteral.java
// public class StringLiteral extends SubExpression {
// 
// 	public final String value;
// 	
// 	public StringLiteral(String value) {
// 		this.value = value;
// 	}
// 
// 	public String toString() {
// 		return "String: *" + value + "*";
// 	}
// }
// 
// Path: src/main/java/txr/parser/SubExpression.java
// public class SubExpression {
// 
// }
// 
// Path: src/main/java/txr/parser/Symbol.java
// public class Symbol extends SubExpression {
// 
// 	public final String symbolText;
// 	
// 	public Symbol(String symbolText) {
// 		this.symbolText = symbolText;
// 	}
// 
// 	public String toString() {
// 		return "Symbol: " + symbolText;
// 	}
// }


// Path: src/main/java/txr/matchers/BindMatcher.java
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import txr.parser.Expr;
import txr.parser.StringLiteral;
import txr.parser.SubExpression;
import txr.parser.Symbol;

package txr.matchers;



public class BindMatcher extends VerticalMatcher {

	private SubExpression target;

	private SubExpression value;

	private List<SubExpression> parameters = new ArrayList<>();
	
	public BindMatcher(Expr expr) {
		Iterator<SubExpression> iter = expr.subExpressions.iterator();

		// The first is the name of the directive, so ignore that.
		iter.next();

		if (iter.hasNext()) {
			this.target = iter.next();
//			if (!(target instanceof Symbol)) {
//				throw new RuntimeException("not a throwable exception type");
//			}
			if (iter.hasNext()) {
				this.value = iter.next();
			}
		}
	}

	@Override
	public void addNextMatcherInMatchSequence(Matcher matcher) {
		// TODO refactor so we don't need to implement this.
		throw new RuntimeException();
	}

	@Override
	public void addNextDirective(int txrLineIndex, Expr expr) {
		// TODO refactor so we don't need to implement this.
		throw new RuntimeException();
	}
	
	@Override
	public MatcherResult match(LinesFromInputReader reader, MatchContext context) {
		// TODO implement this
		
		if (target instanceof Symbol && value instanceof StringLiteral) {
			Symbol t = (Symbol)target;