To jest stara wersja strony!


Opis

PrologEns

Kolorowanie składni języka Prolog dla GNU Enscript. Patrz realizacja dla GeSHi.

Spotkania

080408

przydzielenie projektu

Projekt

Poniżej zamieszczam wyniki wykonania projektu kolorowania składni języka Prolog w GNU Enscript.

 /**
 * Name: prolog
 * Description: Prolog (PROgramming in LOGic) programming language.
 * Author: Pawel Marek <p.marek@student.agh.edu.pl>
 */

state prolog extends HighlightEntry
{
  /* Comments. */
  /\/\*/ {
    comment_face (true);
    language_print ($0);
    call (c_comment);
    comment_face (false);
  }
  
  /* Comments. */
  /%/ {
    comment_face (true);
    language_print ($0);
    call (eat_one_line);
    comment_face (false);
  }
  
  /* String constants. */
  /'/ {
    string_face (true);
    language_print ($0);
    call (prol_string);
    string_face (false);
  }
  
  /* String constants. */
  /\"/ {
    string_face (true);
    language_print ($0);
    call (c_string);
    string_face (false);
  }
  
  /* Symbols. */
  /+|-|*|\/|\\\\|\^|<|>|=|~|:|\.|,|?|@|#|\$|&/ {
    keyword_face (true);
    language_print ($0);
    keyword_face (false);
  } 
  
  /* Brackets. */
  /\[|\]|\(|\)/ {
    function_name_face (true);
    language_print ($0);
    function_name_face (false);
  }
  
  /* Predicates. */
  /([A-Z])([a-zA-Z0-9]*)/ {
    bold (true);
    language_print ($0);
    bold (false);
  }
  
  /* Numbers. */
  /([0-9])/ {
    type_face (true);
    language_print ($0);
    type_face (false);
  }
}


state prol_string extends Highlight
{
  /\\\\./ {
    language_print ($0);
  }
  /'/ {
    language_print ($0);
    return;
  }
}


/*
Local variables:
mode: c
End:
*/

Sprawozdanie

Materiały

pl/miw/miw08_prologens.1225645034.txt.gz · ostatnio zmienione: 2019/06/27 15:58 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0