示例#1
0
        public static Command ParseCreate(WordScanner word, ParsedDocument parsedDocument)
        {
            if (BuiltInCommandParsers.ContainsKey(word.Text))
            {
                Command bcommand = BuiltInCommandParsers[word.Text](word, parsedDocument);
                return(bcommand);
            }

            Command command = new Command();

            command.Name = word.Text;
            word.Color(CodeDrawStyle.ColorType.Keyword);
            word.MoveNext();

            while (!word.Eof)
            {
                if (word.Text == "\n" || word.Text == ";")
                {
                    word.MoveNext();
                    break;
                }

                IArgument argument = Argument.ParseCreate(word, parsedDocument);
                if (argument != null)
                {
                    command.Arguments.Add(argument);
                }
            }

            return(command);
        }
示例#2
0
文件: Text.cs 项目: ajkfds/pluginTcl
        public static Text ParseCreate(WordScanner word, ParsedDocument parsedDocument)
        {
            Text text = new Text();

            text.Value = word.Text;
            word.MoveNext();

            return(text);
        }
示例#3
0
        public static new Comment ParseCreate(WordScanner word, ParsedDocument parsedDocument)
        {
            Comment comment = new Comment();

            word.Color(CodeDrawStyle.ColorType.Comment);
            word.MoveNext();

            while (!word.Eof)
            {
                word.Color(CodeDrawStyle.ColorType.Comment);
                word.MoveNext();
                if (word.Text == "\n" || word.Text == ";")
                {
                    word.MoveNext();
                    break;
                }
            }
            return(comment);
        }
示例#4
0
文件: Brace.cs 项目: ajkfds/pluginTcl
        public static Brace ParseCreate(WordScanner word, ParsedDocument parsedDocument)
        {
            Brace brace = new Brace();

            word.Color(CodeDrawStyle.ColorType.Keyword);
            word.MoveNext();

            while (!word.Eof)
            {
                if (word.Text == "}")
                {
                    word.Color(CodeDrawStyle.ColorType.Keyword);
                    word.MoveNext();
                    break;
                }
                word.MoveNext();
            }
            return(brace);
        }
示例#5
0
        public static Quote ParseCreate(WordScanner word, ParsedDocument parsedDocument)
        {
            Quote quote = new Quote();

            word.Color(CodeDrawStyle.ColorType.Keyword);
            word.MoveNext();

            while (!word.Eof)
            {
                if (word.Text == "\"")
                {
                    word.Color(CodeDrawStyle.ColorType.Keyword);
                    word.MoveNext();
                    break;
                }
                word.MoveNext();
            }
            return(quote);
        }
示例#6
0
 public void Parse(WordScanner word)
 {
     while (!word.Eof)
     {
         if (word.Text == "\n" || word.Text == ";")
         {
             word.MoveNext();
         }
         if (word.Text.StartsWith("#"))
         {
             Tcl.Comment comment = Tcl.Comment.ParseCreate(word, this);
         }
         else
         {
             Tcl.Command command = Tcl.Command.ParseCreate(word, this);
             if (command != null)
             {
                 Commands.Add(command);
             }
         }
     }
 }