public static IArgument ParseCreate(WordScanner word, ParsedDocument parsedDocument) { if (word.Text == "\n" || word.Text == ";") { return(null); } switch (word.Text) { case "[": // bracket Bracket bracket = Bracket.ParseCreate(word, parsedDocument); return(bracket); case "{": // brace Brace brace = Brace.ParseCreate(word, parsedDocument); return(brace); case "\"": // quote Quote quote = Quote.ParseCreate(word, parsedDocument); return(quote); default: Text text = Text.ParseCreate(word, parsedDocument); return(text); } }
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 WordScanner Clone() { WordScanner ret = new WordScanner(wordPointer.Document, RootParsedDocument, systemTcl); ret.wordPointer = wordPointer.Clone(); ret.nonGeneratedCount = nonGeneratedCount; ret.prototype = prototype; foreach (var wp in stock) { ret.stock.Add(wp.Clone()); } return(ret); }
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); } } } }