Example #1
0
        public override Lexem ReadNextLexem(ParseIterator iterator)
        {
            var word  = new WordParserState();
            var lexem = word.ReadNextLexem(iterator);

            lexem.Type = LexemType.Annotation;
            return(lexem);
        }
Example #2
0
        public override Lexem ReadNextLexem(ParseIterator iterator)
        {
            System.Diagnostics.Debug.Assert(iterator.CurrentSymbol == SpecialChars.Directive);
            iterator.MoveNext();
            if (!iterator.MoveToContent())
            {
                throw CreateExceptionOnCurrentLine("Ожидается директива", iterator);
            }


            var wps = new WordParserState();
            var lex = wps.ReadNextLexem(iterator);

            if (lex.Type == LexemType.Identifier && lex.Token == Token.NotAToken)
            {
                lex.Type = LexemType.Directive;
            }
            else
            {
                throw CreateExceptionOnCurrentLine("Ожидается директива", iterator);
            }

            return(lex);
        }
Example #3
0
        public override Lexem ReadNextLexem(ParseIterator iterator)
        {
            System.Diagnostics.Debug.Assert(iterator.CurrentSymbol == SpecialChars.Directive);
            iterator.MoveNext();
            if (!iterator.MoveToContent())
                throw CreateExceptionOnCurrentLine("Ожидается директива", iterator);


            var wps = new WordParserState();
            var lex = wps.ReadNextLexem(iterator);
            if (lex.Type == LexemType.Identifier && lex.Token == Token.NotAToken)
            {
                lex.Type = LexemType.Directive;
            }
            else
                throw CreateExceptionOnCurrentLine("Ожидается директива", iterator);

            return lex;
        }