%%% languages.tex --- 

%% Author: Giménez, Christian
%% Version: $Id: languages.tex,v 0.0 2016/02/19 03:54:11 christian Exp$

% Copyright 2016 Giménez, Christian
  
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.

% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.

% You should have received a copy of the GNU General Public License
% along with this program.  If not, see <http://www.gnu.org/licenses/>.


%% ----------------------------------------------------------------------
%%
%% Languages for listings pacakge.


%% Javascript, its keywords, strings and comments syntaxis.
\lstdefinelanguage{Javascript}{
  morekeywords={break, case, class, catch, const, continue, debugger, default, delete, do, else, export, extends, finally, for, function, if, import, in, instanceof, new, return, super, switch, this, throw, try, typeof, var, void, while, with, yield},
  classoffset=1,
  morekeywords={null, undefined},keywordstyle={\emph},
  classoffset=0,
  sensitive=true,
  morecomment=[l]{//},
  morecomment=[s]{/*}{*/},
  morestring=[b]",
  morestring=[b]'
}

%% JQuery Dialect.
%%
%% JQuery library addons (it adds some sugar to Javascript).
\lstdefinelanguage[JQuery]{Javascript}[]{Javascript}{
  classoffset=1,
  morekeywords={\$, \_},keywordstyle={\emph},
  classoffset=0,
  sensitive=true,
  morecomment=[l]{//},
  morecomment=[s]{/*}{*/},
  morestring=[b]",
  morestring=[b]'
}

%% Backbone Dialect.
%%
%% Even more sugar to Javascript and JQuery.
%% For example: The "el" keyword on the View definitions.
\lstdefinelanguage[Backbone]{Javascript}[JQuery]{Javascript}{
  classoffset=1,
  morekeywords={el}, keywordstyle={\emph},
  classoffset=0,
  sensitive=true,
  morecomment=[l]{//},
  morecomment=[s]{/*}{*/},
  morestring=[b]",
  morestring=[b]'
}

%% CoffeeScript language.
\lstdefinelanguage{CoffeeScript}{
  morekeywords={if, else, new, return, try, catch,
    finally, throw, break, continue, for, in, while,
    delete, instanceof, typeof, switch, super, extends,
    class, until, loop, case, default, do, function, var, void, with,
    const, let, debugger, enum, export, import, native,
    __extends, __hasProp, then, unless, and, or, is,
    isnt, not, of, by, where, when },
  classoffset=1,
  morekeywords={constructor, null, undefined},keywordstyle={\emph},
  classoffset=0,
  sensitive=true,
  morecomment=[l]{\#},
  morestring=[b]",
  morestring=[b]'
}


%% OWL XML language
\lstdefinelanguage[OWL]{XML}{
  classoffset=2,
  morekeywords={
    % Axioms
    SubClassOf, DisjointClasses, EquivalentClasses, SameIndividual, DifferentIndividuals, SubObjectPropertyOf, EquivalentObjectProperties, InverseObjectProperties, TransitiveObjectProperty, FunctionalObjectProperty, 
    % Constructs
    ObjectIntersectionOf, ObjectUnionOf, ObjectComplementOf, ObjectOneOf, ObjectAllValuesFrom, ObjectSomeValuesFrom, ObjectMaxCaradinallity, ObjectMinCardinallity,
    % Others
    Class}, keywordstyle={\emph},
  classoffset=0,
  sensitive=true,
  morestring=[b]",
  morestring=[b]'
}

%% OWLlink XML language
\lstdefinelanguage[OWLlink]{XML}[OWL]{XML}{
  morekeywords={ %
    %% Requests
    RequestMessage, Tell,
    %% Responses
    ResponseMessage
  }, 
  classoffset=1,
  morekeywords={ %
    %% Requests
    CreateKB, IsKBSatisfiable, IsClassSatisfiable, ReleaseKB, 
    %% Responses
    KB, OK, BooleanResponse
  }, keywordstyle={\sc},
  classoffset=0,
  sensitive=true
}


%% ----------------------------------------------------------------------
%%
%% Styles

\lstdefinestyle{Backbone}{
  language=[Backbone]{Javascript},
  linewidth=\linewidth,
  numbers=left  
}

\lstdefinestyle{HTML}{
  language={HTML},
  linewidth=\linewidth,
  numbers=left,
}

\lstdefinestyle{ApacheConf}{
  language=XML,
  linewidth=\linewidth,
  numbers=left
}

\lstdefinestyle{PHP}{
  language=PHP,
  breaklines=true,
  linewidth=\linewidth,
  numbers=left
}

\lstdefinestyle{OWLlink}{
  language=[OWLlink]{XML},
  breaklines=true,
  linewidth=\linewidth,
  numbers=left  
}

\lstdefinestyle{JSON}{
  language=Javascript,
  breaklines=true,
  linewidth=\linewidth,
  numbers=left
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Cualquier duda ejecutar texdoctk.
%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "wicom.tex"
%%% TeX-PDF-mode: t
%%% coding: utf-8-unix 
%%% End: 
