当前位置: 首页>>代码示例>>C#>>正文


C# ITokener.RestoreState方法代码示例

本文整理汇总了C#中ITokener.RestoreState方法的典型用法代码示例。如果您正苦于以下问题:C# ITokener.RestoreState方法的具体用法?C# ITokener.RestoreState怎么用?C# ITokener.RestoreState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITokener的用法示例。


在下文中一共展示了ITokener.RestoreState方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ParseAddrSpec

    public static int ParseAddrSpec(
string str,
int index,
int endIndex,
ITokener tokener) {
      int indexStart, indexTemp, state, tx2;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        tx2 = ParseLocalPart(str, index, endIndex, tokener);
        if (tx2 == index) {
          break;
        } else {
          index = tx2;
        }
        if (index < endIndex && (str[index] == 64)) {
          ++index;
        } else {
          index = indexStart; break;
        }
        tx2 = ParseDomain(str, index, endIndex, tokener);
        if (tx2 == index) {
          index = indexStart; break;
        } else {
          index = tx2;
        }
        indexTemp = index;
      } while (false);
      if (tokener != null && indexTemp == indexStart) {
 tokener.RestoreState(state);
}
      return indexTemp;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:34,代码来源:HeaderParser.cs

示例2: ParseAddress

    public static int ParseAddress(
string str,
int index,
int endIndex,
ITokener tokener) {
      int indexStart, indexTemp, indexTemp2, state;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        indexTemp2 = ParseMailbox(str, index, endIndex, tokener);
        if (indexTemp2 != index) {
          indexTemp = indexTemp2; break;
        }
        indexTemp2 = ParseGroup(str, index, endIndex, tokener);
        if (indexTemp2 != index) {
          indexTemp = indexTemp2; break;
        }
      } while (false);
      if (tokener != null && indexTemp == indexStart) {
 tokener.RestoreState(state);
}
      return indexTemp;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:24,代码来源:HeaderParser.cs

示例3: ParseDiagOther

    public static int ParseDiagOther(
string str,
int index,
int endIndex,
ITokener tokener) {
      int indexStart, indexStart2, indexTemp, indexTemp2, state, tx3;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        if (index + 1 < endIndex && str[index] == 33 && str[index + 1] == 46) {
          index += 2;
        } else {
          break;
        }
        if (index < endIndex && ((str[index] >= 65 && str[index] <= 90) ||
          (str[index] >= 97 && str[index] <= 122))) {
          ++index;
          while (index < endIndex && ((str[index] >= 65 && str[index] <=
            90) || (str[index] >= 97 && str[index] <= 122))) {
            ++index;
          }
        } else {
          index = indexStart; break;
        }
        do {
          indexTemp2 = index;
          do {
            indexStart2 = index;
            if (index < endIndex && (str[index] == 46)) {
              ++index;
            } else {
              break;
            }
            tx3 = ParseDiagIdentity(str, index, endIndex, tokener);
            if (tx3 == index) {
              index = indexStart2; break;
            } else {
              index = tx3;
            }
            indexTemp2 = index;
            index = indexStart2;
          } while (false);
          if (indexTemp2 != index) {
            index = indexTemp2;
          } else {
            break;
          }
        } while (false);
        index = ParseFWS(str, index, endIndex, tokener);
        indexTemp = index;
      } while (false);
      if (tokener != null && indexTemp == indexStart) {
 tokener.RestoreState(state);
}
      return indexTemp;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:57,代码来源:HeaderParser.cs

示例4: ParseYear

    public static int ParseYear(
string str,
int index,
int endIndex,
ITokener tokener) {
      int indexStart, indexTemp, state;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        index = ParseCFWS(str, index, endIndex, tokener);
        if (index + 1 < endIndex && ((str[index] >= 48 && str[index] <= 57) ||
          (str[index + 1] >= 48 && str[index + 1] <= 57))) {
          index += 2;
        } else {
          index = indexStart; break;
        }
        while (index < endIndex && (str[index] >= 48 && str[index] <= 57)) {
          ++index;
        }
        index = ParseCFWS(str, index, endIndex, tokener);
        indexTemp = index;
      } while (false);
      if (tokener != null && indexTemp == indexStart) {
 tokener.RestoreState(state);
}
      return indexTemp;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:28,代码来源:HeaderParser.cs

