\RequirePackage{listings}

\lstdefinelanguage{myjava}{
  keywords={
    abstract,boolean,break,byte,case,catch,char,class,%
    const,continue,default,do,double,else,extends,false,final,%
    finally,float,for,goto,if,implements,import,instanceof,int,%
    interface,label,long,native,new,null,package,private,protected,%
    public,return,short,static,super,switch,this,throw,%
    throws,transient,true,try,void,volatile,while,String},%
  morekeywords={
    [3]synchronized,wait,notify,notifyAll,yield,sleep,join,%
    live,accept,when,become,Incompatible,methods,SyncClass,FuncClass,%
    states,preconditions,MapClass,maps,over,%map,
    Queue,CurrentCall,%
  },%
  sensitive,%
%  alsoletter={+-!*=<>/\%|\&\{\}?},%
%  ndkeywords={/,+,-,!,--,++,*,=,==,!=,<,>,<=,>=,\%,|,||,\&,\&\&,\{,\}},%
  morecomment=[l]//,%
  morecomment=[s]{/*}{*/},%
  morestring=[b]",%
  morestring=[b]',%
}%[keywords,comments,strings]%
\lstset{
  language=myjava,
  keywordstyle=\bfseries,
  ndkeywordstyle=,
  commentstyle=\rmfamily\color{gray},
  extendedchars=true,
  literate={à}{{\`a}}1 {À}{{\`A}}1 {ä}{{\"a}}1 {Ä}{{\"A}}1 {á}{{\'a}}1 {ã}{{\~a}}1 {é}{{\'e}}1 {è}{{\`e}}1 {ë}{{\"e}}1 {Ç}{{\c C}}1 {ç}{{\c c}}1 {€}{\euro}1 {ö}{{\"o}}1 {ü}{{\"u}} 1{Ö}{{\"O}}1 {Ü}{{\"U}}1 {µ}{\textmu}1 {ß}{{\ss}}1  {â}{{\^a}}1 {ê}{{\^e}}1 {ô}{{\^o}}1 {û}{{\^u}}1 {î}{{\^i}}1 {ï}{{\"i}}1,%TODO: add more possibilities
  flexiblecolumns=true,
  showstringspaces=false,
  texcl=true}

\lstdefinestyle{smallframe}{%
  basicstyle=\small\ttfamily,
  backgroundcolor=\color{background},
  frame=single,
  frameround=tttt%
}
\lstdefinestyle{correction}{%
  basicstyle=\small\ttfamily,
%  backgroundcolor=\color{backgroundCorrection},
%  frame=single,
%  rulecolor=\color{red},
%  frameround=tttt%
}
\lstdefinestyle{numbers}{
  numbers=left,
  numbersep=5pt,
  numberstyle=\tiny%
}


