cpiParseFirstChild

目的

指定した構文エレメントの最初の子を構文解析します。 これは、現行の構文エレメントの最初の子エレメントが必要な場合に、ブローカーによって呼び出されます。

定義されている場所 タイプ メンバー
CPI_VFT 必須 iFpParseFirstChild

構文

void cpiParseFirstChild(
    CciParser*  parser,
    CciContext* context,
  CciElement*  currentElement);

パラメーター

parser
パーサー・オブジェクトのアドレス (入力)。
context
プラグイン・コンテキストのアドレス (入力)。
currentElement
現行の構文エレメントのアドレス (入力)。

戻り値

なし。

サンプル

この例は、サンプル・パーサー・ファイル BipSampPluginParser.c から取られています (477 行~ 508 行)。

void cpiParseFirstChild(
    CciParser*  parser,
    CciContext* context,
    CciElement* element
){
    PARSER_CONTEXT_ST* pc = (PARSER_CONTEXT_ST *)context ;
    int rc;

  if ((!cpiElementCompleteNext(&rc, element)) &&
            (cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_NAME)) {

    while ((!cpiElementCompleteNext(&rc, element))     &&
                      (!cpiFirstChild(&rc, element)) &&
                      (pc->iCurrentElement))
    {
          pc->iCurrentElement = parseNextItem(parser, context, pc->iCurrentElement);
    }
  }

            if (pc->trace) {
        fprintf(pc->tracefile, "PLUGIN: <- cpiParseFirstChild()\n");
              fflush(pc->tracefile);
  }

    return;
}

関連概念
ユーザー定義のパーサー
ユーザー定義拡張機能

関連タスク
C でのパーサーの作成

関連資料
cpiParseLastChild
パーサー・インプリメンテーション関数