[gtksourceview] Added fcl lang file by Søren Hauberg.



commit 46d84163518c84f5a836e16f653e5d2c38fc688d
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Nov 16 13:53:10 2009 +0100

    Added fcl lang file by Søren Hauberg.

 gtksourceview/language-specs/Makefile.am  |    1 +
 gtksourceview/language-specs/fcl.lang     |  113 +++++++++++++++++++++++++++++
 gtksourceview/language-specs/testfiles.sh |   15 ++++
 3 files changed, 129 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/language-specs/Makefile.am b/gtksourceview/language-specs/Makefile.am
index 7404a65..ddf46b7 100644
--- a/gtksourceview/language-specs/Makefile.am
+++ b/gtksourceview/language-specs/Makefile.am
@@ -24,6 +24,7 @@ LANGUAGES =			\
 	dtd.lang		\
 	eiffel.lang		\
 	erlang.lang		\
+	fcl.lang		\
 	forth.lang		\
 	fortran.lang		\
 	fsharp.lang		\
diff --git a/gtksourceview/language-specs/fcl.lang b/gtksourceview/language-specs/fcl.lang
new file mode 100644
index 0000000..fd0b4db
--- /dev/null
+++ b/gtksourceview/language-specs/fcl.lang
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Author: Søren Hauberg
+ Copyright (C) 2009 Søren Hauberg <soren hauberg org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+-->
+<language id="fcl" _name="FCL" version="2.0" _section="Scientific">
+  <metadata>
+    <property name="globs">*.fcl</property>
+    <property name="line-comment-start">//</property>
+  </metadata>
+
+  <styles>
+    <style id="comment"           _name="Comment"           map-to="def:comment"/>
+    <style id="floating-point"    _name="Floating Point"    map-to="def:floating-point"/>
+    <style id="keyword"           _name="Keyword"           map-to="def:keyword"/>
+    <style id="block"             _name="Block"             map-to="def:function"/>
+    <style id="decimal"           _name="Decimal"           map-to="def:decimal"/>
+    <style id="reserved-constant" _name="Reserved Constant" map-to="def:special-constant"/>
+  </styles>
+
+  <definitions>
+    <context id="line-comment" style-ref="comment" end-at-line-end="true">
+      <start>//</start>
+      <include>
+        <context ref="def:in-comment"/>
+      </include>
+    </context>
+
+    <context id="keyword" style-ref="keyword">
+      <keyword>ACCU</keyword>
+      <keyword>ACT</keyword>
+      <keyword>AND</keyword>
+      <keyword>ASUM</keyword>
+      <keyword>BDIF</keyword>
+      <keyword>BSUM</keyword>
+      <keyword>COA</keyword>
+      <keyword>COG</keyword>
+      <keyword>COGS</keyword>
+      <keyword>DEFAULT</keyword>
+      <keyword>IF</keyword>
+      <keyword>IS</keyword>
+      <keyword>LM</keyword>
+      <keyword>MAX</keyword>
+      <keyword>METHOD</keyword>
+      <keyword>MIN</keyword>
+      <keyword>NC</keyword>
+      <keyword>NOT</keyword>
+      <keyword>NSUM</keyword>
+      <keyword>OR</keyword>
+      <keyword>PROD</keyword>
+      <keyword>RANGE</keyword>
+      <keyword>RM</keyword>
+      <keyword>RULE</keyword>
+      <keyword>TERM</keyword>
+      <keyword>THEN</keyword>
+      <keyword>WITH</keyword>
+    </context>
+
+    <context id="block" style-ref="block">
+      <keyword>DEFUZZIFY</keyword>
+      <keyword>END_DEFUZZIFY</keyword>
+      <keyword>END_FUNCTION_BLOCK</keyword>
+      <keyword>END_FUZZIFY</keyword>
+      <keyword>END_OPTIONS</keyword>
+      <keyword>END_RULEBLOCK</keyword>
+      <keyword>END_VAR</keyword>
+      <keyword>FUNCTION_BLOCK</keyword>
+      <keyword>FUZZIFY</keyword>
+      <keyword>OPTIONS</keyword>
+      <keyword>RULEBLOCK</keyword>
+      <keyword>VAR</keyword>
+      <keyword>VAR_INPUT</keyword>
+      <keyword>VAR_OUTPUT</keyword>
+    </context>
+
+    <context id="decimal" style-ref="decimal">
+      <match>\b([1-9][0-9]*|0)([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</match>
+    </context>
+
+    <context id="floating-point-number" style-ref="floating-point">
+      <match>\b([0-9]+[Ee][-]?[0-9]+|([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-]?[0-9]+)?)[fFlL]?</match>
+    </context>
+
+    <context id="fcl">
+      <include>
+        <context ref="line-comment"/>
+        <context ref="keyword"/>
+        <context ref="block"/>
+        <context ref="decimal"/>
+        <context ref="floating-point-number"/>
+      </include>
+    </context>
+  </definitions>
+</language>
+
+
diff --git a/gtksourceview/language-specs/testfiles.sh b/gtksourceview/language-specs/testfiles.sh
index 17d8b39..4d15908 100755
--- a/gtksourceview/language-specs/testfiles.sh
+++ b/gtksourceview/language-specs/testfiles.sh
@@ -15,6 +15,21 @@
 dir="testdir"
 mkdir -p $dir/
 
+cat > $dir/file.fcl << EOFEOF
+FUNCTION_BLOCK explore
+
+VAR_INPUT
+    front : REAL;
+    left : REAL;
+    right : REAL;
+END_VAR
+
+VAR_OUTPUT
+    velocity : REAL;
+    angular_velocity : REAL;
+END_VAR
+EOFEOF
+
 cat > $dir/file.fs << EOFEOF
 (* Simple F# sample *)
 let rec map func lst =



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