Exemple #1
0
        public void Process(string line, MachineCode result)
        {
            result.Linenumber = 0;
            result.Command    = new Command();
            result.Parameters.Clear();
            var match = CodeRegex.Match(line);

            while (match.Success)
            {
                if (match.Groups["IGNORE"].Success)
                {
                    break;
                }
                if (match.Groups["LINENUMBER"].Success)
                {
                    int.TryParse(match.Groups["LINENUMBER"].Value, out result.Linenumber);
                }
                if (match.Groups["CMD"].Success)
                {
                    Command cmd;
                    cmd.Code = match.Groups["CMDPREFIX"].Value.ToUpperInvariant();
                    double.TryParse(match.Groups["CMDCODE"].Value,
                                    System.Globalization.NumberStyles.Float,
                                    System.Globalization.CultureInfo.InvariantCulture,
                                    out cmd.Value);

                    if (result.Command.Code == null)
                    {
                        result.Command = cmd;
                    }
                    else
                    {
                        result.Parameters.Add(cmd);
                    }
                }

                match = match.NextMatch();
            }
        }
Exemple #2
0
 public void Process(MachineCode machineCode)
 {
 }