本文整理汇总了C#中XmlBooster.XmlBContext.fail方法的典型用法代码示例。如果您正苦于以下问题:C# XmlBContext.fail方法的具体用法?C# XmlBContext.fail怎么用?C# XmlBContext.fail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlBooster.XmlBContext
的用法示例。
在下文中一共展示了XmlBContext.fail方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: acceptHistory
/// <summary>Top level function to parse an History from
/// a context. This kind of function is only made
/// available for elements marked as MAIN in the
/// metadefinition</summary>
/// <seealso cref="accept"/>
public static History acceptHistory(XmlBContext ctxt)
{
History res;
ctxt.skipWhiteSpace();
try {
ctxt.acceptString ("<History");
if (ctxt.isAlNum()){
ctxt.fail ("White space expected after TAG");
} // If
res = lAccept_History(ctxt, "</History>");
} catch (XmlBRecoveryException e) {
throw new XmlBException("Unexpected recovery exception: " +
e.ToString());
}
ctxt.close();
if (ctxt.errCount() > 0){
res = null;
throw new XmlBException (ctxt.errorMessage());
} // If
return res;
}
示例2: parse
//.........这里部分代码省略.........
indicator = 581;
} // If
break;
} // Case
case 'G':
{
ctxt.advance();
if (ctxt.lookAheadString("uid=")){
indicator = 577;
} else {
indicator = 581;
} // If
break;
} // Case
case 'F':
{
ctxt.advance();
if (ctxt.lookAheadString("orbidArithmeticOperation=")){
indicator = 575;
} else {
indicator = 581;
} // If
break;
} // Case
default:
indicator = 581;
break;
} // Switch
switch (indicator) {
case 574: {
// Handling attribute Value
// Also handles alien attributes with prefix Value
if (fl574){
ctxt.fail ("Duplicate attribute: Value");
} // If
fl574 = true ;
quoteChar = ctxt.acceptQuote();
this.setValue((acceptor.lAcceptPcData(ctxt,-1, quoteChar, XmlBContext.WS_PRESERVE)));
ctxt.accept(quoteChar);
ctxt.skipWhiteSpace();
break;
} // End of dispatch label
case 575: {
// Handling attribute ForbidArithmeticOperation
// Also handles alien attributes with prefix ForbidArithmeticOperation
if (fl575){
ctxt.fail ("Duplicate attribute: ForbidArithmeticOperation");
} // If
fl575 = true ;
quoteChar = ctxt.acceptQuote();
this.setForbidArithmeticOperation(acceptor.lAcceptBoolean(ctxt));
ctxt.accept(quoteChar);
ctxt.skipWhiteSpace();
break;
} // End of dispatch label
case 576: {
// Handling attribute Name
// Also handles alien attributes with prefix Name
if (fl576){
ctxt.fail ("Duplicate attribute: Name");
} // If
fl576 = true ;
quoteChar = ctxt.acceptQuote();
this.setName((acceptor.lAcceptPcData(ctxt,-1, quoteChar, XmlBContext.WS_PRESERVE)));
ctxt.accept(quoteChar);
ctxt.skipWhiteSpace();
示例3: 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 fl2186;
bool fl2187;
ctxt.skipWhiteSpace();
ctxt.skipWhiteSpace();
// Enclosed
ctxt.acceptString ("<minimum");
if (ctxt.isAlNum()){
ctxt.fail ("White space expected after TAG");
} // If
ctxt.skipWhiteSpace();
fl2186 = true ;
while (fl2186) { // BeginLoop
ctxt.skipWhiteSpace();
if (ctxt.isAlNum()){
ctxt.skipTill ('=');
ctxt.advance();
ctxt.skipWhiteSpace();
quoteChar = ctxt.acceptQuote();
ctxt.skipTill (quoteChar);
ctxt.accept(quoteChar);
ctxt.skipWhiteSpace();
} else {
fl2186 = false ;
} // If
} // While
ctxt.accept('>');
// Indicator
// Parse PC data
this.setMinimum(acceptor.lAcceptPcData(ctxt, -1, '<',XmlBContext.WS_PRESERVE));
// Regexp
ctxt.skipWhiteSpace();
ctxt.acceptString ("</minimum>");
// End enclosed
ctxt.skipWhiteSpace();
// Enclosed
ctxt.acceptString ("<maximum");
if (ctxt.isAlNum()){
ctxt.fail ("White space expected after TAG");
} // If
ctxt.skipWhiteSpace();
fl2187 = true ;
while (fl2187) { // BeginLoop
ctxt.skipWhiteSpace();
if (ctxt.isAlNum()){
ctxt.skipTill ('=');
ctxt.advance();
ctxt.skipWhiteSpace();
quoteChar = ctxt.acceptQuote();
ctxt.skipTill (quoteChar);
ctxt.accept(quoteChar);
ctxt.skipWhiteSpace();
} else {
fl2187 = false ;
} // If
} // While
ctxt.accept('>');
// Indicator
ctxt.skipWhiteSpace();
// Parse PC data
this.setMaximum(acceptor.lAcceptEnum_maximum_Value(ctxt));
// Regexp
ctxt.skipWhiteSpace();
ctxt.acceptString ("</maximum>");
// End enclosed
ctxt.skipWhiteSpace();
}
示例4: acceptSourceTextComment
/// <summary>Top level function to parse an SourceTextComment from
/// a context. This kind of function is only made
/// available for elements marked as MAIN in the
/// metadefinition</summary>
/// <seealso cref="accept"/>
public static SourceTextComment acceptSourceTextComment(XmlBContext ctxt)
{
SourceTextComment res;
ctxt.skipWhiteSpace();
try {
ctxt.acceptString ("<SourceTextComment");
if (ctxt.isAlNum()){
ctxt.fail ("White space expected after TAG");
} // If
res = lAccept_SourceTextComment(ctxt, "</SourceTextComment>");
} catch (XmlBRecoveryException e) {
throw new XmlBException("Unexpected recovery exception: " +
e.ToString());
}
ctxt.close();
if (ctxt.errCount() > 0){
res = null;
throw new XmlBException (ctxt.errorMessage());
} // If
return res;
}