(file) Return to matlab.st CVS log (file) (dir) Up to [RizwankCVS] / testProject / source / states / hl

  1 rizwank 1.1 /**
  2              * Name: matlab
  3              * Description: Matlab programming language.
  4              * Author: Jack Dunn <h.j.dunn@larc.nasa.gov>
  5              */
  6             
  7             m_keyword_re =
  8             /\b(break|cl(ear|ose)|e(nd|lse|lseif|rror)|f(or|unction)|if|keyboard|otherwise\
  9             |quit|return|switch|while)\b/;
 10             
 11             /* Taken fron the Matlab Function Reference, version 5.2 */
 12             m_type_re =
 13             /\b(abs|acopy|acos|acosh|acot|acoth|acsc|acsch|addpath|airy|all|and|angle|ans|any\
 14             |arc(cosecant|cosine|cotangent|secant|sine|tangent)|area\
 15             |arename|asech|asin|asinh|atan(|2)|atanh|axes|axis|balance|bar(|3|3h|h)\
 16             |base2dec|bessel(h|i|j|k|y)|beta(|inc|ln)\
 17             |bicgstab|bin2dec|bit(and|cmp|get|max|or|set|shift|xor)|blanks\
 18             |box|brighten|builtin|calendar|cam(dolly|light|lookat|orbit|pan|pos|proj\
 19             |roll|target|up|va|zoom)|capture|case|cat(|ch)|caxis|cd|cdf2rdf\
 20             |cell(|2struct|plot)|cgs|char|chol(|inc|update)|cla(|bel|ss)\
 21             |clc|clf|clock|col(mmd|or(bar|map)|perm)|com(bs|et|et3|pa(n|ss))|computer\
 22 rizwank 1.1 |cond(|eig|est)|conj|con(tour(|3|c|f))|contrast|conv(|2)|convhull|conv\
 23             |copy(file|obj)|corrcoef|cos|cosh|cot|coth|cov|cplxpair|cputime|cross\
 24             |csc|csch|cum(prod|trapz)|cylinder|daspect|date|date(num|str|vec)\
 25             |db(clear|cont|down|mex|quit|stack|status|step|stop|type|up)\
 26             |dd(eadv|eexec|einit|epoke|ereq|eterm|eunadv)|de(al|blank|(c2(base|bin|hex))\
 27             |conv)|default4|del2|delaunay|de(lete|t)|diag|diary|diff|dir|disp\
 28             |dlm(read|writ)|dmperm|double|dragrect|drawnow|dsearch|echo|eig|eigs|ellipj\
 29             |ellipke|eomday|eps|erf(|c|cx)|etime|eval|evalin|exist|exp|expint|expm|eye\
 30             |ezplot|factor|fclose|feather|feof|ferror|feval|fft(|2|n|shift)\
 31             |fget(l|s)|fid|figflag|figure|fileparts|fill|fill3|filter(|2)|find(|obj|str)\
 32             |fix|flip(dim|lr|ud)|floor|flops|fmin(|s)|fopen|format|fplot|fprintf\
 33             |frame(2im|edit)|fread|freqspace|frewind|fscanf|fseek|ftell|full|funm|fwrite\
 34             |fzero|gallery|gamma(|inc|ln)|g(ca|cd|cf|co)|gestalt|get(|field|frame)\
 35             |ginput|global|gmres|gplot|gradient|graymon|grid(|data)|gsvd|gtext|hadamard\
 36             |hankel|hdf|help|hess|hex2(dec|num)|hidden|hilb|hist|hold|home|horzcat\
 37             |hsv2rgb|i|ifft(|2|n|shift)|im2frame|imag|image|imagesc|im(finfo|read|write)\
 38             |ind2sub|Inf|inferiorto|inline|inpolygon|input|int2str|interp(1|2|3|ft|n)\
 39             |intersect|inv|invhilb|ipermute|is(a|cell(|str)|char|empty|equal|field\
 40             |finite|global|handle|hold|ieee|inf|letter|logical|member|nan|numeric\
 41             |object|ppc|prime|real|space|sparse|str|struct|student|unix|vms)\
 42             |j|kron|last(err|warn)|lcm|ldivide|legend(|re)|length|light(|angle|ing)\
 43 rizwank 1.1 |lin2mu|line|linspace|load|log(|10|2|ical)|loglog(|m|space)|lookfor\
 44             |lower|lscov|lu|luinc|magic|mat2str|material|max|mean|median|menu\
 45             |mesh(|c|grid|z)|min|minus|mislocked|mkdir|ml(divide|ock)|mod|more|movie(|in)\
 46             |mpower|mrdivide|mtimes|mu2lin|munlock|NaN|narg(chk|in|out)|nd(grid|ims)\
 47             |newplot|nextpow2|nnls|nnz|nonzeros|norm|normest|not|now|null|num2(cell|str)\
 48             |nzmax|ode(45|file|get|set)|ones|or|orient|orth|pack|pagedlg|pareto|pascal\
 49             |patch|path|pause|pbaspect|pcg|pcode|pcolor|perms|permute|persistent\
 50             |pi|pie(|,3)|pinv|plot(|3|matrix|yy)|plus|pol2cart|polar|poly(|area|der\
 51             |eig|fit|val|valm)|pow2|power|primes|print(|dlg|frame|opt)|prod\
 52             |profile|qmr|qr(|delete|insert)|qtwrite|quad|quad8|quiver(|3)|qz\
 53             |rand(|n|perm)|rank|rat(|s)|rbbox|rcond|rdivide|readsnd|real(|max|min)\
 54             |recordsound|refresh|rem|repmat|reset|reshape|residue|rgb(2hsv|plot)\
 55             |ribbon|rmfield|rmpath|roots|rose|rot90|rotate(|3d)|round|rref(|movie)\
 56             |rsf2csf|save|scatter(|3)|schur|script|sech|semilog(x|y)|set(|diff|feild|xor)\
 57             |shading|shiftdim|sign|sin|sinh|size|slice|sliders|sort|sortrows|sound(|cap)\
 58             |sp(alloc|arse|convert|diags|eak|eye|fun|h2cart|here|inmap|line\
 59             |ones|parms|rand|randn|randsym|rintf|y)|sqrt(|m)|squeeze|sscanf|stairs\
 60             |startup|std|stem(|3)|str(2(cell|num)|cat|cmp|cmpi|ings|just|match|ncmp\
 61             |ncmpi|rep|tok|uct2cell,vcat)|sub(2ind|plot|s(asgn|pace|ref))|sum|superiorto\
 62             |surf(|ace|c|l|norm)|svd(|s)|sym(mmd|rcm)|tan|tanh|tempdir|tempname\
 63             |terminal|text|tic|times|title|toc|toeplitz|trace|transpose|trapz\
 64 rizwank 1.1 |tri(l|mesh|surf|u)|try|tsearch|type|ui(control|getfile|menu|nt8|putfile\
 65             |resume|setcolor|setfont)|uminus|union|unique|unwrap|uplus|upper|varargout\
 66             |vectorize|ver(|sion|tcat)|view|viewmtx|voronoi|wait(bar|for(|buttonpress))\
 67             |warndlg|warning|waterfall|wav(read|write)|weekday|what(|snew)|which|who(|s)\
 68             |wilkinson|wk1(read|write)|writesnd|xlabel|xlgetrange|xlim|xlsetrange|xor\
 69             |ylabel|ylim|zeros|zlabel|zlim|zoom\
 70             )\b/;
 71             
 72             state m_string extends Highlight
 73             {
 74               /\\\\./ {
 75                 language_print ($0);
 76               }
 77               /[\']/ {
 78                 language_print ($0);
 79                 return;
 80               }
 81             }
 82             
 83             state matlab extends HighlightEntry
 84             {
 85 rizwank 1.1   /* Comments. */
 86               /%/ {
 87                 comment_face (true);
 88                 language_print ($0);
 89                 call (eat_one_line);
 90                 comment_face (false);
 91               }
 92             
 93               /* Continuation. */
 94               /\.\.\./ {
 95                 keyword_face (true);
 96                 language_print ($0);
 97                 keyword_face (false);
 98               }
 99             
100               /* Matrix start.  */
101               /\[/ {
102                 type_face (true);
103                 language_print ($0);
104                 type_face (false);
105               }
106 rizwank 1.1 
107               /* Matrix end. */
108               /\]/ {
109                 type_face (true);
110                 language_print ($0);
111                 type_face (false);
112               }
113             
114               m_type_re {
115                 type_face (true);
116                 language_print ($0);
117                 type_face (false);
118               }
119             
120               m_keyword_re {
121                  keyword_face (true);
122                  language_print($0);
123                  keyword_face (false);
124               }
125             
126               /* Transpose. */
127 rizwank 1.1   /* variable' or )' */
128               /([a-zA-Z][a-zA-Z_0-9]*|\))([\'])/ {
129                 language_print ($1);
130                 keyword_face (true);
131                 language_print ($2);
132                 keyword_face (false);
133               }
134               /* ]' */
135               /([a-zA-Z][a-zA-Z_0-9]*|])([\'])/ {
136                 type_face (true);
137                 language_print ($1);
138                 type_face (false);
139                 keyword_face (true);
140                 language_print ($2);
141                 keyword_face (false);
142               }
143             
144               /* Strings. */
145               /*  'any number of characters'  */
146               /[\']/ {
147                 string_face (true);
148 rizwank 1.1     language_print ($0);
149                 call (m_string);
150                 string_face (false);
151               }
152             }
153             
154             
155             /*
156             Local variables:
157             mode: c
158             End:
159             */

Rizwan Kassim
Powered by
ViewCVS 0.9.2