// Path: src/main/java/regexcompiler/RegexSubexpression.java
// public enum SubexpressionType {
// 	SYMBOL,
// 	ESCAPED_SYMBOL,
// 	CHARACTER_CLASS,
// 	GROUP,
// }
// 
// Path: src/main/java/regexcompiler/RegexToken.java
// public enum TokenType {
// 	SUBEXPRESSION,
// 	OPERATOR, 
// 	ANCHOR;
// }


import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import regexcompiler.RegexSubexpression.SubexpressionType;
import regexcompiler.RegexToken.TokenType;
	public static class TreeNode {
		
		private List<TreeNode> children;
		public List<TreeNode> getChildren() {
			return children;
		}
		
		public void addChild(TreeNode child) {
			children.add(child);
		}
		
		private final RegexToken regexToken;
		public RegexToken getRegexToken() {
			return regexToken;
		}

		private int getRegexIndex() {
			return regexToken.getIndex();
		}
		
		public TreeNode(RegexToken regexToken) {
			this.regexToken = regexToken;
			
			children = new LinkedList<TreeNode>();
		}
		
		@Override
		public String toString() {
			if (regexToken.getTokenType() == TokenType.SUBEXPRESSION) {
				RegexSubexpression<?> subexpressionToken = (RegexSubexpression<?>) regexToken;
// Path: src/main/java/regexcompiler/RegexSubexpression.java
// public enum SubexpressionType {
// 	SYMBOL,
// 	ESCAPED_SYMBOL,
// 	CHARACTER_CLASS,
// 	GROUP,
// }
// 
// Path: src/main/java/regexcompiler/RegexToken.java
// public enum TokenType {
// 	SUBEXPRESSION,
// 	OPERATOR, 
// 	ANCHOR;
// }


// Path: src/main/java/regexcompiler/ParseTree.java
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import regexcompiler.RegexSubexpression.SubexpressionType;
import regexcompiler.RegexToken.TokenType;

	public static class TreeNode {
		
		private List<TreeNode> children;
		public List<TreeNode> getChildren() {
			return children;
		}
		
		public void addChild(TreeNode child) {
			children.add(child);
		}
		
		private final RegexToken regexToken;
		public RegexToken getRegexToken() {
			return regexToken;
		}

		private int getRegexIndex() {
			return regexToken.getIndex();
		}
		
		public TreeNode(RegexToken regexToken) {
			this.regexToken = regexToken;
			
			children = new LinkedList<TreeNode>();
		}
		
		@Override
		public String toString() {
			if (regexToken.getTokenType() == TokenType.SUBEXPRESSION) {
				RegexSubexpression<?> subexpressionToken = (RegexSubexpression<?>) regexToken;
				if (subexpressionToken.getSubexpressionType() == SubexpressionType.GROUP) {