using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Sunweaver.Parsing { public class Token { public int line; public int column; public string token; public override bool Equals(object obj) { if (obj is Token) { return Equals((Token)obj); } else { return false; } } public bool Equals(Token other) { return other != null && line == other.line && column == other.column && String.Equals(token, other.token); } public override string ToString() { return line + "(" + column + "): " + token; } public override int GetHashCode() { return line.GetHashCode() ^ column.GetHashCode() ^ line.GetHashCode(); } public Token CloneAndRename(string newLabel) { return new Token { column = column, line = line, token = newLabel, }; } } }