IRC parsing, tokenization, and state handling in C#
at dfe5a0035bd321a0774ae402de8fa5cc8f2b8c06 25 lines 656 B view raw
1using System; 2using IrcTokens; 3 4namespace TokensSample 5{ 6 public class Program 7 { 8 public static void Main(string[] args) 9 { 10 // tokenization 11 var line = new Line("@id=123 :ben!~ben@hostname PRIVMSG #channel :hello there!"); 12 Console.WriteLine(line); 13 Console.WriteLine(line.Format()); 14 15 // formatting 16 var line2 = new Line("USER", "user", "0", "*", "real name"); 17 Console.WriteLine(line2); 18 Console.WriteLine(line2.Format()); 19 20 // stateful example 21 var client = new Client(); 22 client.Start(); 23 } 24 } 25}