--0-82363118-1094252629=:14624
Content-Type: text/plain; charset=us-ascii
Content-Id:
Content-Disposition: inline
Dear kate developers,
I want to create a syntax file for my prototyping
language (called rulz.net). Since my language is a
derivative of C#, I took kate's cs.xml file, made a
few small changes and saved it as rulz.xml in the same
directory (/opt/kde3/share/apps/katepart/syntax/). My
rulz.xml file is attached to this email.
Next, I opened kate, and opened a sample rulz file
(airline.rulz, also attached), but there is no
highlighting.
Even after rebooting kde, the rulz.xml does not get
applied.
The 'Tools' menu -> Highligh mode -> Sources submenu
shows C# as an (unchecked) option, but rulz is not on
the submenu.
Question: Do I need to register a MIME type for my
extension? Do I need to take any additional steps to
install the syntax file?
I am using Kate 2.2.1 on Suse Linux 9.1
Thanks for any help,
George Moudry
--0-82363118-1094252629=:14624
Content-Type: text/xml; name="rulz.xml"
Content-Description: rulz.xml
Content-Disposition: inline; filename="rulz.xml"
- abstract
- as
- base
- break
- case
- catch
- class
- checked
- continue
- default
- delegate
- do
- else
- enum
- event
- explicit
- extern
- false
- for
- foreach
- finally
- fixed
- goto
- if
- implicit
- in
- interface
- internal
- is
- lock
- namespace
- new
- null
- operator
- out
- override
- params
- private
- protected
- public
- readonly
- ref
- return
- sealed
- sizeof
- stackalloc
- static
- struct
- switch
- this
- throw
- true
- try
- typeof
- unchecked
- unsafe
- using
- virtual
- while
- #if
- #else
- #elif
- #endif
- #define
- #undef
- #warning
- #error
- #line
- where
- rule
- rclass
- rinterface
- bool
- byte
- char
- const
- decimal
- double
- float
- int
- long
- object
- uint
- ushort
- ulong
- sbyte
- short
- string
- void
--0-82363118-1094252629=:14624
Content-Type: text/x-c++src; name="airline.rulz"
Content-Description: airline.rulz
Content-Disposition: inline; filename="airline.rulz"
using System;
public class Employee { }
public class Pilot : Employee { }
public class Steward : Employee { }
public class FAA_Exception : System.Exception { }
public rclass CalculateOvertimePay
{
///
/// the public interface is what the outside world calls.
/// It returns dollar amount of overtime pay, for the current employee.
///
[rulz.GenerateFctMatchFirst]
[rulz.GenerateFctMatchAll("overtime_MatchAll")]
rinterface double overtimePay(Employee employee,int overtimeHours);
rule double overtimePay(Pilot pilot,int overtimeHours)
where(overtimeHours>100)
{
//must notify FAA
throw new FAA_Exception();
}
rule double overtimePay(Pilot pilot,int overtimeHours)
{
return 0.10 * overtimeHours;
}
rule double overtimePay(Steward steward,int overtimeHours)
{
return 0.05 * overtimeHours;
}
}
public class MainClass
{
public static void Main(string[] argv)
{
CalculateOvertimePay cop = new CalculateOvertimePay();
Pilot pilot = new Pilot();
Steward steward = new Steward();
Employee employee = new Employee();
double[] dArr = cop.overtime_MatchAll(pilot,99);
Console.WriteLine("MatchAll Begin: Pilot, ResultLength="+dArr.Length);
foreach(double d in dArr){
Console.WriteLine(" Result "+d);
}
Console.WriteLine("MatchAll End");
Console.WriteLine();
dArr = cop.overtime_MatchAll(employee,99);
Console.WriteLine("MatchAll Begin: Employee, ResultLength="+dArr.Length);
foreach(double d in dArr){
Console.WriteLine(" Result "+d);
}
Console.WriteLine("MatchAll End");
Console.WriteLine();
Console.WriteLine("MatchFirst Begin");
double stew_pay = cop.overtimePay(steward,77);
Console.WriteLine(" Result "+stew_pay);
Console.WriteLine("MatchFirst End");
}
}
--0-82363118-1094252629=:14624
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel
--0-82363118-1094252629=:14624--