private static void ResolveReference(ReferenceExpression reference, Expression root)
 {
     ReferenceVisitor visitor = new ReferenceVisitor(reference.Path);
     visitor.Visit(root);
     if (visitor.ReferencedExpression == null)
         throw new ParseException("Unable to resolve reference to " + reference.Path);
     reference.ReferencedExpression = visitor.ReferencedExpression;
 }
 public void Visit(ReferenceExpression reference)
 {
     References.Add(reference);
 }