IRC parsing, tokenization, and state handling in C#
at 8acaa752c3a03feecd4a9131d09ec4be7756289d 25 lines 650 B view raw
1using System; 2using IRCTokens; 3 4namespace Tokens 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}