示例5: ParseTime

    public static int ParseTime(
string str,
int index,
int endIndex,
ITokener tokener) {
      int indexStart, indexTemp, state, tx2;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        tx2 = ParseTimeOfDay(str, index, endIndex, tokener);
        if (tx2 == index) {
          break;
        } else {
          index = tx2;
        }
        tx2 = ParseZone(str, index, endIndex, tokener);
        if (tx2 == index) {
          index = indexStart; break;
        } else {
          index = tx2;
        }
        indexTemp = index;
      } while (false);
      if (tokener != null && indexTemp == indexStart) {
 tokener.RestoreState(state);
}
      return indexTemp;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:29,代码来源:HeaderParser.cs

示例6: ParseSicSequence

    public static int ParseSicSequence(
string str,
int index,
int endIndex,
ITokener tokener) {
      int i, i2, indexStart, indexStart2, indexTemp, indexTemp2, indexTemp3,
        state, state2;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        for (i = 0; i < 8; ++i) {
          indexTemp2 = ParsePsChar(str, index, endIndex, tokener);
          if (indexTemp2 != index) {
            index = indexTemp2;
          } else {
            if (i < 3) {
              index = indexStart;
            }
            break;
          }
        }
        if (index == indexStart) {
          break;
        }
        while (true) {
          state2 = (tokener != null) ? tokener.GetState() : 0;
          indexTemp2 = index;
          do {
            indexStart2 = index;
            index = ParseFWS(str, index, endIndex, tokener);
            if (index < endIndex && (str[index] == 59)) {
              ++index;
            } else {
              index = indexStart2; break;
            }
            index = ParseFWS(str, index, endIndex, tokener);
            for (i2 = 0; i2 < 8; ++i2) {
              indexTemp3 = ParsePsChar(str, index, endIndex, tokener);
              if (indexTemp3 != index) {
                index = indexTemp3;
              } else {
                if (i2 < 3) {
                  index = indexStart2;
                }
                break;
              }
            }
            if (index == indexStart2) {
              break;
            }
            indexTemp2 = index;
            index = indexStart2;
          } while (false);
          if (indexTemp2 != index) {
            index = indexTemp2;
          } else if (tokener != null) {
            tokener.RestoreState(state2); break;
          } else {
 break;
}
        }
        indexTemp = index;
      } while (false);
      if (tokener != null && indexTemp == indexStart) {
 tokener.RestoreState(state);
}
      return indexTemp;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:69,代码来源:HeaderParser.cs

示例7: ParseResinfo

    public static int ParseResinfo(
string str,
int index,
int endIndex,
ITokener tokener) {
   int indexStart, indexStart2, indexTemp, indexTemp2, state, state2, tx2,
        tx3;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        index = ParseCFWS(str, index, endIndex, tokener);
        if (index < endIndex && (str[index] == 59)) {
          ++index;
        } else {
          index = indexStart; break;
        }
        tx2 = ParseMethodspec(str, index, endIndex, tokener);
        if (tx2 == index) {
          index = indexStart; break;
        } else {
          index = tx2;
        }
        do {
          indexTemp2 = index;
          do {
            indexStart2 = index;
            tx3 = ParseCFWS(str, index, endIndex, tokener);
            if (tx3 == index) {
              break;
            } else {
              index = tx3;
            }
            tx3 = ParseReasonspec(str, index, endIndex, tokener);
            if (tx3 == index) {
              index = indexStart2; break;
            } else {
              index = tx3;
            }
            indexTemp2 = index;
            index = indexStart2;
          } while (false);
          if (indexTemp2 != index) {
            index = indexTemp2;
          } else {
            break;
          }
        } while (false);
        while (true) {
          state2 = (tokener != null) ? tokener.GetState() : 0;
          indexTemp2 = index;
          do {
            indexStart2 = index;
            tx3 = ParseCFWS(str, index, endIndex, tokener);
            if (tx3 == index) {
              break;
            } else {
              index = tx3;
            }
            tx3 = ParsePropspec(str, index, endIndex, tokener);
            if (tx3 == index) {
              index = indexStart2; break;
            } else {
              index = tx3;
            }
            indexTemp2 = index;
            index = indexStart2;
          } while (false);
          if (indexTemp2 != index) {
            index = indexTemp2;
          } else if (tokener != null) {
            tokener.RestoreState(state2); break;
          } else {
 break;
}
        }
        indexTemp = index;
      } while (false);
      if (tokener != null && indexTemp == indexStart) {
 tokener.RestoreState(state);
}
      return indexTemp;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:83,代码来源:HeaderParser.cs

