Пример #1
0
            public void Parse()
            {
                var token = GetNextToken();

                if (token == null)
                {
                    return;
                }
                if (token.Type != TokenType.Command || token.CommandType == null)
                {
                    ThrowFormatException();
                }
START:
                var commandType = token.CommandType;
                var absolute = token.CommandIsAbsolute;
                var values   = new List <double>();

                while ((token = GetNextToken()) != null && token.Type != TokenType.Command)
                {
                    if (token.Type == TokenType.Seperator)
                    {
                        continue;
                    }
                    values.Add(token.Value);
                }
                var command = CreateCommand(commandType, values, absolute);

                if (LastCommand == null)
                {
                    FirstCommand = command;
                }
                else
                {
                    LastCommand.AppendNext(command);
                }
                LastCommand = command.LastCommand;
                if (token == null)
                {
                    return;
                }
                goto START;
            }
Пример #2
0
 public static MoveCommand Parse(string str)
 {
     return((MoveCommand)PathCommand.Parse(str));
 }
Пример #3
0
 public object GetRealObject(StreamingContext context)
 {
     return(PathCommand.Parse(Input));
 }