Exemplo n.º 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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
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);
        }