helpListings package for LaTeX - Support: sr #135, AMPL language definition for...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

sr #135: AMPL language definition for lstlisting

Submitted by:  Brooks Moses <brooks>
Submitted on:  Tue Apr 5 05:10:40 2011  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenOperating System: None

Tue Apr 5 05:10:40 2011, original submission:

Mirko Maischberger writes, on Wed, 7 Nov 2007 16:33:21 +0100:


Hi,
first of all thank you, (and all other authors) for lstlisting package.

I'm writing some slides about AMPL language, one of the most widely
used languages for matematical programming, so I wrote the following
language definition for my personal use, but feel like it could be useful
to (a few) others.

One drawback is that the "subject to" declaration will not be colored, but
luckily there are two synonyms: subjto and s.t. to use in place of the
extended (and spaced) form.

I'll be pleased to see it included in the release, feel free to apply the
license you with.

Mirko maischberger

%%
%% AMPL definition (c) 2007 Mirko Maischberger
%%
\lstdefinelanguage{AMPL}{
alsoletter={.},%
morekeywords={Current,IN,INOUT,Infinity,Initial,LOCAL,OUT,all,binary,%
by,check,complements,contains,default,dimen,div,else,environ,exists,%
forall,if,in,integer,less,logical,max,min,option,setof,shell_exitcode,%
slve_exitcode,solve_message,solve_result,solve_result_num,suffix,sum,%
symbolic,table,then,union,until,while,within,from,to,obj,%
cross,diff,symdiff,inter,%
and,not,or,prod,product},%keywords
morekeywords=[2]{abs,acos,acosh,alias,asin,asinh,atan,atan2,atanh,ceil,%
ctime,cos,exp,floor,log,log10,max,min,precision,round,sin,sinh,sqrt,tan,%
tanh,time,trunc,%
Beta,Cauchy,Exponential,Gamma,Irand224,Normal,Normal101,Poisson,%
Uniform,Uniform01,%
num,num0,ichar,char,length,substr,sprintf,match,sub,gsub,%
card,next,nextw,prev,prevw,first,last,member,ord,ord0,arity,indexarity,%
interval,integer,ordered,circular,coeff,cover},%functions
morekeywords=[3]{set,param,var,arc,minimize,maximize,subject to,%
node,subjto,s.t.},%declarations
morekeywords=[4]{call,cd,check,close,commands,data,delete,display,drop,end,%
environ,exit,expand,fix,include,let,load,model,objective,option,print,%
printf,problem,purge,quit,read,read table,redeclare,reload,remove,reset,%
restore,shell,show,solexpand,solution,solve,update,unfix,unload,write,%
write table,xref},%commands
sensitive=true,%
morecomment=[s]{/}{/},%
morecomment=[l]\#,%
morestring=[d]",%
morestring=[d]'%
}[keywords,comments,strings]%

Brooks Moses <brooks>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by brooks (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray