Esempio n. 1
0
        public ILReader(StreamReader reader)
        {
            this.reader = reader;
            putback_stack = new Stack();

            location = new Location();
            markedLocation = Location.Unknown;
        }
Esempio n. 2
0
 /// <summary>
 /// </summary>
 public void MarkLocation()
 {
     if (markedLocation == Location.Unknown)
     {
         markedLocation = new Location(location);
     }
     else
     {
         markedLocation.CopyFrom(location);
     }
 }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
 /// <summary>
 /// </summary>
 /// <param name="other"></param>
 public void CopyFrom(Location other)
 {
     this.line = other.line;
     this.column = other.column;
 }
Esempio n. 5
0
 /// <summary>
 /// </summary>
 /// <param name="that"></param>
 public Location(Location that)
 {
     this.line = that.line;
     this.column = that.column;
 }
Esempio n. 6
0
 public ILTokenizingException(Location location, string token)
     : base(token)
 {
     Location = location;
     Token = token;
 }