Exemplo n.º 1
0
        public ParseExceptionContext(string s, int begin, int end, Rule r, string msg)
        {
            location = new ParseLocation(s, begin, end);
            this.msg = msg;
            s.GetRowCol(begin, out row, out col);
            line = s.GetLine(begin);
            StringBuilder sb = new StringBuilder();
            int           i  = begin - 1;

            ptr = "^";
            while (i >= 0)
            {
                if (s[i] == '\n')
                {
                    break;
                }
                if (s[i] == '\t')
                {
                    ptr = "\t" + ptr;
                }
                else
                {
                    ptr = " " + ptr;
                }
                --i;
            }
            sb.Append('^');
        }
Exemplo n.º 2
0
 public ParseExceptionContext(string s, int begin, int end, Rule r, string msg)
 {
     location = new ParseLocation(s, begin, end);
     this.msg = msg;
     s.GetRowCol(begin, out row, out col);
     line = s.GetLine(begin);
     StringBuilder sb = new StringBuilder();
     int i = begin - 1;
     ptr = "^";
     while (i >= 0)
     {
         if (s[i] == '\n')
             break;
         if (s[i] == '\t')
             ptr = "\t" + ptr;
         else
             ptr = " " + ptr;
         --i;
     }
     sb.Append('^');
 }