public ILReader(StreamReader reader) { this.reader = reader; putback_stack = new Stack(); location = new Location(); markedLocation = Location.Unknown; }
/// <summary> /// </summary> public void MarkLocation() { if (markedLocation == Location.Unknown) { markedLocation = new Location(location); } else { markedLocation.CopyFrom(location); } }
private void ComputeTokenInfo(string span, Location location, Location nextLocation, out int begin, out int length) { begin = location.column - 1; if (location.line == nextLocation.line && nextLocation.column != 0) { length = nextLocation.column - 1 - begin; span = span.Substring(begin, length); } else span = span.Substring(begin); var untrimmedLength = span.Length; span = span.TrimStart(); var spanLength = span.Length; begin += untrimmedLength - spanLength; length = spanLength; }
/// <summary> /// </summary> /// <param name="other"></param> public void CopyFrom(Location other) { this.line = other.line; this.column = other.column; }
/// <summary> /// </summary> /// <param name="that"></param> public Location(Location that) { this.line = that.line; this.column = that.column; }
public ILTokenizingException(Location location, string token) : base(token) { Location = location; Token = token; }