@SuppressWarnings("unchecked")
	public static IntermediateNode visitRegexNode(Node n,String inheritance,CompilerLogger logger)
	throws CopperException
	{
		if(!n.getParentNode().getNodeName().equals("term"))
		{
			formalError(logger,n,"missing","term","parent");
			return null;
		}
		ParsedRegex pr = null,buffer;
		for(int i = 0;i < n.getChildNodes().getLength();i++)
		{
			buffer = visitRegexInteriorNode(n.getChildNodes().item(i),inheritance,logger);
			if(buffer != null && pr != null)
			{
				formalError(logger,n,"has too many","regex","children");
				return null;
			}
			else if(buffer != null)
			{
				pr = buffer;
			}
		}
		return new IntermediateSymbolNode(
			   IntermediateSymbolSort.TERMINAL,
			   Symbol.symbol(inheritance),
		       Pair.cons("location",Pair.cons(getPos(),null)),
			   Pair.cons("regex",Pair.cons(getPos(),(Object) pr)));
	}