示例8: ParseRegularParameter

    public static int ParseRegularParameter(
string str,
int index,
int endIndex,
ITokener tokener) {
      int indexStart, indexTemp, state, tx2;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        tx2 = ParseRegularParameterName(str, index, endIndex, tokener);
        if (tx2 == index) {
          break;
        } else {
          index = tx2;
        }
        index = ParseCFWS(str, index, endIndex, tokener);
        if (index < endIndex && (str[index] == 61)) {
          ++index;
        } else {
          index = indexStart; break;
        }
        index = ParseCFWS(str, index, endIndex, tokener);
        tx2 = ParseValue(str, index, endIndex, tokener);
        if (tx2 == index) {
          index = indexStart; break;
        } else {
          index = tx2;
        }
        indexTemp = index;
      } while (false);
      if (tokener != null && indexTemp == indexStart) {
 tokener.RestoreState(state);
}
      return indexTemp;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:36,代码来源:HeaderParser.cs

示例9: ParsePhraseAtomOrDot

    public static int ParsePhraseAtomOrDot(
string str,
int index,
int endIndex,
ITokener tokener) {
      int i, indexStart, indexTemp, indexTemp2, state;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        indexTemp2 = index;
        for (i = 0; true; ++i) {
          indexTemp2 = ParseAtext(str, index, endIndex, tokener);
          if (indexTemp2 == index) {
            if (i < 1) {
              indexTemp = indexStart;
            }
            break;
          } else {
 index = indexTemp2;
}
        }
        index = indexStart;
        if (indexTemp2 != indexStart) {
          indexTemp = indexTemp2; break;
        }
        if (index < endIndex && (str[index] == 46)) {
          ++indexTemp; break;
        }
      } while (false);
      if (tokener != null) {
        if (indexTemp == indexStart) {
 tokener.RestoreState(state);
} else {
 tokener.Commit(4, indexStart, indexTemp);
}
      }
      return indexTemp;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:39,代码来源:HeaderParser.cs

示例10: ParsePhraseAtom

    public static int ParsePhraseAtom(
string str,
int index,
int endIndex,
ITokener tokener) {
      int i, indexStart, indexTemp, indexTemp2, indexTemp3, state;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        for (i = 0; true; ++i) {
          indexTemp2 = index;
          do {
            if (index < endIndex && ((str[index] >= 65 && str[index] <=
              90) || (str[index] >= 97 && str[index] <= 122))) {
              ++indexTemp2; break;
            }
            if (index < endIndex && ((str[index] >= 48 && str[index] <= 57) ||
              (str[index] == 33) || (str[index] == 35) || (str[index] ==
              36) || (str[index] == 37) || (str[index] == 38) || (str[index]
              == 39) || (str[index] == 42) || (str[index] == 43) ||
              (str[index] == 45) || (str[index] == 47) || (str[index] == 61) ||
              (str[index] == 63) || (str[index] == 94) || (str[index] ==
              95) || (str[index] == 96) || (str[index] == 123) ||
              (str[index] == 124) || (str[index] == 125) || (str[index] ==
              126))) {
              ++indexTemp2; break;
            }
            indexTemp3 = index;
            do {
              if (index < endIndex && ((str[index] >= 128 && str[index] <=
                55295) || (str[index] >= 57344 && str[index] <= 65535))) {
                ++indexTemp3; break;
              }
              if (index + 1 < endIndex && ((str[index] >= 55296 &&
                str[index] <= 56319) && (str[index + 1] >= 56320 &&
                str[index + 1] <= 57343))) {
                indexTemp3 += 2; break;
              }
            } while (false);
            if (indexTemp3 != index) {
              indexTemp2 = indexTemp3; break;
            }
          } while (false);
          if (indexTemp2 != index) {
            index = indexTemp2;
          } else {
            if (i < 1) {
              index = indexStart;
            }
            break;
          }
        }
        if (index == indexStart) {
          break;
        }
        indexTemp = index;
      } while (false);
      if (tokener != null) {
        if (indexTemp == indexStart) {
 tokener.RestoreState(state);
} else {
 tokener.Commit(3, indexStart, indexTemp);
}
      }
      return indexTemp;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:67,代码来源:HeaderParser.cs

示例11: ParsePhrase

    public static int ParsePhrase(
string str,
int index,
int endIndex,
ITokener tokener) {
      int indexStart, indexTemp, indexTemp2, state, tx2;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        tx2 = ParsePhraseWord(str, index, endIndex, tokener);
        if (tx2 == index) {
          break;
        } else {
          index = tx2;
        }
        while (true) {
          indexTemp2 = ParsePhraseWordOrDot(str, index, endIndex, tokener);
          if (indexTemp2 != index) {
            index = indexTemp2;
          } else {
 break;
}
        }
        indexTemp = index;
      } while (false);
      if (tokener != null) {
        if (indexTemp == indexStart) {
 tokener.RestoreState(state);
} else {
 tokener.Commit(1, indexStart, indexTemp);
}
      }
      return indexTemp;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:35,代码来源:HeaderParser.cs

