Le forum (ô combien francophone) des utilisateurs de Powerbuilder.
Bon, j'ai du me débrouiller tout seul et définir moi-même le langage PB pour la coloration sous LaTeX. Je laisse mon code ici, des fois que ça interresserait quelqu'un.
\lstdefinelanguage{PB} {keywords=[1]{if, then, else, end, loop, while, next, for}, keywords=[2]{string, integer, boolean, true, false, float, int, long}, sensitive=false, morecomment=[l]{//}, morecomment=[s]{/*}{*/}} \lstnewenvironment{PowerBuilder}[1][] {\lstset{language=PB,numbers=none, frame=single,basicstyle=\footnotesize, framexleftmargin=13mm,xleftmargin=12mm, breaklines=true,tabsize=2, backgroundcolor=\color{grey},commentstyle=\color{blue}\textit, keywordstyle=[1]\color{darkgreen}\bfseries, keywordstyle=[2]\bfseries, captionpos=b,showstringspaces=false} }{} \begin{document}
Bien la liste des mots-clé n'est pas exaustive et je la complèterait au fur et à mesure. Mais c'est déjà un bon début je trouve. Il faut aussi posseder le package listings mais il est normalement fourni avec miktex, sinon il est dispo sur tous les serveurs CTAN (listings.sty).
Voilà voilà!
P.S. : J'ai laissé le \begin{document} pour bien montrer qu'il faut placer ce code dans le préambule du document LaTeX
Hors ligne
voici la liste complète des types et mots-clés
// datatypes ------------------------------------------ 'blob', 'boolean', 'byte', 'char', 'character', 'date', 'datetime', 'dec', 'decimal', 'double', 'int', 'integer', 'long', 'longlong', 'real', 'string', 'time', 'uint', 'ulong', 'unsignedint', 'unsignedinteger', 'unsignedlong', // keywords ------------------------------------------ 'alias', 'and', 'autoinstantiate', 'call', 'case', 'catch', 'choose', 'close', 'commit', 'connect', 'constant', 'continue', 'create', 'cursor', 'declare', 'delete', 'describe', 'descriptor', 'destroy', 'disconnect', 'do', 'dynamic', 'else', 'elseif', 'end', 'enumerated', 'event', 'execute', 'exit', 'external', 'false', 'fetch', 'finally', 'first', 'for', 'forward', 'from', 'function', 'global', 'goto', 'halt', 'if', 'immediate', 'indirect', 'insert', 'into', 'intrinsic', 'is', 'last', 'library', 'loop', 'native', 'next', 'not', 'of', 'on', 'open', 'or', 'parent', 'post', 'prepare', 'prior', 'private', 'privateread', 'privatewrite', 'procedure', 'protected', 'protectedread', 'protectedwrite', 'prototypes', 'public', 'readonly', 'ref', 'return', 'rollback', 'rpcfunc', 'select', 'selectblob', 'shared', 'static', 'step', 'subroutine', 'super', 'system', 'systemread', 'systemwrite', 'then', 'this', 'throw', 'throws', 'to', 'trigger', 'true', 'try', 'type', 'until', 'update', 'updateblob', 'using', 'variables', 'where', 'while', 'with', 'within', '_debug'
Hors ligne
Voilà le code mis à jour avec tous les mots clés. Il reste un petit bug à cause du mot-clé update qui prend du coup aussi en compte la méthode update... Si je trouve comment l'exclure j'éditerai mon message
\lstdefinelanguage{PB} {keywords=[1]{alias, and, autoinstantiate, call, case, catch, choose, close, commit, connect, constant, continue, create, cursor, declare, delete, describe, descriptor, destroy, disconnect, do, dynamic, else, elseif, end, enumerated, event, execute, exit, external, false, fetch, finally, first, for, forward, from, function, global, goto, halt, if, immediate, indirect, insert, into, intrinsic, is, last, library, loop, native, next, not, of, on, open, or, parent, post, prepare, prior, private, privateread, privatewrite, procedure, protected, protectedread, protectedwrite, prototypes, public, readonly, ref, return, rollback, rpcfunc, select, selectblob, shared, static, step, subroutine, super, system, systemread, systemwrite, then, this, throw, throws, to, trigger, true, try, type, until, update, updateblob, using, variables, where, while, with, within, \_debug}, keywords=[2]{blob, boolean, byte, char, character, datastore, datawindow, datawindowchlid, date, datetime, dec, decimal, double, int, integer, long, longlong, real, string, time, uint, ulong, unsignedint, unsignedinteger, unsignedlong}, sensitive=false, morecomment=[l]{//}, morecomment=[s]{/*}{*/}} \lstnewenvironment{PowerBuilder}[1][] {\lstset{language=PB,numbers=none, frame=single,basicstyle=\footnotesize, framexleftmargin=13mm,xleftmargin=12mm, breaklines=true,tabsize=2, backgroundcolor=\color{grey},commentstyle=\color{blue}\textit, keywordstyle=[1]\color{darkgreen}\bfseries, keywordstyle=[2]\bfseries, captionpos=b,showstringspaces=false} }{} \begin{document}
Hors ligne