Example #1
0
        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 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 {
         SourceWriter.Help(null, "Unable to parse conversion token " + s);
     }
 }
Example #3
0
        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
            {
                SourceWriter.Help(null, "Unable to parse conversion token " + s);
            }
        }
Example #4
0
        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);
                }
            }
        }
 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);
         }
     }
 }
Example #7
0
 public static string FixExpression(string expected_type, List<LineageObject> list, string expression, bool inline)
 {
     ExpressionData ed = new ExpressionData(expected_type, list, expression);
     return ed.ToCSharp(inline);
 }