/* * Program entry point. */ void main( int argc, char *argv[] ) /*********************************/ { OPT_STORAGE cmdOpts; CmdLine * cmdLine; #ifndef __WATCOMC__ _argc = argc; _argv = argv; #endif /*** Initialize ***/ SetBannerFuncError( BannerMessage ); cmdLine = InitCmdLine( NMAKE_NUM_SECTIONS ); /*** Parse the command line and translate to Watcom options ***/ InitParse( &cmdOpts ); do_parsing( &cmdOpts ); OptionsTranslate( &cmdOpts, cmdLine ); /*** Spawn the librarian ***/ nmake( &cmdOpts, cmdLine ); FiniParse( &cmdOpts ); exit( EXIT_SUCCESS ); }
/* * Program entry point. */ void main( int argc, char *argv[] ) /*********************************/ { OPT_STORAGE cmdOpts; CmdLine * cmdLine; int itemsParsed; #ifndef __WATCOMC__ _argc = argc; _argv = argv; #endif /*** Initialize ***/ SetBannerFuncError( BannerMessage ); cmdLine = InitCmdLine( LINK_NUM_SECTIONS ); SetDefaultFile( TYPE_OBJ_FILE, "object" ); AllowTypeFile( TYPE_OBJ_FILE, TYPE_LIB_FILE, TYPE_RES_FILE, TYPE_RBJ_FILE, TYPE_RS_FILE, TYPE_EXP_FILE, TYPE_INVALID_FILE ); /*** Parse the command line and translate to Watcom options ***/ InitParse( &cmdOpts ); itemsParsed = do_parsing( &cmdOpts ); if( itemsParsed == 0 ) { PrintHelpMessage(); exit( EXIT_SUCCESS ); } OptionsTranslate( &cmdOpts, cmdLine ); /*** Spawn the linker ***/ if( link( &cmdOpts, cmdLine ) == LINK_NOACTION ) { FatalError( "Nothing to do!" ); } FiniParse( &cmdOpts ); exit( EXIT_SUCCESS ); }
/* * Program entry point. */ void main( int argc, char *argv[] ) /*********************************/ { OPT_STORAGE cmdOpts; CmdLine * compCmdLine; CmdLine * linkCmdLine; int itemsParsed; int compRc = COMPILE_NOACTION; int linkRc = LINK_NOACTION; #ifndef __WATCOMC__ _argc = argc; _argv = argv; #endif /*** Initialize ***/ SetBannerFuncError( BannerMessage ); compCmdLine = InitCmdLine( CL_C_NUM_SECTIONS ); linkCmdLine = InitCmdLine( CL_L_NUM_SECTIONS ); SetDefaultFile( TYPE_C_FILE, "source" ); AllowTypeFile( TYPE_C_FILE, TYPE_CPP_FILE, TYPE_DEF_FILE, TYPE_OBJ_FILE, TYPE_LIB_FILE, TYPE_RES_FILE, TYPE_INVALID_FILE ); InitMacro(); /*** Parse the command line and translate to Watcom options ***/ InitParse( &cmdOpts ); itemsParsed = do_parsing( &cmdOpts ); if( itemsParsed==0 || cmdOpts.help ) { if( !cmdOpts.nologo ) BannerMessage(); PrintHelpMessage(); exit( EXIT_SUCCESS ); } OptionsTranslate( &cmdOpts, compCmdLine, linkCmdLine ); /*** Spawn the compiler ***/ compRc = compile( &cmdOpts, compCmdLine ); if( compRc == COMPILE_ERROR ) exit( EXIT_FAILURE ); if( !cmdOpts.c ) { linkRc = link( &cmdOpts, linkCmdLine ); } if( compRc == COMPILE_NOACTION && linkRc == LINK_NOACTION ) { FatalError( "Nothing to do!" ); } FiniParse( &cmdOpts ); exit( EXIT_SUCCESS ); }
VOID LuaCFuncRegister::ValidateFuncs() { #ifdef __WINDOWS__ static INT runtime = 0; if(runtime++ != 0) return; InitParse(); ReadLuaFnTblFiles(); ParseTheResult(); WriteScriptFile(); NeedAddLuaFn(); ExportRegName(); #endif }
/* * Program entry point. */ void main( int argc, char *argv[] ) /*********************************/ { OPT_STORAGE cmdOpts; int itemsParsed; int rc = CVTRES_NOACTION; #ifndef __WATCOMC__ _argc = argc; _argv = argv; #endif /*** Initialize ***/ SetBannerFuncError( BannerMessage ); SetDefaultFile( TYPE_RES_FILE, "res" ); AllowTypeFile( TYPE_RES_FILE, TYPE_INVALID_FILE ); /*** Parse the command line ***/ InitParse( &cmdOpts ); itemsParsed = do_parsing( &cmdOpts ); if( itemsParsed==0 || cmdOpts.help ) { PrintHelpMessage(); exit( EXIT_SUCCESS ); } /*** Do the conversion ***/ rc = res_convert( &cmdOpts ); switch( rc ) { case CVTRES_ERROR: exit( EXIT_FAILURE ); break; case CVTRES_NOACTION: FatalError( "Nothing to do!" ); break; case CVTRES_SUCCESS: FiniParse( &cmdOpts ); exit( EXIT_SUCCESS ); break; default: Zoinks(); } }
/* * Program entry point. */ void main( int argc, char *argv[] ) /*********************************/ { OPT_STORAGE cmdOpts; CmdLine * cmdLine; int itemsParsed; int rc = RC_NOACTION; /*** Initialize ***/ SetBannerFuncError( BannerMessage ); cmdLine = InitCmdLine( RC_NUM_SECTIONS ); SetDefaultFile( TYPE_RC_FILE, "rc" ); AllowTypeFile( TYPE_RC_FILE, TYPE_INVALID_FILE ); /*** Parse the command line and translate to Watcom options ***/ InitParse( &cmdOpts ); itemsParsed = do_parsing( &cmdOpts ); if( itemsParsed==0 || cmdOpts.help ) { PrintHelpMessage(); exit( EXIT_SUCCESS ); } OptionsTranslate( &cmdOpts, cmdLine ); /*** Spawn the compiler ***/ rc = res_compile( &cmdOpts, cmdLine ); switch( rc ) { case RC_ERROR: exit( EXIT_FAILURE ); break; case RC_NOACTION: FatalError( "Nothing to do!" ); break; case RC_SUCCESS: FiniParse( &cmdOpts ); exit( EXIT_SUCCESS ); break; default: Zoinks(); } }
VOID __cdecl main ( IN int argc, IN char **argv ) { // // Initialize // InitParse (); ParseArgs (argc, argv); InitializeListHead (&VerifyRef); if (!Source) { HelpAndExit (NULL); } printf ("ACPI Souce Language Assembler Version 0.1\n"); printf ("Copyright (C) Microsoft Corp 1996. All rights reserved.\n"); fflush (stdout); // // Build top level scope & ASL data package for which image // can be built in // DataImage = AllocAl(); DataImage->Name = AllocName(); DataImage->Flags |= F_AMLPACKAGE | F_PVARIABLE; DataImage->Term = &ImageTerm; DataImage->Parent = DataImage; DataImage->DataType = TypeRoot; InitializeListHead(&DataImage->FixedList); InitializeListHead(&DataImage->u1.VariableList); DataImage->Name->NameSeg = (ULONG) '\\'; AlLoc = DataImage; // // Parse source // while (Source) { ParseSource (); CloseSource (); } if (Verbose > 1) { printf ("NameSpaceDump:\n"); DumpNameSpace (DataImage->Name, 0); //not valid anymore... //if (Verbose > 2) { // DumpImage(); // printf ("AMLSize %d\n", AMLSize); //} } // // Enable AML for data image, and calculate package sizes // DataImage->Flags |= F_AMLENCODE; WriteDefinitionBlocks (DataImage); // // Remove AML package size from image Al // DataImage->Flags &= ~F_AMLENCODE; DataImage->u.Data.Length = 0; // // ... // Terminate (); }
// Initialize internal variables of the compiler void initialize() { int i; ArmVersion=400; // default ARM version // variables for predefined types halfword_t IntegerTypeNode; halfword_t BooleanTypeNode; halfword_t RealTypeNode; halfword_t PointerTypeNode; // initialization of variables for (i=0;i<NB_FILES;i++) Files[i].f=NULL; iStackPtr=0; // declare that no input file is open HiPoolMin=POOL_SIZE; LoPoolMax=0; InitMem(); // memory initialization InitStrings(); InitHTable(); InitCode(); InitParse(); // read the time start_time=clock(); // initialize initial stack value initial_stack_value=get_stack_value(); // Predefined identifier initialisation NewSymbol("write",sWRITE,0); NewSymbol("writeln",sWRITE,1); NewSymbol("sizeof",sSIZEOF,0); NewConst("true",TBOOLEAN,1); NewConst("false",TBOOLEAN,0); NewConst("maxint",TINTEGER,0x7fffffff); // predefined types IntegerTypeNode=NewType("integer",TINTEGER); BooleanTypeNode=NewType("boolean",TBOOLEAN); RealTypeNode=NewType("real",TREAL); CharTypeNode=NewType("char",TCHAR); PointerTypeNode=NewType("pointer",TPOINTER); NewType("text",TTEXT); NewSymbol("ord", sORDF,0); NewSymbol("pred", sORDF,1); NewSymbol("succ", sORDF,2); NewSymbol("abs",sNUMF,0); NewSymbol("sqr",sNUMF,1); NewSymbol("chr",sCHR,0); NewSymbol("new",sNEW,0); NewSymbol("dispose",sNEW,1); // predefined inlines functions NewInline1("odd",IntegerTypeNode,BooleanTypeNode,-1,1,0xe2100001); NewInline1("sqrt",RealTypeNode,RealTypeNode,-2,2,0xE1A0E00F, // MOV lr,pc 0xE599F000+REALSQRT); NewInline1("round",RealTypeNode,IntegerTypeNode,-4,2,0xE1A0E00F,0xE599F000+REALROUND); NewInline1("trunc",RealTypeNode,IntegerTypeNode,-4,2,0xE1A0E00F,0xE599F000+REALTRUNC); NewInline1("ln",RealTypeNode,RealTypeNode,-4,2,0xE1A0E00F,0xE599F000+REALLN); NewInline1("exp",RealTypeNode,RealTypeNode,-4,2,0xE1A0E00F,0xE599F000+REALEXP); NewInline1("sin",RealTypeNode,RealTypeNode,-4,2,0xE1A0E00F,0xE599F000+REALSIN); NewInline1("cos",RealTypeNode,RealTypeNode,-4,2,0xE1A0E00F,0xE599F000+REALCOS); NewInline1("arctan",RealTypeNode,RealTypeNode,-4,2,0xE1A0E00F,0xE599F000+REALATAN); NewFunc1("halt",IntegerTypeNode,NADA,HALT); NewInlineProc("clrscr",-10,2,0xE1A0E00F,0xE599F000+CLRSCR); InputVar=NewVar("input", TTEXT, -36); OutputVar=NewVar("output", TTEXT, -24); NewSymbol("rewrite",sOPEN,1); NewSymbol("reset",sOPEN,0); NewSymbol("close",sFILEP,CLOSE); NewSymbol("get",sFILEP,GET); NewSymbol("put",sFILEP,PUT); // crt functions NewInline1("wherex",NADA,IntegerTypeNode,-4,2,0xE1A0E00F,0xE599F000+WHEREX); NewInline1("wherey",NADA,IntegerTypeNode,-4,2,0xE1A0E00F,0xE599F000+WHEREY); NewInline1("screenwidth",NADA,IntegerTypeNode,-4,2,0xE1A0E00F,0xE599F000+SCREENWIDTH); NewInline1("screenheight",NADA,IntegerTypeNode,-4,2,0xE1A0E00F,0xE599F000+SCREENHEIGHT); NewInline2("gotoxy",IntegerTypeNode, IntegerTypeNode, -4,2,0xE1A0E00F,0xE599F000+GOTOXY); NewSymbol("read",sREAD,0); NewSymbol("readln",sREAD,1); NewSymbol("eof",sEOF,0); NewSymbol("eoln",sEOF,1); NewFunc1("length",StringTypeNode,IntegerTypeNode,LENGTH); }