parsercmd/src/clconvert.cxx
// ===========================================================================
// The following functions are parse-oriented. Each will return true/false
// depending on whether parsing the desired construct succeeds or fails.
// Successful parsing advances the current position within the source file
// to the end of the construct.
//
// ===========================================================================
// Parses a complete command line from iargs, converting it into oargs.
//
The following functions are parse-oriented. Each will return true/false
depending on whether parsing the desired construct succeeds or fails.
Successful parsing advances the current position within the source file
to the end of the construct.

Parses a complete command line from iargs, converting it into oargs.
The following functions are parse - oriented . Each will return true / false depending on whether parsing the desired construct succeeds or fails . Successful parsing advances the current position within the source file to the end of the construct . Parses a complete command line from iargs converting it into oargs .
bool CommandLineConverter::command_line() {
    if (fault) return false;
    interp->reset();
    string filenm;
    if (argument(filenm)) {
	string suffix;
	bool continuable = false;
	const char *p = filenm.c_str();
	while (*p != '\0') {
	    if (isalnum(*p)) {
		if (!continuable) {
		    suffix = "";
		}
		suffix.append(1, *p);
		continuable = true;
	    }
	    else {
		continuable = false;
	    }
	    p += 1;
	}
	string suffix_string;
	if (interp->suffixString(suffix, suffix_string)) {
	}
	if (!whitespace()) {
	    return false;
	}
    }
    for (;;) {
	string arg;
	if (complete_option() && whitespace()) {
	}
	else if (argument(arg) && whitespace()) {
	    unrecognized_option(arg);
	}
	else {
	    break;
	}
    }
    bool ok = eof();
    if (ok) {
	CommandLineInterpreter::a_list_of_blocks::iterator iter;
	CommandLineInterpreter::a_list_of_blocks &blocks = interp->block_sequence();
	for (iter = blocks.begin(); iter != blocks.end(); ++iter) {
	    list<string> block_content = (*iter)->get(*interp);
	    oargs.splice(oargs.end(), block_content);
	}
    }
    return ok;
}
bool CommandLineConverter :: command_line ( ) { if ( fault ) return false ; interp -> reset ( ) ; string filenm ; if ( argument ( filenm ) ) { string suffix ; bool continuable = false ; const char * p = filenm . c_str ( ) ; while ( * p != ' \0 ' ) { if ( isalnum ( * p ) ) { if ( ! continuable ) { suffix = " " ; } suffix . append ( 1 , * p ) ; continuable = true ; } else { continuable = false ; } p += 1 ; } string suffix_string ; if ( interp -> suffixString ( suffix , suffix_string ) ) { } if ( ! whitespace ( ) ) { return false ; } } for ( ; ; ) { string arg ; if ( complete_option ( ) && whitespace ( ) ) { } else if ( argument ( arg ) && whitespace ( ) ) { unrecognized_option ( arg ) ; } else { break ; } } bool ok = eof ( ) ; if ( ok ) { CommandLineInterpreter :: a_list_of_blocks :: iterator iter ; CommandLineInterpreter :: a_list_of_blocks & blocks = interp -> block_sequence ( ) ; for ( iter = blocks . begin ( ) ; iter != blocks . end ( ) ; ++ iter ) { list < string > block_content = ( * iter ) -> get ( * interp ) ; oargs . splice ( oargs . end ( ) , block_content ) ; } } return ok ; }
The following functions are parse-oriented.
The following functions are parse - oriented .
// fo*e // file name // The suffix may affect the result. // OK // (*ostrm) << ' '; // have_text = true; // Assemble the output from the sequence of blocks.