示例12: ParsePathxmpp

    public static int ParsePathxmpp(
string str,
int index,
int endIndex,
ITokener tokener) {
      int indexStart, indexStart2, indexTemp, indexTemp2, indexTemp3, state;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        do {
          indexTemp2 = index;
          do {
            indexStart2 = index;
            while (true) {
              indexTemp3 = ParseNodeid(str, index, endIndex, tokener);
              if (indexTemp3 != index) {
                index = indexTemp3;
              } else {
 break;
}
            }
            if (index < endIndex && (str[index] == 64)) {
              ++index;
            } else {
              index = indexStart2; break;
            }
            indexTemp2 = index;
            index = indexStart2;
          } while (false);
          if (indexTemp2 != index) {
            index = indexTemp2;
          } else {
            break;
          }
        } while (false);
        while (true) {
          indexTemp2 = ParseRegName(str, index, endIndex, tokener);
          if (indexTemp2 != index) {
            index = indexTemp2;
          } else {
 break;
}
        }
        do {
          indexTemp2 = index;
          do {
            indexStart2 = index;
            if (index < endIndex && (str[index] == 47)) {
              ++index;
            } else {
              break;
            }
            while (true) {
              indexTemp3 = ParseResid(str, index, endIndex, tokener);
              if (indexTemp3 != index) {
                index = indexTemp3;
              } else {
 break;
}
            }
            indexTemp2 = index;
            index = indexStart2;
          } while (false);
          if (indexTemp2 != index) {
            index = indexTemp2;
          } else {
            break;
          }
        } while (false);
        indexTemp = index;
      } while (false);
      if (tokener != null && indexTemp == indexStart) {
 tokener.RestoreState(state);
}
      return indexTemp;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:77,代码来源:HeaderParser.cs

