//^\((?<type>\w+),(?<scale>\d+),(?<scale2>\d+)\) //^\((?<type>\w+)\) public ConversionToken(ref string s, ExpressionData parent) { Match m = CONVERT_REGEX.Match(s); if (m.Success) { s = s.Substring(m.Index + m.Length); TypeRef = ColumnVariable.LookupSsisTypeName(m.Groups[1].Value); TokenToConvert = parent.ConsumeToken(ref s); } else { m = new Regex("^\\((?<type>\\w+),(?<scale>\\d+),(?<scale2>\\d+)\\)").Match(s); if (m.Success) { s = s.Substring(m.Index + m.Length); TypeRef = ColumnVariable.LookupSsisTypeName(m.Groups[1].Value); TokenToConvert = parent.ConsumeToken(ref s); } else { m = new Regex("^\\((?<type>\\w+)\\)").Match(s); if (m.Success) { s = s.Substring(m.Index + m.Length); TypeRef = ColumnVariable.LookupSsisTypeName(m.Groups[1].Value); TokenToConvert = parent.ConsumeToken(ref s); } else { SourceWriter.Help(null, "Unable to parse conversion token " + s); } } } }
public VariableToken(ref string s, ExpressionData parent) { Match m = VARIABLE_REGEX.Match(s.Substring(1)); if (m.Success) { s = s.Substring(m.Index + m.Length + 1); Variable = m.Captures[0].Value; Namespace = ""; } else { m = new Regex("\\[(?<namespace>\\w+)::(?<variable>\\w+)\\]").Match(s.Substring(1)); if (m.Success) { Variable = m.Groups[2].Value; Namespace = m.Groups[1].Value; s = s.Substring(m.Index + m.Length + 1); } else { SourceWriter.Help(null, "Unable to parse variable '" + s + "'"); } } }
public LineageToken(ref string s, ExpressionData parent) { Match m = LINEAGE_REGEX.Match(s); if (m.Success) { var li = (from LineageObject l in parent.Lineage where l.LineageId == m.Groups[1].Value select l).FirstOrDefault(); if (li != null) { s = s.Substring(m.Index + m.Length); LineageRef = li; } else { SourceWriter.Help(null, "Unable to find lineage reference #" + s); } } }