Help:Token Coloring

From wiki.visual-prolog.com

Revision as of 08:02, 27 August 2007 by Thomas Linder Puls (talk | contribs) (New page: You can automatically apply token coloring to code written in a large number of programming languages, notably Visual Prolog. ==Visual Prolog Token Coloring== If you write: <nowiki><vi...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

You can automatically apply token coloring to code written in a large number of programming languages, notably Visual Prolog.

Visual Prolog Token Coloring

If you write:

<vip>some Visual Prolog code</vip>

The code will be token colered according to Visual Prolog rules (more or less). For example:

<vip>predicates
     isMember : (Elem Value, Elem* List) determ.
     %@short Succeds is #Value is member of #List.
     %@end
 clauses
     isMember(V, [V|_L]) :- !.
     isMember(V, [_X|L]) :- isMember(V, L).</vip>

The result will look like this:

predicates
    isMember : (Elem Value, Elem* List) determ.
    %@short Succeds is #Value is member of #List.
    %@end
clauses
    isMember(V, [V|_L]) :- !.
    isMember(V, [_X|L]) :- isMember(V, L).

Other Languages

If you write:

<code language="java">/** "ConcreteImplementor" 1/2 */
 class DrawingAPI1 implements DrawingAPI {
    public void drawCircle(double x, double y, double radius) {
      System.out.printf("API1.circle at %f:%f radius %f\n", x, y, radius);
    }
 }</code>

The result will be like this:

/** "ConcreteImplementor" 1/2 */ class DrawingAPI1 implements DrawingAPI {

  public void drawCircle(double x, double y, double radius) {
    System.out.printf("API1.circle at %f:%f radius %f\n", x, y, radius);
  }

}