@Override
	public Regex visitConcatenationRegex(ConcatenationRegex bean)
	throws RuntimeException
	{
		if(bean.getSubexps().size() == 1) return bean.getSubexps().get(0);
		
		ConcatenationRegex rv = new ConcatenationRegex();
		
		for(Regex subexp : bean.getSubexps())
		{
			Regex subexpS = subexp.acceptVisitor(this);
			if(subexpS instanceof ConcatenationRegex)
			{
				rv.addSubexps(((ConcatenationRegex) subexpS).getSubexps());
			}
			else if(!(subexpS instanceof EmptyStringRegex)) rv.addSubexp(subexpS);
		}
		
		if(rv.getSubexps().size() == 1) return rv.getSubexps().get(0);
		else return rv;
	}