Difference between revisions of "SciLexer"

From wiki.visual-prolog.com

(Initial)
(No difference)

Revision as of 17:34, 21 November 2012

Template:Preliminary Documentation

The sciLexer provides comprehensive bindings to the Scintilla editor with language lexers. Including a lexer for Visual Prolog code.

The sciLexer is the editor in the IDE, and it is the message window in all applications (unless you explicitly use the deprecated vpiMessage window).

sciLexer internally works in utf-8 meode, but the bindings uses standard Visual Prolog string domain (utf-16).

Lexers

Lexers are used to provide token coloring and region collapsing of for certain (programming) language.

The sciLexer have lexers for over 100 languages, including Visual Prolog.

The lexers for Visual Prolog, C/C++, HTML and XML are in particular easy to use.

You simply call one of the predicates:

predicates
    lexerDefault_visualProlog : ().
    lexerDefault_cpp : ().
    lexerDefault_html : ().
    lexerDefault_xml : ().
    % @short
    % Use lexer and set default styles for the lexer.
    % Before calling this predicate set style_default as desired (for exampel by calling setDefaultLexerStyle)
    % @end

To use other languages it is normally necessary to set the keywords for the language and define colors, etc. for the styles of the language. The code for the predicates mentioned above illustrates how that is done.