當前位置: 首頁>>代碼示例>>C#>>正文


C# XmlBContext.fail方法代碼示例

本文整理匯總了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;
 }
開發者ID:nikiforovandrey,項目名稱:ERTMSFormalSpecs,代碼行數:26,代碼來源:HistoricalData.Generated.cs

示例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();
開發者ID:GautierBerck,項目名稱:ERTMSFormalSpecs,代碼行數:67,代碼來源:DataDictionary.Generated.cs

示例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();
        }
開發者ID:GautierBerck,項目名稱:ERTMSFormalSpecs,代碼行數:78,代碼來源:DataDictionary.Generated.cs

示例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;
 }
開發者ID:GautierBerck,項目名稱:ERTMSFormalSpecs,代碼行數:26,代碼來源:DataDictionary.Generated.cs


注:本文中的XmlBooster.XmlBContext.fail方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。