コード例 #1
0
/** Generate all output in LLnextgen style

	This function opens the output files, and writes all necessary output
	to them.
*/
void generateLLgenStyle(void) {
	int i;
	
	openOutputs();
	/* First generate all the default declarations and defines. */
	generateHeaderFile(hOutput);
	generateDefaultGlobalDeclarations(cOutput, NULL);
	/* We do this here, because for LLnextgen style output we don't want this
	   in generateDefaultGlobalDeclarations. */
	if (!option.noLLreissue)
		tfputs(cOutput, "#define LL_NEW_TOKEN (-2)\n");
	generateDirectiveCodeAtEnd(cOutput);
	
	/* These are necessary PER .c file */
	for (i = 0; i < listSize(outputs); i++) {
		FileListItem *lOutput = (FileListItem *) listIndex(outputs, i);
		generateDefaultLocalDeclarations(lOutput->output, hOutput->name);
		generateDirectiveDeclarations(lOutput->output);
	}
	/* Now where ready to generate the code. */
	generateCode();

	closeFile(hOutput, true);
	closeFile(cOutput, true);
	for (i = 0; i < listSize(outputs); i++) {
		FileListItem *lOutput = (FileListItem *) listIndex(outputs, i);
		closeFile(lOutput->output, true);
		free(lOutput);
	}
	deleteList(outputs);
}
コード例 #2
0
ファイル: gen_cpp.c プロジェクト: ABratovic/open-watcom-v2
void GenerateCPPFiles( sru_file *sru ) {
/*************************************/

    assert( sru );

    generateLibMain();
    if( !(Options & OPT_GEN_C_CODE) ) {
        if( !generateHeaderFile( sru ) ) return;
        generateCoverFile( sru );
    }
    generateCodeFile( sru );
}