コード例 #1
0
 internal void pushTokenStreamInput(TokenStream ts)
 {
     pushInput(new TokenInput(this, ts));
     ts.Rewind();
 }
コード例 #2
0
        internal TokenStream PrescanMacroArg(TokenStream a, PreprocessorToken ppToken, bool newLineOkay)
        {
            int token;
            a.Rewind();
            do {
                token = ReadToken(a, ppToken);
                if (token == (int) CppEnums.IDENTIFIER && Symbols.LookUp(ppToken.atom) != null)
                    break;
            } while (token != BasePreprocessorInput.END_OF_INPUT);

            if (token == BasePreprocessorInput.END_OF_INPUT)
                return a;

            TokenStream n = new TokenStream ();
            pushInput(new MarkerInput(this));
            pushTokenStreamInput(a);
            while ((token = scanToken(ref ppToken)) != MarkerInput.marker) {
                if (token == (int) CppEnums.IDENTIFIER && MacroExpand(ppToken.atom, ppToken, false, newLineOkay) != 0)
                    continue;
                Symbols.Atoms.RecordToken(n, token, ppToken);
            }
            popInput();

            return n;
        }