1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
26 static RscCompiler
* pRscCompiler
= NULL
;
27 #if defined( UNX ) || defined ( __GNUC__ ) || defined(__MINGW32__)
28 void ExitProgram( void ){
30 void cdecl ExitProgram( void ){
36 static RscVerbosity
lcl_determineVerbosity( int argc
, char ** argv
)
38 for ( int i
= 0; i
< argc
; ++i
)
40 if ( argv
[i
] == NULL
)
42 if ( rsc_stricmp( argv
[i
], "-verbose" ) == 0 )
43 return RscVerbosityVerbose
;
44 if ( rsc_stricmp( argv
[i
], "-quiet" ) == 0 )
45 return RscVerbositySilent
;
47 return RscVerbosityNormal
;
50 int rsc2_main( int argc
, char **argv
)
53 atexit( ExitProgram
);
55 #if OSL_DEBUG_LEVEL > 1
56 fprintf( stderr
, "debugging %s\n", argv
[0] );
62 RscError
* pErrHdl
= new RscError( lcl_determineVerbosity( argc
, argv
) );
63 RscCmdLine
* pCmdLine
= new RscCmdLine( argc
, argv
, pErrHdl
);
64 RscTypCont
* pTypCont
= new RscTypCont( pErrHdl
,
67 pCmdLine
->nCommands
);
69 if( pErrHdl
->nErrors
)
72 RscCompiler
* pCompiler
= new RscCompiler( pCmdLine
, pTypCont
);
74 pRscCompiler
= pCompiler
;
75 aError
= pCompiler
->Start();
84 delete pHS
; // wird durch InitRscCompiler erzeugt
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */