Пример #1
0
          /// <summary>
          /// Reads a name while alphanumeric characters are found
          /// </summary>
          internal static Name    Read(char c, TextStream S)
          {
              List <string> results = new List <string>();

              string result = "";

              while ((c == CHAR_CHILD_MARKER || c == CHAR_STRING_DELIMITER || c == CHAR_SPECIAL_STRING_DELIMITER_START || c == CHAR_SPECIAL_STRING_DELIMITER_END || IsAlphaNumeric(c)))
              {
                  if (c == CHAR_STRING_DELIMITER)
                  {
                      // Read a quoted-name like "\"example\""
                      Name temp = ReadQuotedName(c, S);
                      for (int i = 0; i < temp.m_name.Length - 1; i++)
                      {
                          results.Add(temp.m_name[i]);
                      }
                      result = temp.m_name[temp.m_name.Length - 1];
                  }
                  else if (c == CHAR_SPECIAL_STRING_DELIMITER_START)
                  {
                      // Read a special-name like "<example>"
                      result = "" + c;
                      while ((c = S.Pop()) != CHAR_SPECIAL_STRING_DELIMITER_END)
                      {
                          result += c;
                      }
                      result += c;
                  }
                  else if (c == CHAR_CHILD_MARKER)
                  {
                      // Add a new string
                      results.Add(result);
                      result = "";
                  }
                  else
                  {
                      result += c;
                  }

                  if (S.EOT)
                  {
                      break;
                  }
                  c = S.Pop();
              }
              results.Add(result);
              S.GoBackOne();

              return(new Name(results.ToArray()));
          }