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); }
public static Text ParseCreate(WordScanner word, ParsedDocument parsedDocument) { Text text = new Text(); text.Value = word.Text; word.MoveNext(); return(text); }
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); }
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); }
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); }
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); } } } }