sqlparser/cobol.cpp
// Parse data section that can contain variable definitions, COPY and INCLUDE commands
Parse data section that can contain variable definitions, COPY and INCLUDE commands
Parse data section that can contain variable definitions COPY and INCLUDE commands
bool Cobol::ParseDataSection(int section_scope)
{
	bool exists = false;
	while(true)
	{
		Token *next = GetNextToken();
		if(next == NULL)
			break;
		if(next->IsNumeric() == true)
		{
			PushBack(next);
			ParseVariableSection(section_scope);
			exists = true;
			continue;
		}
		else
		if(TOKEN_CMP(next, "EXEC"))
		{
			ParseExecSqlStatement(next);
			exists = true;
			continue;
		}
		else
		if(TOKEN_CMP(next, "COPY"))
		{
			ParseCopyStatement(next);
			exists = true;
			continue;
		}
		PushBack(next);
		break;
	}
	return exists;
}
bool Cobol :: ParseDataSection ( int section_scope ) { bool exists = false ; while ( true ) { Token * next = GetNextToken ( ) ; if ( next == NULL ) break ; if ( next -> IsNumeric ( ) == true ) { PushBack ( next ) ; ParseVariableSection ( section_scope ) ; exists = true ; continue ; } else if ( TOKEN_CMP ( next , " " ) ) { ParseExecSqlStatement ( next ) ; exists = true ; continue ; } else if ( TOKEN_CMP ( next , " " ) ) { ParseCopyStatement ( next ) ; exists = true ; continue ; } PushBack ( next ) ; break ; } return exists ; }
Parse data section that can contain variable definitions, COPY and INCLUDE commands
Parse data section that can contain variable definitions COPY and INCLUDE commands
// Check for a number starting variable or record declaration // EXEC SQL statement (cursor declaration i.e) // COPY command // Not a data section command