本文整理汇总了C#中XmlBooster.XmlBContext.skipTill方法的典型用法代码示例。如果您正苦于以下问题:C# XmlBContext.skipTill方法的具体用法?C# XmlBContext.skipTill怎么用?C# XmlBContext.skipTill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlBooster.XmlBContext
的用法示例。
在下文中一共展示了XmlBContext.skipTill方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: parseBody
/// <remarks>This method is used by XMLBooster-generated code
/// internally. Please refrain from using it, as it
/// might produce unexpected results, and might change
/// or even disappear in the future.</remarks>
public override void parseBody(XmlBContext ctxt)
{
#pragma warning disable 0168, 0219
int indicator=0;
char quoteChar;
string tempStr;
#pragma warning restore 0168, 0219
bool fl1125;
bool fl1126;
RuleCondition fl1128;
ctxt.skipWhiteSpace();
base.parseBody(ctxt);
ctxt.skipWhiteSpace();
// Optional Enclosed
if (ctxt.lookAheadOpeningTag("<SubRules")){
ctxt.skipWhiteSpace();
fl1125 = true ;
while (fl1125) { // BeginLoop
ctxt.skipWhiteSpace();
if (ctxt.isAlNum()){
ctxt.skipTill ('=');
ctxt.advance();
ctxt.skipWhiteSpace();
quoteChar = ctxt.acceptQuote();
ctxt.skipTill (quoteChar);
ctxt.accept(quoteChar);
ctxt.skipWhiteSpace();
} else {
fl1125 = false ;
} // If
} // While
ctxt.accept('>');
// Indicator
// Parse PC data
acceptor.lAcceptPcData(ctxt, 0, '<', XmlBContext.WS_PRESERVE);
// Regexp
ctxt.skipWhiteSpace();
ctxt.acceptString ("</SubRules>");
} // If
// End enclosed
ctxt.skipWhiteSpace();
// Optional Enclosed
if (ctxt.lookAheadOpeningTag("<Conditions")){
ctxt.skipWhiteSpace();
fl1126 = true ;
while (fl1126) { // BeginLoop
ctxt.skipWhiteSpace();
if (ctxt.isAlNum()){
ctxt.skipTill ('=');
ctxt.advance();
ctxt.skipWhiteSpace();
quoteChar = ctxt.acceptQuote();
ctxt.skipTill (quoteChar);
ctxt.accept(quoteChar);
ctxt.skipWhiteSpace();
} else {
fl1126 = false ;
} // If
} // While
if (ctxt.current() == '/'){
ctxt.advance();
ctxt.accept('>');
} else {
ctxt.accept('>');
// Repeat
ctxt.skipWhiteSpace();
fl1128 = null;
while(ctxt.lookAheadOpeningTag ("<RuleCondition")) {
fl1128 = acceptor.lAccept_RuleCondition(ctxt, "</RuleCondition>");
appendConditions(fl1128);
ctxt.skipWhiteSpace();
} // -- monomorphic Loop
// EndRepeat
ctxt.skipWhiteSpace();
ctxt.acceptString ("</Conditions>");
} // If
} // If
// End enclosed
ctxt.skipWhiteSpace();
}
示例2: parse
//.........这里部分代码省略.........
indicator = 914;
} else {
indicator = 916;
} // If
break;
} // Case
case 'G':
{
ctxt.advance();
if (ctxt.lookAheadString("uid=")){
indicator = 912;
} else {
indicator = 916;
} // If
break;
} // Case
default:
indicator = 916;
break;
} // Switch
switch (indicator) {
case 911: {
// Handling attribute Name
// Also handles alien attributes with prefix Name
if (fl911){
ctxt.fail ("Duplicate attribute: Name");
} // If
fl911 = true ;
quoteChar = ctxt.acceptQuote();
this.setName((acceptor.lAcceptPcData(ctxt,-1, quoteChar, XmlBContext.WS_PRESERVE)));
ctxt.accept(quoteChar);
ctxt.skipWhiteSpace();
break;
} // End of dispatch label
case 912: {
// Handling attribute Guid
// Also handles alien attributes with prefix Guid
if (fl912){
ctxt.fail ("Duplicate attribute: Guid");
} // If
fl912 = true ;
quoteChar = ctxt.acceptQuote();
this.setGuid((acceptor.lAcceptPcData(ctxt,-1, quoteChar, XmlBContext.WS_PRESERVE)));
ctxt.accept(quoteChar);
ctxt.skipWhiteSpace();
break;
} // End of dispatch label
case 913: {
// Handling attribute Updates
// Also handles alien attributes with prefix Updates
if (fl913){
ctxt.fail ("Duplicate attribute: Updates");
} // If
fl913 = true ;
quoteChar = ctxt.acceptQuote();
this.setUpdates((acceptor.lAcceptPcData(ctxt,-1, quoteChar, XmlBContext.WS_PRESERVE)));
ctxt.accept(quoteChar);
ctxt.skipWhiteSpace();
break;
} // End of dispatch label
case 914: {
// Handling attribute IsRemoved
// Also handles alien attributes with prefix IsRemoved
if (fl914){
ctxt.fail ("Duplicate attribute: IsRemoved");
} // If
fl914 = true ;
quoteChar = ctxt.acceptQuote();
this.setIsRemoved(acceptor.lAcceptBoolean(ctxt));
ctxt.accept(quoteChar);
ctxt.skipWhiteSpace();
break;
} // End of dispatch label
// Final default label
case 916: {
// Taking ignorable attributes into account
if (ctxt.isAlNum()){
ctxt.skipTill ('=');
ctxt.advance();
ctxt.skipWhiteSpace();
quoteChar = ctxt.acceptQuote();
ctxt.skipTill (quoteChar);
ctxt.accept(quoteChar);
ctxt.skipWhiteSpace();
} else {
if (!fl914){
this.setIsRemoved( false);
} // If
fl915 = false ;
} // If
break;
} // End of dispatch label
} // Dispatch
} // While
}
ctxt.skipWhiteSpace();
ctxt.accept('>');
parseBody(ctxt);
ctxt.acceptString(endingTag);
}
示例3: lAcceptPcData
/// <summary>Utility function which parse a PCDATA component
/// from a context. It takes the entities defined in the
/// in the configuration into account.</summary>
/// <param name="ctxt">the context from which the data must be
/// parsed</param>
/// <param name="maxLen">the maximal number of characters that
/// can be read.</param>
/// <param name="closingCh">a character on which parsing must stop
/// in addition to the standard < character.</param>
/// <param name="wsMode">indicates PRESERVE (default), REPLACE or COLLAPSE.</param>
public static string lAcceptPcData(XmlBContext ctxt,
int maxLen,
char closingCh,
int wsMode)
{
char ch;
char lastch = '.';
System.Text.StringBuilder buff;
string res;
buff = new System.Text.StringBuilder();
bool go_on = true;
while (go_on)
{
go_on = false;
while ((ctxt.current() != '<') && (ctxt.current() != closingCh)) // while 1
{
ch = ctxt.current();
ctxt.advance();
if (ch == '&'){
ch = lAcceptPcDataChr(ctxt);
} else {
if (wsMode >= WS_REPLACE){
if (ch == '\t' || ch == '\n' || ch == '\r'){
ch = ' ';
} // If
if (wsMode == WS_COLLAPSE){
if ((ch == ' ') && ((lastch == ' ') || (buff.Length == 0))){
ch = (char)0;
} else {
lastch = ch;
} // If
} else {
lastch = ch;
} // If
} // If
} // If
if (ch != '\0'){
buff.Append (ch);
} // If
}
// end while
if (ctxt.current() == '<'){
if (ctxt.lookAheadString("<![CDATA[")){
string cdata = ctxt.acceptUntil("]]>", true);
buff.Append (cdata);
go_on = true;
} else {
if (ctxt.lookAhead2('<','?')){
ctxt.skipTill ('?');
ctxt.accept2('?','>');
go_on = true;
} else {
} // If
} // If
} // If
}
if (wsMode == WS_COLLAPSE && lastch == ' ' && buff. Length > 0){
res = buff.ToString (0, buff.Length -1);
} else {
res = buff.ToString();
} // If
if ((maxLen > 0) && (res.Length > maxLen)){
ctxt.recoverableFail ("Maximum length exceeded");
} // If
return res;
}