[gedit-list] Hilighting Octave text in gedit/GNOME.



Hello there!
This mail is for  Gedit,GNOME people, using GNU
Octave,
can now syntax hilite their scripts with this
file octave.lang.

I saw some requests for 'matlab' syntax hilighting
[in Feb 05 archives], so you guys can still use this
'octave.lang' for the same.

Everyone can suggest where the words must go,
and if all keywords in Octave are listed.


octave.lang
====================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language _name="Octave" version="1.0"
_section="Scripts"
mimetypes="text/x-objcsrc;text/x-octave">
	
	<escape-char>\</escape-char>


	<line-comment _name = "Line Comment" style=
"Comment">
		<start-regex>#|%</start-regex>
	</line-comment>


	<string _name = "String" style = "String"
end-at-line-end = "TRUE">
		<start-regex>&quot;|'</start-regex>
		<end-regex>&quot;|'</end-regex>
	</string>

	<keyword-list _name = "Keywords" style = "Keyword"
case-sensitive="TRUE">
		
		<keyword>function</keyword>
		<keyword>endfunction</keyword>

		<keyword>switch</keyword>
		<keyword>case</keyword>
		<keyword>endswitch</keyword>
		<keyword>otherwise</keyword>

		<keyword>unwind_protect</keyword>
		<keyword>unwind_protect_cleanup</keyword>
		<keyword>end_unwind_protect</keyword>

		<keyword>try</keyword>
		<keyword>catch</keyword>
		<keyword>end_try_catch</keyword>
		<keyword>end</keyword>

		<keyword>if</keyword>
      		<keyword>else</keyword>
		<keyword>elseif</keyword>
		<keyword>endif</keyword>

		<keyword>break</keyword>
		<keyword>continue</keyword>

		<keyword>for</keyword>
		<keyword>endfor</keyword>
		<keyword>return</keyword>

		<keyword>do</keyword>
		<keyword>until</keyword>

		<keyword>while</keyword>
		<keyword>endwhile</keyword>

		<keyword>global</keyword>
		<keyword>nargin</keyword>
		<keyword>nargout</keyword>
		<keyword>assert</keyword>
	</keyword-list>


	<pattern-item _name = "Decimal" style = "Decimal">
	
<regex>\b([1-9][0-9]*|0)([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</regex>
	</pattern-item>

	<pattern-item _name = "Floating Point Number" style =
"Floating Point">
	
<regex>\b([0-9]+[Ee][-]?[0-9]+|([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-]?[0-9]+)?)[fFlL]?</regex>
	</pattern-item>

	<pattern-item _name = "Octal Number" style = "Base-N
Integer">
	
<regex>\b0[0-7]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</regex>
	</pattern-item>

	<pattern-item _name = "Hex Number" style = "Base-N
Integer">
	
<regex>\b0[xX][0-9a-fA-F]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</regex>
	</pattern-item>

	<keyword-list _name = "Intrinsics" style = "Keyword"
case-sensitive="TRUE">
		<keyword>size</keyword>
		<keyword>zeros</keyword>
		<keyword>ones</keyword>
		<keyword>min</keyword>
		<keyword>max</keyword>
		<keyword>varargs</keyword>
		<keyword>sqrt</keyword>
		<keyword>atan2</keyword>
		<keyword>asin</keyword>
		<keyword>acos</keyword>
		<keyword>log10</keyword>
		<keyword>log</keyword>
		<keyword>real</keyword>
		<keyword>error</keyword>
		<keyword>isscalar</keyword>
		<keyword>isstr</keyword>
		<keyword>strcmp</keyword>
		<keyword>log2</keyword>
		<keyword>Inf</keyword>
		<keyword>isvector</keyword>
		<keyword>strcat</keyword>
		<keyword>fsolve</keyword>
		<keyword>islogical</keyword>
		<keyword>isempty</keyword>
		<keyword>isnumeric</keyword>
		<keyword>prod</keyword>
		<keyword>round</keyword>
		<keyword>dims</keyword>
		<keyword>cumprod</keyword>
		<keyword>ismatrix</keyword>
		<keyword>floor</keyword>
		<keyword>sort</keyword>
		<keyword>ceil</keyword>
		<keyword>linspace</keyword>
		<keyword>isnan</keyword>
		<keyword>isinf</keyword>
		<keyword>nan_inf</keyword>
		<keyword>repmat</keyword>
		<keyword>colums</keyword>
		<keyword>rows</keyword>
		<keyword>sum</keyword>
		<keyword>rem</keyword>
		<keyword>reshape</keyword>
		<keyword>conv</keyword>
		<keyword>length</keyword>
		<keyword>usage</keyword>
		<keyword>log2</keyword>
		<keyword>abs</keyword>
		<keyword>setstr</keyword>
		<keyword>printf</keyword>
		<keyword>sprintf</keyword>
		<keyword>fprintf</keyword>
		<keyword>fread</keyword>
		<keyword>fopen</keyword>
		<keyword>fclose</keyword>
		<keyword>system</keyword>
		<keyword>unlink</keyword>
	</keyword-list>
</language>



To install this file:
=====================
There are 2 ways.

cp ./octave.lang
/usr/gtksourceview-$version/language-specs/

where $version=1.0 or 0.8 or whatever you have
installed on your system.

[OR]
If youre not a Root user

cp ./octave.lang 
~/.gtksourceview-$version/language-specs/

in your HOME directory.




Cheers
Muthu.



		
__________________________________ 
Discover Yahoo! 
Stay in touch with email, IM, photo sharing and more. Check it out! 
http://discover.yahoo.com/stayintouch.html



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]