示例#1
0
        private int getLigature(Lexer lexer, out string value)
        {
            value = null;
            if (lexer.LastParsedByte != '<')
            {
                return(-1);
            }

            int count = lexer.ReadHexValue();

            if (Lexer.IsEOL(lexer.LastParsedByte))
            {
                lexer.SkipEOL();
            }

            if (count == 1)
            {
                return(lexer.GetLexemeHexByte());
            }
            else if (count == 2)
            {
                return(lexer.GetLexemeHex2Bytes());
            }
            if (count % 2 != 0)
            {
                return(-1);
            }
            value = lexer.GetLexemeHexLigature();
            return(0);
        }
示例#2
0
        private int getChar(Lexer lexer)
        {
            if (lexer.LastParsedByte != '<')
            {
                return(-1);
            }

            int count = lexer.ReadHexValue();

            if (Lexer.IsEOL(lexer.LastParsedByte))
            {
                lexer.SkipEOL();
            }

            if (count == 1)
            {
                return(lexer.GetLexemeHexByte());
            }
            else if (count == 2)
            {
                return(lexer.GetLexemeHex2Bytes());
            }
            return(-1);
        }