private static void VisitVariable(VariableSubsegment segment, ValueDictionary variables)
		{
			object value;
			if (!variables.TryGetValue(segment.VariableName, out value))
				throw Error.UndefinedRouteVariable(segment.VariableName);

			segment.Value = value;
		}
        private static void VisitVariable(VariableSubsegment segment, ValueDictionary variables)
        {
            object value;

            if (!variables.TryGetValue(segment.VariableName, out value))
            {
                throw Error.UndefinedRouteVariable(segment.VariableName);
            }

            segment.Value = value;
        }
        private static void VisitComposite(CompositeSubsegment segment, ValueDictionary variables)
        {
            foreach (LiteralSubsegment subsegment in segment.Segments)
            {
                VariableSubsegment variable = (subsegment as VariableSubsegment);
                if (variable == null)
                {
                    continue;
                }

                VisitVariable(variable, variables);
            }
        }
        private static void VisitSegment(ContentSegment segment, ValueDictionary variables)
        {
            foreach (PathSubsegment subsegment in segment.Segments)
            {
                VariableSubsegment  variable  = (subsegment as VariableSubsegment);
                CompositeSubsegment composite = (subsegment as CompositeSubsegment);

                if (variable != null)
                {
                    VisitVariable(variable, variables);
                }

                else if (composite != null)
                {
                    VisitComposite(composite, variables);
                }
            }
        }