示例13: ParsePathList

    public static int ParsePathList(
string str,
int index,
int endIndex,
ITokener tokener) {
      int indexStart, indexStart2, indexStart4, indexTemp, indexTemp2,
        indexTemp3, indexTemp4, state, state2, state4, tx3, tx5;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        while (true) {
          state2 = (tokener != null) ? tokener.GetState() : 0;
          indexTemp2 = index;
          do {
            indexStart2 = index;
            tx3 = ParsePathIdentity(str, index, endIndex, tokener);
            if (tx3 == index) {
              break;
            } else {
              index = tx3;
            }
            index = ParseFWS(str, index, endIndex, tokener);
            do {
              indexTemp3 = index;
              do {
                state4 = (tokener != null) ? tokener.GetState() : 0;
                indexTemp4 = index;
                do {
                  indexStart4 = index;
                  tx5 = ParseDiagOther(str, index, endIndex, tokener);
                  if (tx5 == index) {
                    break;
                  } else {
                    index = tx5;
                  }
                  if (index < endIndex && (str[index] == 33)) {
                    ++index;
                  } else {
                    index = indexStart4; break;
                  }
                  indexTemp4 = index;
                  index = indexStart4;
                } while (false);
                if (indexTemp4 != index) {
                  indexTemp3 = indexTemp4; break;
                }
                if (tokener != null) {
 tokener.RestoreState(state4);
}
                state4 = (tokener != null) ? tokener.GetState() : 0;
                indexTemp4 = index;
                do {
                  indexStart4 = index;
                  tx5 = ParseDiagDeprecated(str, index, endIndex, tokener);
                  if (tx5 == index) {
                    break;
                  } else {
                    index = tx5;
                  }
                  if (index < endIndex && (str[index] == 33)) {
                    ++index;
                  } else {
                    index = indexStart4; break;
                  }
                  indexTemp4 = index;
                  index = indexStart4;
                } while (false);
                if (indexTemp4 != index) {
                  indexTemp3 = indexTemp4; break;
                }
                if (tokener != null) {
 tokener.RestoreState(state4);
}
        if (index + 1 < endIndex && str[index] == 33 && str[index + 1] ==
                  33) {
                  indexTemp3 += 2; break;
                }
                if (index < endIndex && (str[index] == 33)) {
                  ++indexTemp3; break;
                }
              } while (false);
              if (indexTemp3 != index) {
                index = indexTemp3;
              } else {
                index = indexStart2; break;
              }
            } while (false);
            if (index == indexStart2) {
              break;
            }
            indexTemp2 = index;
            index = indexStart2;
          } while (false);
          if (indexTemp2 != index) {
            index = indexTemp2;
          } else if (tokener != null) {
            tokener.RestoreState(state2); break;
          } else {
 break;
//.........这里部分代码省略.........
开发者ID:houzhenggang,项目名称:MailLib,代码行数:101,代码来源:HeaderParser.cs

示例14: ParsePath

    public static int ParsePath(
string str,
int index,
int endIndex,
ITokener tokener) {
      int indexStart, indexStart2, indexTemp, indexTemp2, state, state2;
      indexStart = index;
      state = (tokener != null) ? tokener.GetState() : 0;
      indexTemp = index;
      do {
        indexTemp2 = ParseAngleAddr(str, index, endIndex, tokener);
        if (indexTemp2 != index) {
          indexTemp = indexTemp2; break;
        }
        state2 = (tokener != null) ? tokener.GetState() : 0;
        indexTemp2 = index;
        do {
          indexStart2 = index;
          index = ParseCFWS(str, index, endIndex, tokener);
          if (index < endIndex && (str[index] == 60)) {
            ++index;
          } else {
            index = indexStart2; break;
          }
          index = ParseCFWS(str, index, endIndex, tokener);
          if (index < endIndex && (str[index] == 62)) {
            ++index;
          } else {
            index = indexStart2; break;
          }
          index = ParseCFWS(str, index, endIndex, tokener);
          indexTemp2 = index;
          index = indexStart2;
        } while (false);
        if (indexTemp2 != index) {
          indexTemp = indexTemp2; break;
        }
        if (tokener != null) {
 tokener.RestoreState(state2);
}
      } while (false);
      if (tokener != null && indexTemp == indexStart) {
 tokener.RestoreState(state);
}
      return indexTemp;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:46,代码来源:HeaderParser.cs

示例15: ParseParameter


//.........这里部分代码省略.........
                    (str[index] == 38) || (str[index] == 43) ||
                    (str[index] >= 45 && str[index] <= 46) ||
                    (str[index] >= 48 && str[index] <= 57) ||
                    (str[index] >= 65 && str[index] <= 90) ||
                    (str[index] >= 94 && str[index] <= 126))) {
                    ++indexTemp5; break;
                    }
                    } while (false);
                    if (indexTemp5 != index) {
                    index = indexTemp5;
                    } else {
 break;
}
                  }
                  indexTemp4 = index;
                  index = indexStart4;
                } while (false);
                if (indexTemp4 != index) {
                  index = indexTemp4;
                } else {
                  index = indexStart3; break;
                }
              } while (false);
              if (index == indexStart3) {
                break;
              }
              indexTemp3 = index;
              index = indexStart3;
            } while (false);
            if (indexTemp3 != index) {
              indexTemp2 = indexTemp3; break;
            }
            if (tokener != null) {
 tokener.RestoreState(state3);
}
            state3 = (tokener != null) ? tokener.GetState() : 0;
            indexTemp3 = index;
            do {
              indexStart3 = index;
              do {
                indexTemp4 = index;
                do {
                  indexStart4 = index;
                  if (index < endIndex && ((str[index] == 33) ||
                    (str[index] >= 35 && str[index] <= 36) || (str[index]
                    == 38) || (str[index] == 43) || (str[index] >= 45 &&
                    str[index] <= 46) || (str[index] >= 48 && str[index]
                    <= 57) || (str[index] >= 65 && str[index] <= 90) ||
                    (str[index] >= 94 && str[index] <= 126))) {
                    ++index;
                    while (index < endIndex && ((str[index] == 33) ||
                    (str[index] >= 35 && str[index] <= 36) ||
                    (str[index] == 38) || (str[index] == 43) ||
                    (str[index] >= 45 && str[index] <= 46) ||
                    (str[index] >= 48 && str[index] <= 57) ||
                    (str[index] >= 65 && str[index] <= 90) ||
                    (str[index] >= 94 && str[index] <= 126))) {
                    ++index;
                    }
                  } else {
                    break;
                  }
                  tx5 = ParseOtherSections(str, index, endIndex, tokener);
                  if (tx5 == index) {
                    index = indexStart4; break;
                  } else {
开发者ID:houzhenggang,项目名称:MailLib,代码行数:67,代码来源:HeaderParser.cs


注:本文中的ITokener.RestoreState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。