Using Custom Lexer

Mar 15, 2010 at 7:41 AM

Okay, well im writing a personal lexer because the orginal css lexer doesn't quite do what i need.

I went into SCide and took the INILexer and I planned to get it running before i configure it into a css lexer, the problem is, I cant get it to work

im almost positive Im doing it wrong though because aside from the IniLexer source this is all i Do


private void CSSEditor_Load(object sender, EventArgs e)
        {
            CssLexer.Init(scintilla1);

        }


Mar 15, 2010 at 8:00 AM

Okay, well never mind my stupidity, but now my new problem is, im trying to highlight everything between '{' and '}'

inside of my switch read function i have this


                case '{':
                    StyleUntilMatch(SECTION_STYLE, new char[] { '}' });
                    StyleCh(SECTION_STYLE);
                    StyleUntilMatch(SECTION_STYLE, new char[] { '}' });
                 break;


Im not seeing whats wrong

Mar 15, 2010 at 6:13 PM

sooooo, does anyone know where the css built in lexer is configured?

Coordinator
Mar 19, 2010 at 3:46 AM

I'm sorry, you lost me.... are you trying to create a custom CSS lexer or use the built-in CSS lexer?

 

Thanks,

Jacob

Mar 19, 2010 at 9:23 PM

Im trying to write my own custom Lexer for CSS but im not really sure where to start

i tried basing it on the INI lexer but its not working

also another question, im using regex to remove everything between the brackets

like this

cssclass
{
background-color:blue;
}

csscl
{
background-color:red;
}


convert into this

cssclass
csscl


but theres a bunch of whitespace in between it

Coordinator
Mar 23, 2010 at 6:23 PM

The INI lexer included in SCide is meant as a starting point for writing a custom lexer, but not a definitive guide.

It sounds like you're struggling to write your own lexer/parser logic using regular expressions or something else. I may be able to assist with that but you have to understand that we can only provide support for ScintillaNET and not custom lexers.

If you still think this is an issue we can assist you with please post your lexer code or send it to us privately so that I can get a better understanding of the situation.

Thanks,
Jacob