Пример #1
0
        private static bool NextIsCommentBlock(LookAheadLangParser parser)
        {
            if (parser.PeekNextKeyword(0).Equals("/") && (
                    parser.PeekNextKeyword(1).Equals("/") || parser.PeekNextKeyword(1).Equals("*")))
            {
                return(true);
            }

            return(false);
        }
Пример #2
0
        public void ConsumeIfDef(LookAheadLangParser parser)
        {
            Debug.Assert(Preprocessor.NextIsIfdef(parser));

            while (!(parser.PeekNextKeyword().Equals("if") ||
                     parser.PeekNextKeyword().Equals("ifdef") ||
                     parser.PeekNextKeyword().Equals("def")))
            {
                ConumseNextKeyWordSpaceOutput();
            }

            ConumseNextKeyWordSpaceOutput();
        }
Пример #3
0
        public static bool NextIsEndif(LookAheadLangParser parser)
        {
            if (parser.PeekNextKeyword().Equals("#"))
            {
                if (parser.PeekNextKeyword(1).Equals("endif") ||
                    parser.PeekNextKeyword(1).Equals("end"))
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #4
0
        public static bool NextIsEndif(LookAheadLangParser parser)
        {
            if (parser.PeekNextKeyword().Equals("#"))
              {
            if (parser.PeekNextKeyword(1).Equals("endif") ||
            parser.PeekNextKeyword(1).Equals("end"))
            {
              return true;
            }
              }

              return false;
        }
Пример #5
0
        private static string GetDirective(LookAheadLangParser parser)
        {
            if (parser.PeekNextKeyword().Equals("#"))
            {
                int offset = 1;

                while (parser.PeekNextKeyword(offset).Equals(" "))
                {
                    offset++;
                }

                return(parser.PeekNextKeyword(offset));
            }

            throw new UnknownStructureException("Internal pre processor error.");
        }
Пример #6
0
        public static bool NextIsElse(LookAheadLangParser parser)
        {
            if (parser.PeekNextKeyword().Equals("#"))
              {
            string directive = Preprocessor.GetDirective(parser);

            if (directive.Equals("else"))
              return true;
              }

              return false;
        }
Пример #7
0
        public static bool NextIsElse(LookAheadLangParser parser)
        {
            if (parser.PeekNextKeyword().Equals("#"))
            {
                string directive = Preprocessor.GetDirective(parser);

                if (directive.Equals("else"))
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #8
0
        public void ConsumeIfndef(LookAheadLangParser parser)
        {
            Debug.Assert(Preprocessor.NextIsIfndef(parser));

            while (true)
            {
                if (parser.PeekNextKeyword().Equals("ifndef"))
                {
                    break;
                }

                ConumseNextKeyWordSpaceOutput();
            }

            ConumseNextKeyWordSpaceOutput();
        }
Пример #9
0
        public void ConsumeIfDef(LookAheadLangParser parser)
        {
            Debug.Assert(Preprocessor.NextIsIfdef(parser));

              while (!(parser.PeekNextKeyword().Equals("if") ||
              parser.PeekNextKeyword().Equals("ifdef") ||
              parser.PeekNextKeyword().Equals("def")))
              {
            ConumseNextKeyWordSpaceOutput();
              }

              ConumseNextKeyWordSpaceOutput();
        }
Пример #10
0
        private static bool NextIsCommentBlock(LookAheadLangParser parser)
        {
            if (parser.PeekNextKeyword(0).Equals("/") && (
              parser.PeekNextKeyword(1).Equals("/") || parser.PeekNextKeyword(1).Equals("*")))
            return true;

              return false;
        }
Пример #11
0
        private static string GetDirective(LookAheadLangParser parser)
        {
            if (parser.PeekNextKeyword().Equals("#"))
              {
            int offset = 1;

            while (parser.PeekNextKeyword(offset).Equals(" "))
              offset++;

            return parser.PeekNextKeyword(offset);
              }

              throw new UnknownStructureException("Internal pre processor error.");
        }
Пример #12
0
        public void ConsumeIfndef(LookAheadLangParser parser)
        {
            Debug.Assert(Preprocessor.NextIsIfndef(parser));

              while (true)
              {
            if (parser.PeekNextKeyword().Equals("ifndef"))
            {
              break;
            }

            ConumseNextKeyWordSpaceOutput();
              }

              ConumseNextKeyWordSpaceOutput();
        }