예제 #1
0
    public override bool complete(SSLexLexeme q_lexeme)
    {
        int num = q_lexeme.token();

        if (((0x35 == num) || (0x36 == num)) || (0x37 == num))
        {
            this.m_ColorCoding.ApplyColor(q_lexeme, Color.Green);
            this.m_Comments.Add(new string(q_lexeme.lexeme()));
            return(false);
        }
        if ((0x4f == num) || (80 == num))
        {
            this.m_ColorCoding.ApplyColor(q_lexeme, Color.Red);
        }
        else if ((0x53 == num) || (0x54 == num))
        {
            this.m_ColorCoding.ApplyColor(q_lexeme, Color.Silver);
        }
        else if ((((((0x55 == num) || (0x56 == num)) || ((0x57 == num) || (0x58 == num))) || (((0x59 == num) || (90 == num)) || ((0x5b == num) || (0x5c == num)))) || ((((0x5d == num) || (0x5e == num)) || ((0x5f == num) || (0x60 == num))) || (((0x61 == num) || (0x62 == num)) || ((0x63 == num) || (100 == num))))) || ((((((0x65 == num) || (0x66 == num)) || ((0x67 == num) || (0x68 == num))) || (((0x69 == num) || (0x6a == num)) || ((0x6b == num) || (0x6c == num)))) || ((((110 == num) || (0x6f == num)) || ((0x70 == num) || (0x71 == num))) || (((0x72 == num) || (0x73 == num)) || ((0x74 == num) || (0x75 == num))))) || (((((0x76 == num) || (0x77 == num)) || ((120 == num) || (0x79 == num))) || (((0x7a == num) || (0x7b == num)) || ((0x7c == num) || (0x7d == num)))) || (((0x7e == num) || (0x7f == num)) || ((0x80 == num) || (0x81 == num))))))
        {
            this.m_ColorCoding.ApplyColor(q_lexeme, Color.Blue);
        }
        if (this.m_Comments.Count > 0)
        {
            q_lexeme.Comments = this.m_Comments;
            this.m_Comments   = new List <string>();
        }
        return(true);
    }
예제 #2
0
        public override bool error(int State, SSLexLexeme LookaheadToken)
        {
            Message item = new Message(LookaheadToken)
            {
                Type   = MessageType.Error,
                Source = this.m_Source
            };

            item.Location.Adjust(item.Source.StartLocation);
            if (-1 == LookaheadToken.token())
            {
                item.Text = "End of data reached";
            }
            else
            {
                item.Text = "Syntax error while parsing '" + new string(LookaheadToken.lexeme()) + "'";
                this.m_Source.DrawWigglyLine((LookaheadToken.index() - LookaheadToken.length()) - 1, LookaheadToken.length());
            }
            this.m_Errors.Add(item);
            return(base.syncErr());
        }