Beispiel #1
0
        public OpsStatement(OpsParsedStatement parsed, IOpsCommand command, object arguments)
        {
            Parsed = parsed;
            OpsParsedArgument arg = parsed.FindArgument("Src");

            ContentRegex = (arg == null) ? "(?# Default Expression ).*" : arg.Value;

            Command   = command;
            Arguments = arguments;
        }
Beispiel #2
0
        public OpsParsedArgument FindArgumentAfter(string name, ref int startAndTrack)
        {
            for (int iArg = startAndTrack; iArg < Args.Length; iArg++)
            {
                OpsParsedArgument arg = Args[iArg];

                startAndTrack = iArg;

                if (0 == String.Compare(arg.Name, name, true))
                {
                    return(arg);
                }
            }
            return(null);
        }
Beispiel #3
0
        public static void ParseArguments(OpsParsedStatement statement, string args)
        {
            ArrayList argList = new ArrayList();

            for (Match argMatch = ArgsReg.Match(args); argMatch.Success; argMatch = argMatch.NextMatch())
            {
                OpsParsedArgument arg = new OpsParsedArgument();

                arg.Name = argMatch.Result("${argName}").Trim();

                string UnescapedArgValue = argMatch.Result("${argVal}");
                arg.Value = EscapeTickReg.Replace(UnescapedArgValue, "'").Trim();

                argList.Add(arg);
            }

            statement.Args = new OpsParsedArgument[argList.Count];
            argList.CopyTo(statement.Args);
        }
Beispiel #4
0
        public static void ParseArguments(OpsParsedStatement statement, string args)
        {
            ArrayList argList = new ArrayList();
            for (Match argMatch = ArgsReg.Match(args); argMatch.Success; argMatch = argMatch.NextMatch())
            {
                OpsParsedArgument arg = new OpsParsedArgument();

                arg.Name = argMatch.Result("${argName}").Trim();

                string UnescapedArgValue = argMatch.Result("${argVal}");
                arg.Value =  EscapeTickReg.Replace(UnescapedArgValue, "'").Trim();

                argList.Add(arg);
            }

            statement.Args = new OpsParsedArgument[argList.Count];
            argList.CopyTo(statement.Args);
        }