help-octave
[Top][All Lists]
Advanced

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

Re: Hilighting Octave text in gedit/GNOME.


From: Søren Hauberg
Subject: Re: Hilighting Octave text in gedit/GNOME.
Date: Tue, 14 Jun 2005 09:05:57 +0200
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050404)

Hi,
A while back I did something similar. You can get it at

http://bugs.gnome.org/show_bug.cgi?id=170604

I don't have the time to look into your work, but I thought I should mention it anyway.

/Søren

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

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



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]