src/CXRefInterp.cpp
/*
 * translation-unit:
 *  external-declaration
 *  translation-unit external-declaration
 */
translation-unit:
external-declaration
translation-unit external-declaration
translation - unit : external - declaration translation - unit external - declaration
CXRefTokenP
CXRefReadTranslationUnit(bool )
{
  CXRefTokenP token;
  CXREF_TRACE_TOKEN("CXRefReadTranslationUnit", token);
  if (cxref_control.trace)
    std::cerr << "Tokenising     ..." << std::endl;
  CXRefTokenP token1 = CXRefReadExternalDeclaration(false);
  while (token1.isValid()) {
    CXRefTokenP token2 = CXRefCreateToken(TRANSLATION_UNIT);
    if (token.isValid())
      CXRefAddTokenChild(token, token2);
    CXRefAddTokenChild(token1, token2);
    token = token2;
    if (CXRefIsLastToken())
      break;
    token1 = CXRefReadExternalDeclaration(false);
  }
  if (! CXRefIsLastToken())
    CXRefError("Invalid Translation Unit\n");
  return token;
}
CXRefTokenP CXRefReadTranslationUnit ( bool ) { CXRefTokenP token ; CXREF_TRACE_TOKEN ( " " , token ) ; if ( cxref_control . trace ) std :: cerr << " " << std :: endl ; CXRefTokenP token1 = CXRefReadExternalDeclaration ( false ) ; while ( token1 . isValid ( ) ) { CXRefTokenP token2 = CXRefCreateToken ( TRANSLATION_UNIT ) ; if ( token . isValid ( ) ) CXRefAddTokenChild ( token , token2 ) ; CXRefAddTokenChild ( token1 , token2 ) ; token = token2 ; if ( CXRefIsLastToken ( ) ) break ; token1 = CXRefReadExternalDeclaration ( false ) ; } if ( ! CXRefIsLastToken ( ) ) CXRefError ( " \n " ) ; return token ; }
translation-unit:
  external-declaration
  translation-unit external-declaration
translation - unit : external - declaration translation - unit external - declaration
/*required*/