diff --git a/Makefile b/Makefile index b7828dd..24583bd 100644 --- a/Makefile +++ b/Makefile @@ -69,15 +69,15 @@ PRINT = \ console.c\ string.c\ +# make a print, but the resulting xv6.ind need some editing print: $(PRINT) - //~/src/lgrind/source/lgrind -d ~/src/lgrind/lgrindef $(PRINT) > xv6.tex - lgrind $(PRINT) > xv6.tex + lgrind -d ./lgrindef $(PRINT) > xv6.tex + latex xv6.tex + makeindex xv6.idx latex xv6.tex dvips -o xv61.ps xv6.dvi psnup -2 xv61.ps > xv6.ps rm -f xv61.ps -// a2ps --line-numbers=1 -M Letter $(PRINT) -o xv6.ps -// a2ps --line-numbers=1 -M Letter $(PRINT) --toc -atoc -o xv6toc.ps vectors.S : vectors.pl perl vectors.pl > vectors.S @@ -137,7 +137,7 @@ fs.img : mkfs userfs usertests echo cat readme init sh ls mkdir rm fstests -include *.d clean : - rm -f *.ps *.tex *.dvi *.idx *.aux .log \ + rm -f *.ps *.tex *.dvi *.idx *.aux *.log *.ind *.ilg \ *.o *.d *.asm vectors.S parport.out \ bootblock kernel xv6.img user1 userfs usertests \ fs.img mkfs echo init fstests diff --git a/lgrindef b/lgrindef new file mode 100644 index 0000000..cfe979b --- /dev/null +++ b/lgrindef @@ -0,0 +1,849 @@ +# Database of program templates for lgrind +# $Id: lgrindef,v 1.1 2006/09/03 14:38:10 kaashoek Exp $ + +Ada:\ + :pb=(^\d?procedure|function\d\p\d|\():\ + :np=;\d?$:id=_.:\ + :bb=\d(begin|case|do|if|loop|select)\d:be=\dend\d|;:\ + :rb=(\=|\:|\d|^)(protected|record):\ + :oc:\ + :cb=--:ce=$:ab=--:ae=$:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :sb=":se=":lb=':le=':\ + :kw=abort abs accept access aliased all and array at begin body case\ + constant declare delay delta digits do else elsif end entry exception exit\ + for function generic goto if in is limited loop mod new not null of or\ + others out package pragma private procedure protected raise range record\ + rem renames requeue return reverse select separate subtype tagged task\ + terminate then type until use when while with xor: + +Asm:\ + :oc:\ + :cb=#:ce=$:ab=/*:ae=*/:\ + :sb=':se=':lb=":le=":\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=ascii block byte end equ globl text data word even long\ + #else #endif #if #ifdef #ifndef #include #undef #define else endif\ + if ifdef ifndef include undef define: + +Asm68:\ + :pb=(^\d?.proc\d\p\d:\ + :oc:\ + :cb=;:ce=$:\ + :sb=':se=':lb=":le=":\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=ascii block byte end equ include long proc word: + +# JL - Added QBASIC Aug 95 +BASIC:\ + :pb=^\d?*?\d?\p\d?\(\a?\)(\d|{):bb={:be=}:\ + :cb=':ce=$:sb=":se=":\ + :le=\e':tl:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw= ABS APPEND ABSOLUTE AS ACCESS ASC AND ATN ANY \ + BASE BLOAD BEEP BSAVE BINARY \ + CALL COLOR CALL ABSOLUTE COM CASE COMMON CDBL CONST\ + CHAIN COS CHDIR CSNG CHR$ CSRLIN CINT CVD CIRCLE CVDMBF\ + CLEAR CVI CLNG CVL CLOSE CVS CLS CVSMBF \ + DATA DEFLNG DEFSNG DATE$ DEFSTR DATE$ DIM DECLARE DO LOOP\ + DEF FNDOUBLE DEF SEG DRAW DEFDBL $DYNAMIC DEFINT \ + ELSE ERDEV ELSEIF ERDEV$ END ERL ENVIRON ERR ENVIRON$ \ + ERROR EOF EXIT EQV EXP ERASE \ + FIELD FOR NEXT FILEATTR FRE FILES FREEFILE FIX FUNCTION\ + GET GOSUB GET GOTO \ + HEX$ IF THEN ELSE INSTR IMP INT INKEY$ INTEGER \ + INP IOCTL INPUT IOCTL$ INPUT$ IS \ + KEY KILL KEY \ + LBOUND LOCK UNLOCK LCASE$ LOF LEFT$ LOG LEN LONG LET LOOP\ + LINE LPOS LINE INPUT LPRINT LIST LPRINT USING LOC LSET LOCATE LTRIM$\ + MID$ MKI$ MID$ MKL$ MKD$ MKS$ MKDIR MKSMBF$ MKDMBF$ MOD \ + NAME NOT NEXT \ + OCT$ ON TIMER OFF ON GOSUB ON COM ON GOTO ON ERROR OPEN \ + ON OPEN COM ON KEY OPTION BASE ON PEN OR ON PLAY OUT ON STRIG OUTPUT \ + PAINT POINT PALETTE POKE PCOPY POS PEEK PRESET PEN PRINT \ + PEN PRINT USING PLAY PSET PLAY PUT PLAY PUT PMAP \ + RANDOM RETURN RANDOMIZE RIGHT$ READ RMDIR REDIM RND REM RSET RESET \ + RTRIM$ RESTORE RUN RESUME \ + SCREEN SQR STATIC SEEK $STATIC SEEK STEP SELECT CASE STICK SGN STOP \ + SHARED STR$ SHELL STRIG SIN STRIG SINGLE STRING SLEEP STRING$ \ + SOUND SUB SPACE$ SWAP SPC SYSTEM \ + TAB TIMER TAN TO THEN TROFF TIME$ TRON TIME$ TYPE TIMER \ + UBOUND UNTIL UCASE$ USING UNLOCK \ + VAL VARSEG VARPTR VIEW VARPTR$ VIEW \ + WAIT WIDTH WEND WINDOW WHILE WEND WRITE \ + XOR : + +# DOS Batch file language description for the LGrind pretty-printer +# Jim Green 11/15/96 Notice that the tex block +# is a triple-precent rather than a double, and that `program text +# within a comment' also has an added percent (to avoid conflicts with +# environmental variables and `@echo off' statements respectively). +# This assumes that it is possible to write a batch file sufficiently +# complex to need such explanation. +Batch|bat:\ + :pb=^\d?\:\p\d?$:\ + :cb=rem :ce=$:\ + :sb=echo:se=$:\ + :zb=%@:ze=%@:tb=%%%:te=%%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=call do echo @echo exist for goto if in not pause rem shift: + +C:\ + :pb=\p\d?\(:cf:np=\)\d?;:bb={:be=}:\ + :cb=/*:ce=*/:sb=":se=\e":lb=':le=\e':\ + :tl:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=asm auto break case cdecl char continue default do double else\ + enum extern far float for fortran goto huge if int interrupt long\ + near pascal register return short signed sizeof static struct\ + switch typedef union unsigned void while\ + #define #else #endif #if #ifdef #ifndef #include #undef # define\ + else endif if ifdef ifndef include undef #pragma #elif pragma elif\ + #module #dictionary module dictionary\ + variant_struct variant_union\ + noshare readonly globaldef globalref globalvalue main_program: +#Last couple of lines are partial ANSI, plus VAX-C specific + +C++|CC:\ + :pb=\p\d?\(:cf:np=\)\d?;:bb={:be=}:\ + :cb=/*:ce=*/:ab=//:ae=$:sb=":se=\e":lb=':le=\e':\ + :tl:id=_~\::\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=and and_eq asm auto bitand bitor bool break case catch char class\ + compl const const_cast continue default delete do double dynamic_cast\ + else enum explicit export extern false float for friend goto if inline\ + int long mutable namespace new not not_eq operator or or_eq private\ + private\: protected protected\: public public\: register\ + reinterpret_cast return short signed sizeof static static_cast struct\ + switch template this throw true try typedef typeid typename union\ + unsigned using virtual void volatile wchar_t while xor xor_eq\ + static_cast const_cast dynamic_cast reinterpret_cast\ + #define #else #endif #if #ifdef #ifndef #include #undef #pragma #\ + define else endif if ifdef ifndef include undef defined: + +csh:\ + :bb={:be=}:cb=#:ce=$:sb=":se=\e":lb=':\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :le=\e':tl:\ + :kw=alias alloc break breaksw case cd chdir continue default\ + echo else end endif endsw exec exit foreach \ + glob goto history if logout nice nohup onintr repeat set\ + setenv shift source switch then time \ + while umask unalias unset wait while @ env \ + argv child home ignoreeof noclobber noglob \ + nomatch path prompt shell status verbose : + +FORTRAN|f77|f:\ + :pb=(function|subroutine|program)\d\p\d?\(\a?\):\ + :bb=(function|subroutine|program)\d\p\d?\(\a?\):be=^\dend\d:\ + :cb=^(c|C|*):ce=$:\ + :sb=':se=':\ + :oc:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=call character close common complex continue data dimension do\ + double else elseif end enddo endif entry equivalence format function\ + goto if implicit include integer logical open pause parameter print\ + precision program read real return stop subroutine then write\ + gt ge lt le eq ne and or not false true: +# The last should contain a lot more periods. But LGrind's parser doesn't like +# them. So you can't use 'gt' as identifier. (Who would want to, anyway?) + +Gnuplot:\ + :pb=\d?\p\(\a\)=:\ + :cb=#:ce=$:\ + :sb=("|'):se=("|'):\ + :zb=@:ze=@:\ + :tb=%%:te=%%::mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=cd clear exit load pause plot pwd quit replot save set showsplot\ + title using with: + +Icon:\ + :pb=^\d?procedure\d\p\d?\(\a?\):\ + :bb=(^\d?procedure\d\p\d?\(\a?\))|{:be=}|(^\d?end\d?$):\ + :cb=#:ce=$:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :sb=":se=\e":lb=':le=\e':tl:\ + :kw=break by case create default do dynamic else end every external\ + fail global if initial local next not of procedure record\ + repeat return static suspend then to until using while\ + &ascii &clock &cset &date &dateline &errout &fail &host &input\ + &lcase &level &main &null &output &pos &random &source &subject\ + &time &trace &ucase &version: + +# Written by Diego Berrueta +IDL:\ + :pb=\p\d?\(:cf:np=\)\d?;:bb={:be=}:\ + :cb=/*:ce=*/:ab=//:ae=$:sb=":se=\e":lb=':le=\e':\ + :tl:id=_~\::\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=abstract any attribute boolean case char const context \ + custom default double exception enum factory FALSE fixed float \ + in inout interface local long module native Object\ + octet oneway out private public raises readonly sequence short \ + string struct supports switch TRUE truncatable typedef unsigned \ + union ValueBase valuetype void wchar wstring\ + #define #else #endif #if #ifdef #ifndef #include #undef #pragma #\ + define else endif if ifdef ifndef include undef defined: + +ISP:\ + :cb=!:ce=!|$:oc:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=and begin decode define end eql eqv geq gtr if leave leq lss mod\ + neq next not or otherwise repeat restart resume sr0 sr1 srd\ + srr sl0 sl1 sld slr tst xor: + +Java:\ + :pb=\p\d?\(:cf:np=\)\d?;:bb={:be=}:\ + :cb=/*:ce=*/:ab=//:ae=$:sb=":se=\e":lb=':\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :le=\e':tl:id=_~\:\ + :kw=abstract boolean break byte byvalue case catch char class const\ + continue default do double else extends false final finally float for goto\ + if implements import instanceof int interface long native new null package\ + private protected public return short static super switch synchronized this\ + throw throws true try void volatile while: +# Somewhere these come from, but they are not in my Java book. +# :kw=cast future generic inner rest transient var: + + +Kimwitu++|kimw:\ + :pb=\p\d?\(:cf:np=\)\d?;:bb={:be=}:\ + :cb=/*:ce=*/:ab=//:ae=$:sb=":se=\e":lb=':le=\e':\ + :tl:id=_~\::\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=and and_eq asm auto bitand bitor bool break case catch char class\ + compl const const_cast continue default delete do double dynamic_cast\ + else enum explicit export extern false float for foreach friend goto\ + if inline int long mutable namespace new not not_eq operator or or_eq\ + private private\: protected protected\: provided public public\:\ + register reinterpret_cast return rview short signed sizeof static\ + static_cast struct switch template this throw true try typedef typeid\ + typename union unsigned using uview virtual void volatile wchar_t\ + while with xor xor_eq\ + static_cast const_cast dynamic_cast reinterpret_cast\ + #define #else #endif #if #ifdef #ifndef #include #undef #pragma #\ + define else endif if ifdef ifndef include undef defined: + +# JL - Jan 96 Added LaTeX +# JL - May 96 LaTeX-2e additions +LaTeX:\ + :tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :cb=%:ce=$:kw=\ + abstract addcontentsline addtocontents addtocounter address addtolength \ + addvspace alph appendix arabic array article author begin bf bfseries \ + bibitem bigskip book \ + cdots center centering circle cite cleardoublepage clearpage \ + cline closing color colorbox dashbox date ddots definecolor description \ + displaymath document documentclass documentstyle dotfill em emph end \ + enumerate eqnarray equation fbox fcolorbox figure flushbottom flushleft \ + flushright fnsymbol footnote footnotemark footnotesize footnotetext frac \ + frame framebox hfill hline hhline hrulefill hspace huge Huge hyphenation \ + include includeonly indent input it itemize itshape kill label large \ + Large LARGE ldots letter line linebreak linethickness list location \ + makebox maketitle mark mbox mdseries medskip minipage multicols \ + multicolumn multiput newcommand newcounter newenvironment newfont \ + newlength newline newpage newsavebox newtheorem nocite noindent \ + nolinebreak normalfont normalsize nopagebreak onecolumn opening oval \ + overbrace overline pagebreak pagecolor pagenumbering pageref pagestyle \ + par parbox picture put quotation quote raggedbottom raggedleft \ + raggedright raisebox ref report resizebox rm rmfamily roman rotatebox \ + rule savebox sc scriptsize setcounter setlength settowidth scalebox \ + sf sffamily shortstack signature sl slshape small smallskip sqrt \ + tabbing table tabular telephone \ + textbf textit textmd textrm textsc textsf textsl texttt textup \ + thanks thebibliography theorem thispagestyle tiny title titlepage \ + tt ttfamily twocolumn typeout typein \ + underbrace underline upshape usebox usecounter usepackage \ + value vdots vector verb \ + verbatim verse vfill vline vspace : + +LDL:\ + :pb=^\p\::bb=\::be=;:cb=/*:ce=*/:sb=":se=\e":\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=constant functions grammar reswords tokens add1 addste\ + car cdr check colno cond cons copy defun divide empty enter\ + eq equal findattr firstchild ge getattr getfield gt hash label\ + lambda lastchild le leftsibling lookone lookup lt minus name ne\ + newnode nextcom nil null parent plus precnl prevcom prog progn\ + quote reglob return rightsibling self set setattr setfield setq\ + stjoin sub1 t times tnull tokno ttype: + +Lex:\ + :lb=[|':le=]|\e':tc=C++: + +#Linda is just like C, with a couple of extra keywords. Note: The non- +#blocking operations are included, as are the pre-defined VAX Linda-C macros. +Linda:\ + :pb=^\d?*?\d?\p\d?\(\a?\)(\d|{):bb={:be=}:\ + :cb=/*:ce=*/:sb=":se=\e":lb=':\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :le=\e':tl:\ + :kw=asm auto break case char continue default do double else enum\ + extern float for fortran goto if int long register return short\ + sizeof static struct switch typedef union unsigned void while #define\ + #else #endif #if #ifdef #ifndef #include #undef # define else endif\ + if ifdef ifndef include undef\ + #pragma #elif pragma elif #line\ + #module #dictionary module dictionary\ + variant_struct variant_union\ + noshare readonly globaldef globalref globalvalue main_program\ + in inp rd rdp out eval newtype varying nchar\ + $ARR $ARRAY $ARRAY_TYPE $MAKE_ARRAY\ + $STR $STRING $STRING_TYPE $SET_DIM $MAKE_STRING\ + #ttcontext ttcontext: + +make:\ + :cb=#:ce=$:\ + :sb=':se=':lb=":le=":\ + :id=-_:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=define endef ifeq ifneq else endif include override export unexport vpath\ + subst patsubst strip findstring filter filter-out sort dir notdir suffix basename\ + addsuffix addprefix join word words firstword wildcard shell origin foreach: + +# JL - 'masm' (Microsoft Assembler) by way of +# modification of 'asm' style provided above. +# The instructions are *not* defined as keywords here. +MASM:\ + :oc:\ + :cb=;:ce=$:ab=/*:ae=*/:\ + :sb=':se=':lb=":le=":\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=ascii block globl even long\ + 286 386 486 \ + code data dosseg end endp equ \ + huge large medium model proc small stack tiny title : + +# JL - Added MATLAB Jan 96 +# Note: the string delimiter ' is also used as a transpose operator +# causing the rest of the line to be interpreted as a string. +MATLAB:\ + :pb=^\d?*?\d?\p\d?\(\a?\)(\d|{):bb={:be=}:\ + :cb=%:ce=$:sb=':se='|$|;:\ + :le=\e':tl:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw= \ + abs acos acosh acot acoth acsc acsch \ + airfoil all andrew angle angle ans any arith \ + asec asech asin asinh atan atan2 atanh auread \ + auwrite axes axis balance bar bartlett bench bessel \ + bessela besselap besself besseli besselj besselk bessely beta \ + betacore betainc betaln bilinear blackman blanks blt bone \ + boxcar break brighten bucky buttap butter buttonv buttord \ + cart2pol cart2sph caxis cceps cd cdf2rdf cedit ceil \ + census censusex cheb1ap cheb1ord cheb2ap cheb2ord chebwin cheby1 \ + cheby2 choices choicex chol cinvert cla clabel clc \ + clear clf clg clock close cohere colmmd colon \ + colormap colormenu colperm colstyle comet comet3 compan compass \ + computer cond condest conj contour contour3 contourc contrast \ + conv conv conv2 conv2 convmtx cool copper corrcoef \ + corrcoef cos cosh cot coth cov cov cplxdemo \ + cplxgrid cplxmap cplxpair cplxpair cplxroot cputime cross csc \ + csch csd cumprod cumsum cylinder czt cztdemo d \ + datalist date dbclear dbcont dbdown dbquit dbstack dbstatus \ + dbstep dbstop dbtype dbup dc2sc dct deblank debug \ + dec2hex decimate deconv deconv del2 delete delsq delsqdemo \ + delsqshow demo demod det detrend dftmtx diag diary \ + diff dir diric disp dmperm dos drawnow earthex \ + earthmap echo eig eigmovie ellip ellipap ellipj ellipk \ + ellipke ellipord else elseif end eps erf erfc \ + erfcore erfcx erfinv error errorbar etime etree etreeplot \ + eval exist exp expm expm1 expm2 expm3 eye \ + fclose feather feof ferror feval fft fft fft2 \ + fft2 fftdemo fftfilt fftshift fftshift fftshift fgetl fgets \ + figtext figure fill fill3 filtdemo filter filter filter2 \ + filtfilt filtic find findstr finite fir1 fir2 firls \ + fitdemo fitfun fix flag fliplr flipud floor flops \ + fmin fmins fopen foptions for format fourier fplot \ + fplotdemo fprintf fread freqs freqspace freqz frewind fscanf \ + fseek ftell full function funm fwrite fzero gallery \ + gamma gammainc gammaln gca gcd gcf get getenv \ + getframe ginput global gplot gradient gray graymon grid \ + griddata grpdelay gtext hadamard hamming hankel hanning hardcopy \ + help hess hex2dec hex2num hidden highlight hilb hilbert \ + hint hist hold home hostid hot hsv hsv2rgb \ + humps i icubic idct ident if ifft ifft \ + ifft2 ifft2 iffuse imag image imagedemo imageext imagesc \ + impinvar impz imread imtext imwrite inf info input \ + inquire int2str interp interp1 interp1 interp2 interp3 interp4 \ + interp5 interpft intfilt intro inv inverf invfreqs invfreqz \ + invhilb isempty isglobal ishold isieee isinf isletter isnan \ + issparse isstr isunix j jet kaiser keyboard knot \ + kron lalala lasterr lcm legend length levinson life lifeloop \ + lin2mu line linspace load loadwave log log10 log2 \ + loglog logm logspace lookfor lorenz lorenzeq lotka lower \ + lp2bp lp2bs lp2hp lp2lp lpc ls lscov lu \ + magic man mathlist matlabro max mean medfilt1 median \ + membrane memory menu mesh meshc meshdom meshgrid meshz \ + meta min mkpp mmove2 moddemo modulate more movie \ + moviein mu2lin nalist nan nargchk nargin nargout nestdiss \ + nested newplot nextpow2 nnls nnz nonzeros norm normest \ + null num2str numgrid nzmax ode23 ode23p ode45 odedemo \ + ones orient orth pack paren pascal patch path \ + pause pcolor peaks penny pi pink pinv planerot \ + plot plot3 pol2cart polar poly poly2rc polyder polyfit \ + polyline polymark polystab polyval polyvalm pow2 ppval print \ + printopt prism prod prony psd punct puzzle pwd \ + qr qrdelete qrinsert quad quad8 quad8stp quaddemo quadstp \ + quake quit quiver qz rand randn randperm rank \ + rat rats rbbox rc2poly rceps rcond readme real \ + realmax realmin relop rem remez remezord resample reset \ + reshape resi2 residue residuez return rgb2hsv rgbplot rjr \ + roots rose rosser rot90 round rref rrefmovie rsf2csf \ + save savewave sawtooth saxis sc2dc schur script sec \ + sech semilogx semilogy sepdemo sepplot set setstr shading \ + shg showwind sig1help sig2help sigdemo1 sigdemo2 sign sin \ + sinc sinh size slash slice sort sos2ss sos2tf \ + sos2zp sound sounddemo soundext spalloc sparlist sparse sparsfun \ + sparsity spaugment spconvert spdiags specgram specials spectrum specular \ + speye spfun sph2cart sphere spinmap spiral spline spline \ + spline2d spones spparms sprandn sprandsym sprank sprintf spy \ + spypart sqdemo sqrt sqrtm square ss2sos ss2tf ss2zp \ + sscanf stairs std stem stem stmcb str2mat str2num \ + strcmp strings strips subplot subscribe subspace sum sunspots \ + superquad surf surface surfc surfl surfnorm svd swapprev \ + symbfact symmmd symrcm table1 table2 tan tanh tempdir \ + tempname terminal text tf2ss tf2zp tfe tffunc tic \ + title toc toeplitz trace trapz treelayout treeplot triang \ + tril triu type uicontrol uigetfile uimenu uiputfile uisetcolor \ + uisetfont unix unmesh unmkpp unwrap unwrap upper vander \ + vco ver version vibes view viewmtx waterfall what \ + whatsnew which while white whitebg who whos why \ + wilkinson xcorr xcorr2 xcov xlabel xor xyzchk ylabel \ + yulewalk zerodemo zeros zlabel zp2sos zp2ss zp2tf zplane : + +# Courtesy of Dominique de Waleffe (ddw@miscrit.be) +Mercury:\ + :bb=\:-:be=.:cb=%:ce=$:ab=/*:ae=*/:\ + :zb=@:ze=@:tb=%*%:te=%*%:mb=%*\$:me=\*$%:vb=%*\|:ve=\|*%:\ + :sb=":se=\e":lb=':le=\e':oc:\ + :kw=pred type module import_module mode \:\: -> --> ---> \:-\ + pragma func lambda det semidet multi cc_multi failure nondet\ + true fail is in out di uo ui interface implementation: + +# This entry makes use of new capabilities added to support the description +# of lisp-like languages (id, pl, and px). The set of keywords given is a +# matter of taste. It would be reasonable to add all the wired functions to +# the list. +MLisp|Emacs Mock Lisp:\ + :cb=;:ce=$:lb=':le=\e':sb=":se=\e":bb=\(:be=\):\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :id=_-$#@./,%&?!^*+~`|;<>'\::\ + :kw=defun if progn while:pl:px=\d\(defun:pb=^\d\(\p($|(\d\a$)): + +SML/NJ:ML:\ + :cb=\(\*:ce=\*\):\ + :pb=fun:\ + :id=_':\ + :lb=(#)":le=":sb=":se=\e":\ + :kw=fun let in end if then else andalso orelse and val fun structure\ + exception infix infixr nonfix type abstype datatype withtype with\ + local rec open use sig eqtype functor signature handle raise fn while\ + do case of as \:\: ... => -> |: + +# Scheme has a funky character quoting mechanism, 'a' in C is #\a in +# Scheme. Lgrind doesn't deal with this well. I tried a few different +# things, and decided the best option was to punt. +Scheme|scm:\ + :cb=;:ce=$:\ + :lb=(#):le=(\\):\ + :sb=":se=\e":\ + :id=_-$#@./,%&?!^*+~`|;<>'\::\ + :pb=\(define\d\(:\ + :kw=define lambda let: + +model:\ + :pb=^\d(space\d\p\drep)|(\p\dis|inline|public\dbeginproc):\ + :bb=\dbeginproc|space|case\d:be=\dendproc|end\d|;:\ + :cb=\$:ce=\$|$:sb=":se=":lb=':le=\a|$:\ + :kw=abs and array beginproc boolean by case cdnl char copied dispose\ + div do dynamic else elsif end endproc entry external FALSE false\ + fi file for formal fortran global if iff ift\ + in integer include inline is lbnd\ + max min mod new NIL nil noresult not notin od of or procedure public\ + read readln readonly record recursive rem rep repeat res\ + result return set\ + space string subscript such then TRUE true type ubnd union until\ + varies while width: + +Modula2|mod2|m2:\ + :pb=(^\d?(PROCEDURE|MODULE)\d\p\d|\(|;|\:)|(=|\:\d?RECORD\d):\ + :np=FORWARD:id=_.:\ + :bb=\d(BEGIN|CASE|FOR|IF|LOOP|WHILE|WITH|CLASS)\d:\ + :be=\dEND\d|;:\ + :cb=\(*:ce=*\):\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :sb=":se=":lb=':le=':\ + :kw=AND ARRAY BEGIN BY CASE CONST\ + DEFINITION DIV DO ELSE ELSIF END EXIT EXPORT\ + FOR FROM IF IMPLEMENTATION IMPORT IN\ + LOOP MOD MODULE NOT OF OR POINTER PROCEDURE QUALIFIED\ + RECORD REPEAT RETURN SET THEN TO TYPE\ + UNTIL VAR WHILE WITH: + +# Of course this is not simple Pascal anymore. Borland set THE standard +# for a modern Pascal. Available as Delphi or Free Pascal. +Pascal|pas|p|bp:\ + :pb=(^\d?procedure|function|constructor|destructor\d\p\d|\(|;|\:):\ + :np=forward:id=_.:\ + :bb=\d(case|begin|asm)\d:be=\dend\d|;:\ + :rb=(\=|\:|\d|^)(record|object(\(\a\))?)(\d|$):\ + :oc:\ + :cb={:ce=}:ab=\(*:ae=*\):\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :sb=':se=':\ + :kw=and asm array begin case const constructor destructor div do\ + downto else end end. exports file for function goto if implementation\ + in inherited inline interface label library mod nil not object of or\ + packed procedure program record repeat set shl shr then to type unit\ + until uses var while with xor\ + $ifdef $ifndef $ifopt $else $endif\ + absolute assembler export external far forward index interrupt\ + name near private public resident virtual\ + break continue exit halt: +# The last four are not keywords, but procedures, but they are far more than +# normal and deserve to be treated as if (at least by a pretty printer). +# The 14 modifiers in the last two lines but one also should be treated +# specially though they are not keywords. "string", on the other hand, IS +# a keyword, but since "integer", "boolean" etc. are not, along with any +# self defined type whatsoever, it is not in this list. + +#Perl definition; snarfed from the net +PERL|pl:\ + :pb=^\d?sub\d\p(\d|{):\ + :bb={:be=}:cb=\d#:ce=$:sb=":se=\e":lb=':le=\e':\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :tl:\ + :kw=if until while elsif else unless for foreach continue sub\ + accept and atan2 bind chdir chmod chop chown chroot close\ + closedir cmp connect cos crypt dbmclose dbmopen defined delete die\ + do dump each eof eq eval exec exit exp fcntl fileno flock fork\ + getc getlogin getpeername getpgrp getppid getpriority getpwnam\ + getgrnam gethostbyname getnetbyname getprotobyname getpwuid getgrgid\ + getservbyname gethostbyaddr getnetbyaddr getprotobynumber\ + getservbyport getpwent getgrent gethostent getnetent getprotoent\ + getservent gt setpwent setgrent sethostent setnetent setprotoent\ + setservent endpwent endgrent endhostent endnetent endprotoent\ + endservent ge getsockname getsockopt gmtime goto grep hex ioctl\ + index int join keys kill last le length link listen local localtime\ + log lstat lt m mkdir ne next not oct open opendir or ord pack pop print printf\ + push q qq rand read readdir readlink recv redo rename reset return\ + reverse rewinddir rindex rmdir s seek seekdir select setpgrp send\ + setpriority setsockopt shift shutdown sin sleep socket socketpair\ + sort split sprintf sqrt srand stat study substr syscall system\ + symlink tell telldir time times tr y umask undef unlink unpack\ + unshift utime values vec wait wantarray warn write x xor: + +PostScript|ps:\ + :oc:\ + :cb=%:ce=$:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :sb=\(:se=\e\):\ + :kw=forall array null dict begin end def store string \ + exec if ifelse repeat for loop exit stop stopped quit \ + start save restore gsave grestore grestoreall definefont \ + newpath initgraphics erasepage showpage copypage initclip \ + clip eoclip fill eofill stroke image imagemask: + +PROLOG:\ + :bb=\:-:be=.$:cb=%:ce=$:ab=/*:ae=*/:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :sb=":se=\e":lb=':le=\e':oc:\ + :kw=op mod abort ancestors arg ascii ask assert asserta assertz\ + atom atomic char clause close concat consult ed ef em eof fail\ + file findall write functor getc integer is length listing load name\ + nl nonvar not numbervars op or pp prin print private prompt putc\ + ratom read read_from_this_file rename repeat retract retractall\ + save see seeing seen sh skip statistics subgoal_of system tab\ + tell telling time told trace true unload untrace var write: + +Python|py:\ + :pb=^\d?(def|class)\d\p(\d|\\|\(|\:):\ + :cb=#:ce=$:sb=":se=\e":lb=':le=\e':\ + :kw=accept and break class continue def del elif else except\ + exec finally for from global if import in is lambda not or\ + pass print raise return try while: + +RATFOR:\ + :pb=^\d?program|subroutine|function|(integer|real|complex|character\dfunction)\d\p\d|\(:\ + :bb={:be=}:cb=#:ce=$:sb=":se=":lb=':le=':oc:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw= break call case character common complex data default define\ + dimension do else end equivalence external false for function go\ + goto if implicit include integer logical next pause program read\ + real repeat return rewind stop string subroutine switch true until\ + while write: + +# RLaB language description for the LGrind pretty-printer +# Jim Green 10/15/96 +RLaB:\ + :pb=^\d?\p\d?=\d?function\d?\(:\ + :bb={:be=}:\ + :cb=//:ce=$:\ + :sb=":se=":\ + :tl:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw= \ + abs acos all any asin asinh atan atan2 atanh autospec \ + avsmooth backsub balance bandred banner besselj bessely \ + bodetf break cd ceil center chol choose chop class clear \ + clearall close command command_ compan compleme complex \ + conditio conj continua continue corr cos cosh cross cumprod \ + cumsum czt det detrend diag diary diff disp division dlopen \ + dot eig epsilon erf error errors eval examples exist exp \ + expm eye factor faxis fft fftplot files filter find finite \ + fix fliplr flipud floor fmin for format fprintf fread frexp \ + fseek function funm fvscope gamma getb getenv getline \ + getplot global hankel help hess hex hilb hilbert house if \ + ifft imag in inf input int int2str intersec intro inv isempty \ + isinf isnan isreal issymm join jordan keywords lagrange \ + lcheck length lininsrt linspace lintrp list lmsale load \ + loaddir local log log10 log2 logb logm logspace lu lyap max \ + max2 maxi mdsmax mdsmooth mean median members min min2 mini \ + mod mret nan nextpow2 nmsmax norm num2str ode ode4 ode78 \ + ones open operator pascal pause pclose pend pinv plalt \ + plaspect plaxis plaz plclose plcont plegend plend plerry \ + plfont plgrid plgrid3 plhist plhistx plhold plhold_o plimits \ + plline plmesh plot plot3 plplot plpoint plprint plptex \ + plscol0 plsfile plstart plstyle pltitle plwid plwin poly \ + printf printmat prod pstart ptitle putenv pwin qq_norma qr \ + quadr rand rank rcond read readb readm real redit \ + relation rem replot require reshape return rfile rk4 rlab roots \ + rot90 round save scalars schord schur section set set3d show \ + show_pro showpwin sign sin sinh size sizeof solve sort \ + spectrog sprintf sqrt srand static std steng stmag string \ + strsplt strtod stzcr subplot sum surspl svd sylv symm system \ + tan tanh temp tempacosh tempangle tic tmpnam toc toeplitz \ + trace transpos trapz trig tril triu type union variable \ + vector while window write writeb writem xlabel \ + ylabel zeros zlabel: + +# It's not obvious what constitutes a "procedure definition" in Russell. +# This entry doesn't even try... +Russell:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :cb=\(*:ce=*\):kw=cand cor do od if fi else enum record prod union\ + extend export hide with constants let use in ni val var func type\ + field characters readonly:sb=":se=":lb=':le=': + +SAS:\ + :pb=(^\d?(data|start|%macro)\d\p\d|\(|;):\ + :cb=/*:ce=*/:\ + :ab=^\d?*:ae=;:\ + :sb=":se=":lb=':le=':\ + :oc:\ + :bb=\d(do|select)\d:\ + :be=\dend;:\ + :kw=proc data by cards do drop else end file filename format go if \ + input infile keep label length libname merge options output put \ + retain rename run then title to select set stop until update \ + when where while %include %macro %mend %do %end %if %then %let: + +SDL:\ + :cb=/*:ce=*/:\ + :ab=comment:ae=;:\ + :sb=":se=":lb=':le=':\ + :oc:\ + :kw=task else nextstate in out with from interface to via env and use fpar \ + process procedure block system service type endprocess endprocedure endblock \ + endsystem endservice package endpackage channel endchannel signalroute connect \ + synonym dcl signal gate timer signallist create output set reset call operators \ + literals all state endstate input start stop return none decision enddecision \ + join virtual redefined finalized adding inherits remote exported imported: + +sh:\ + :bb={:be=}:cb=#:ce=$:sb=":se=\e":lb=':\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :le=\e':tl:\ + :kw=break case cd continue do done \ + elif else esac eval exec exit export \ + fi for if in then while until \ + read readonly set shift test trap umask wait: + +SICStus:\ + :bb=\:-:be=.$:cb=%:ce=$:ab=/*:ae=*/:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :sb=":se=\e":lb=':le=\e':\ + :kw=abolish abort absolute_file_name ancestors arg assert\ + asserta assertz at_end_of_stream at_end_of_line atom\ + atom_chars atomic bagof block break call callable call_residue\ + character_count clause close compare compile compound consult\ + copy_term current_atom current_host current_input current_input\ + current_key current_module current_op current_output\ + current_predicate current_stream debug debugging depth dif\ + display dynamic ensure_loaded erase error_exception expand_term\ + fail false fcompile fileerrors findall float flush_output\ + foreign foreign_file format freeze frozen functor\ + garbage_collect gc get get0 ground halt help if\ + incore initialization instance integer is keysort leash\ + length library_directory line_count line_position listing\ + load load_foreign_files maxdepth meta_predicate mod\ + module mode multifile name nl nodebug nofileerrors nogc nonvar\ + nospy nospyall notrace number number_chars numbervars\ + on_exception op open open_null_stream otherwise peek_char\ + phrase plsys portray portray_clause portray_message\ + predicate_property prepare_foreign_files print print_message\ + profile_data profile_reset prolog_flag prompt put public\ + raise_exception read read_term reconsult recorda recorded\ + recordz reinitialize repeat require restore retract retractall\ + save save_program see seeing seek seen set_input set_output\ + set_stream_position setarg setof simple skip skip_line socket\ + socket_accept socket_bind socket_connect socket_interrupt\ + socket_listen socket_select sort source_file spy spypoint\ + statistics stream_code stream_position subgoal_of subsumes_chk\ + tab tell telling term_expansion term_hash term_subsume time_out\ + told trace true ttyflush ttyget ttyget0 ttynl ttyput ttyskip\ + ttytab undo unix unknown unknown_predicate_handler use_module\ + user_help var version when write write_canonical write_term\ + writeq: + +src:\ + :kw=: + +# Very incomplete... +SQL:\ + :oc:ab=/*:ae=*/:\ + :sb=':se=':lb=":le=":\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw=select where from as group by order asc desc union insert values\ + delete into create table integer varchar primary key not null float\ + default: + +# A.Bednarz@kfa-juelich.de +# Received Jan 97 +Tcl/Tk|tcl|tk:\ + :bb={:be=}:cb=\d#:ce=$:sb=":se=\e":lb=':\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :le=\e':tl:pb=\d?proc\d\p\d{:id=-$_.,:\ + :kw=after append array auto_execok auto_load auto_mkindex \ +auto_reset bell bind bindtags break button canvas case catch cd \ +checkbutton clipboard close concat continue destroy entry eof error \ +eval exec exit expr file fileevent flush focus for foreach format \ +frame gets glob global grab history if image incr info join label \ +lappend lindex linsert list listbox llength lower lrange lreplace \ +lsearch lsort menu menubutton message open option pack pid place \ +proc puts pwd radiobutton raise read regexp regsub rename return \ +scale scan scrollbar seek selection send set source split string \ +subst switch tell text time tk tkButtonDown tkButtonEnter tkButtonInvoke \ +tkButtonLeave tkButtonUp tkCancelRepeat tkCheckRadioInvoke tkEntryAutoScan \ +tkEntryBackspace tkEntryButton1 tkEntryClipboardKeysyms tkEntryInsert \ +tkEntryKeySelect tkEntryMouseSelect tkEntrySeeInsert tkEntrySetCursor \ +tkEntryTranspose tkFirstMenu tkListboxAutoScan tkListboxBeginExtend \ +tkListboxBeginSelect tkListboxBeginToggle tkListboxCancel tkListboxDataExtend \ +tkListboxExtendUpDown tkListboxMotion tkListboxSelectAll tkListboxUpDown \ +tkMbButtonUp tkMbEnter tkMbLeave tkMbMotion tkMbPost tkMenuButtonDown \ +tkMenuEscape tkMenuFind tkMenuFindName tkMenuFirstEntry tkMenuInvoke \ +tkMenuLeave tkMenuLeftRight tkMenuMotion tkMenuNextEntry tkMenuUnpost \ +tkPostOverPoint tkSaveGrabInfo tkScaleActivate tkScaleButton2Down \ +tkScaleButtonDown tkScaleControlPress tkScaleDrag tkScaleEndDrag \ +tkScaleIncrement tkScreenChanged tkScrollButton2Down tkScrollButtonDown \ +tkScrollButtonUp tkScrollByPages tkScrollByUnits tkScrollDrag \ +tkScrollEndDrag tkScrollSelect tkScrollStartDrag tkScrollToPos \ +tkScrollTopBottom tkTextAutoScan tkTextButton1 tkTextClipboardKeysyms \ +tkTextInsert tkTextKeyExtend tkTextKeySelect tkTextNextPara tkTextPrevPara \ +tkTextResetAnchor tkTextScrollPages tkTextSelectTo tkTextSetCursor \ +tkTextTranspose tkTextUpDownLine tkTraverseToMenu tkTraverseWithinMenu \ +tk_popup tkwait toplevel trace unknown unset update uplevel upvar while winfo wm: + + +# JL - Added visbasic 6 Aug 1996. Note: this is not complete! +VisualBasic|vbasic:\ + :pb=^\d?*?\d?\p\d?\(\a?\)(\d|{):bb={:be=}:\ + :cb=':ce=$:sb=":se=":\ + :le=\e':tl:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :kw= Access And As Asc Boolean Byte Call Case Chr Close Currency Debug \ + Declare Dim Do Double Else ElseIf End Exit False For Format Function \ + Get If Input Integer Left Len Line Long Loop Lset Ltrim Mid Mod Next \ + Not Object On Open Or Output Print Private Pset Public Put Read Right \ + Rset Rtrim Select Single Static Str String Sub Then To Trim True Type \ + Until Val Variant Wend While : + +VMSasm:\ + :pb=^\d?.entry\d\p(\d|,|$|;):\ + :oc:\ + :cb=;:ce=$:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :sb=(.ident|.asci(x|c|d|i|z))\d:se=$:\ + :kw=.address .align .ascix .ascic .ascid .ascii .asciz \ + .blkx .byte .cross .debug .default .d_floating .double \ + .disable .enable .end .endc .endm .endr .entry .error \ + .even .external .f_floating .float .g_floating .ident .if \ + .if_x .iff .irp .irpc .library .link .list .long .macro \ + .mask .mcall .mdelete .mexit .narg .nchr .nlist .nocross \ + .noshow .ntype .octa .odd .opdef .packed .page .print \ + .psect .quad .refn .repeat .restore_psect .save_psect \ + .show .signed_byte .signed_word .subtitle .title .transfer \ + .warn .weak .word: + +yacc|y:\ + :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ + :cb=/*:ce=*/:sb=":se=\e":lb=':le=\e':tl:\ + :kw=%{ %} %% %union %token %type\ + #else #endif #if #ifdef #ifndef #include #undef #define else endif\ + if ifdef ifndef include undef: + + +EndOfLanguageDefinitions: +# +# The following entries are NOT language definitions, +# but configuration specifications for the LGrind program +# +BeginOfConfigurationItems: + +# a list of extensions and the language that belongs to them +# these can be wrong or too system specific +# recommendations appreciated +extensions:\ + :c=c:\ + :C=c++:cpp=c++:cc=c++:h=c++:\ + :pas=pascal:\ + :ads=ada:adb=ada:\ + :tcl=tcl/tk:\ + :y=yacc:\ + :tex=latex:\ + :java=java:\ + :mod=modula2:\ + :bas=visualbasic:\ + :ps=postscript:eps=postscript:pfa=postscript:\ + :pro=prolog:\ + :scm=scheme:\ + :m=matlab:\ + :ml=sml/nj:\ + :f=f77:F=f77:for=f77:\ + :l=lex:\ + :k=kimwitu++:\ + :py=python: + +# character substitution table +chartab:\ +:84="a:94="o:81="u:e1="s:8e="A:99="O:9a="U:e0=$\\alpha$: + +# preamble to put at the beginning of a stand-alone listing +firstpreamble:\ +\\documentclass[twoside]{article}\n\ +\\usepackage[procnames,noindent]{lgrind}\n\ +\\usepackage{fancyhdr}\n\ +\\usepackage{makeidx}\n\ +\\pagestyle{fancy}\n\n\ +\\makeindex\n\n\ +\\begin{document}\n + +# postamble to put at the very end of a stand-alone listing +postamble:\ +\\printindex\n\ +\\end{document} + +# preamble to put before each file in a stand-alone listing +filepreamble:\ +\\renewcommand{\\footrulewidth}{0.4pt}\n\ +\\fancyhead[C]{\\lgrindhead}\n\ +\\fancyhead[LO,RE]{\\lgrindfilesize~Bytes\\\\\\lgrindmodtime}\n\ +\\fancyhead[RO,LE]{\\bfseries \\lgrindfilename\\\\\ +\\lgrindmodday.\\lgrindmodmonth.\\lgrindmodyear}\n\ +\\fancyfoot[C]{\\bfseries\\thepage}\n\ +\\setlength{\\headheight}{24pt}\n + +# preferences for line numbering, changing fonts etc. +# (comes after "\begin{lgrind}") +configuration: +