Example #1
0
        } /* end  */

/* ---------------------------------------------------------------------------
 * private method ParseDiagnostics(sym)
 * ---------------------------------------------------------------------------
 * diagnostics :
 *   ( VERBOSE | LEXER_DEBUG | PARSER_DEBUG | PRINT_SETTINGS
 *     ERRANT_SEMICOLONS )+
 *   ;
 * ------------------------------------------------------------------------ */

        private static ArgumentToken ParseDiagnostics(ArgumentToken sym)
        {
            while (ArgumentLexer.IsDiagnosticsOption(sym))
            {
                switch (sym)
                {
                case ArgumentToken.VERBOSE:
                    CompilerOptions.SetOption(Option.Verbose, true);
                    break;

                case ArgumentToken.LEXER_DEBUG:
                    CompilerOptions.SetOption(Option.LexerDebug, true);
                    break;

                case ArgumentToken.PARSER_DEBUG:
                    CompilerOptions.SetOption(Option.ParserDebug, true);
                    break;

                case ArgumentToken.SHOW_SETTINGS:
                    CompilerOptions.SetOption(Option.ShowSettings, true);
                    break;

                case ArgumentToken.ERRANT_SEMICOLONS:
                    CompilerOptions.SetOption(Option.ErrantSemicolons, true);
                    break;
                } /* end switch */

                sym = ArgumentLexer.NextToken();
            } /* end while*/

            return(sym);
        } /* end ParseDiagnostics */
Example #2
0
        } /* end ParseInfoRequest */

/* ---------------------------------------------------------------------------
 * private method ParseCompilationRequest(sym)
 * ---------------------------------------------------------------------------
 * compilationRequest :
 *   dialect? products? capabilities? sourceFile diagnostics?
 *   ;
 * ------------------------------------------------------------------------ */

        private static ArgumentToken ParseCompilationRequest(ArgumentToken sym)
        {
            if (ArgumentLexer.IsDialectOption(sym))
            {
                sym = ParseDialect(sym);
            } /* end */

            if (ArgumentLexer.IsProductOption(sym))
            {
                sym = ParseProducts(sym);
            } /* end */

            if (ArgumentLexer.IsCapabilityOption(sym))
            {
                sym = ParseCapabilities(sym);
            } /* end */

            if (sym == ArgumentToken.SOURCE_FILE)
            {
                sym = ParseSourceFile(sym);
            }
            else
            {
                ReportMissingSourceFile();
            } /* end if */

            if (ArgumentLexer.IsDiagnosticsOption(sym))
            {
                sym = ParseDiagnostics(sym);
            } /* end */

            return(sym);
        } /* end ParseCompilationRequest */