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

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