sqlparser/cobol.cpp
// Parse single variable declaration, not a record
Parse single variable declaration, not a record
Parse single variable declaration not a record
bool Cobol::ParseVariableDeclaration(int section_scope, Token *num, Token *name, ListWM *record_items)
{
	if(name == NULL)
		return false;
	Token *type = NULL;
	Token *len = NULL;
	Token *var_end = NULL;
	while(true)
	{
		Token *next = GetNextToken();
		if(next == NULL)
			break;
		if(next->Compare('.', L'.') == true)
		{
			PushBack(next);
			break;
		}	
		if(next->Compare("PIC", L"PIC", 3) == true)
			ParsePicFormat(next, &type, &len, &var_end);
		if(record_items != NULL)
			record_items->Add(num, name, type, len, var_end);
	}
	if(record_items == NULL && section_scope == CBL_SCOPE_LINKAGE_SECTION)
		_proc_linkage_params.Add(name, type);
	if(_target_app == APP_PLSQL)
		Token::Remove(num);
	return true;
}
bool Cobol :: ParseVariableDeclaration ( int section_scope , Token * num , Token * name , ListWM * record_items ) { if ( name == NULL ) return false ; Token * type = NULL ; Token * len = NULL ; Token * var_end = NULL ; while ( true ) { Token * next = GetNextToken ( ) ; if ( next == NULL ) break ; if ( next -> Compare ( ' ' , L' ' ) == true ) { PushBack ( next ) ; break ; } if ( next -> Compare ( " " , L" " , 3 ) == true ) ParsePicFormat ( next , & type , & len , & var_end ) ; if ( record_items != NULL ) record_items -> Add ( num , name , type , len , var_end ) ; } if ( record_items == NULL && section_scope == CBL_SCOPE_LINKAGE_SECTION ) _proc_linkage_params . Add ( name , type ) ; if ( _target_app == APP_PLSQL ) Token :: Remove ( num ) ; return true ; }
Parse single variable declaration, not a record
Parse single variable declaration not a record
// Variable options // Exit when the options are ended with period // PIC