[Gambas-devel] Improved gbs2
Fabien Bodard
gambas.fr at ...176...
Wed Nov 21 17:50:16 CET 2007
Le Wednesday 21 November 2007 17:18:27 Daniel Campos, vous avez écrit :
> Hi:
>
> I've made a complete reimplementation of gbs2, the main features:
>
> -> It can detect and warn about syntax errors prior to invoke the compiler.
>
> -> It is able to redirect the errors from gbc2 to the right source
> script file in which the error was done, including the right line
> number.
>
> -> As the prior implementation it can use the "INCLUDE" keyword to
> include more script files, but here you can use "-i=file-to-include"
> too, so you can reimplement classes and launch the main script using
> them
>
> -> The implementation of a class with a given name can be divided in
> more than a file, the gbs2 program will join them, so you can
> reimplement methods including different files, or expand the
> capabilities of a class with new methods.
>
> I send the source code as well as an example with an error, now It is
> easy to find as you can detect the file and line number in which the
> problem exists.
>
> 1) Compile the gbs2 implementation, then put it into /usr/bin
> 2) Run the example: gbs2 program.g
> 3) QUIZ! Fix the error and then run it again
>
> Daniel
Marvellous !
It is now quicker to find error :)
Another great job from you Daniel
So for that this is a present for you : The kate highlighting template file...
Sorry , i've not the gtksourceview one as it is so hard to do...
Put it in /usr/share/apps/katepart/syntax
To avoid problem on kate color... delete the highlight*.rc file in your
home/../.kde/share/app
or .kde/conf... i don't remember
The .lang file is for gtksourceview...
put it in /usr/share/gtksourceview-2.0/language-specs/
But it is not finished... if you have time...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gambas.xml
Type: text/xml
Size: 17752 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20071121/9320b821/attachment.xml>
-------------- next part --------------
<?xml version="1.0" encoding="UTF-8"?>
<!--
Author: Fabien Bodard <gambas.fr at ...176...>
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<language id="gambas" _name="Gambas" version="2.0" _section="Scripts">
<metadata>
<property name="mimetypes">application/x-gambasscript</property>
<property name="globs">*.g</property>
<property name="line-comment-start">'</property>
</metadata>
<styles>
<style id="keyword" _name="Keyword" map-to="def:keyword" />
<style id="function" _name="Function" map-to="def:function" />
<style id="datatype" _name="Datatype" map-to="def:type" />
<style id="string" _name="String" map-to="def:string"/>
<style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/>
</styles>
<definitions>
<define-regex id="identifier">[_a-zA-Z][_a-zA-Z0-9]*</define-regex>
<define-regex id="number">[1-9][0-9]*</define-regex>
<define-regex id="escaped-character" extended="true">
\\( # leading backslash
[\\\"\'nrtfav\?e] | # escaped character
&h[0-9A-Fa-f]{0,6} # 'x' followed by zero, one, or two hex digits
)
</define-regex>
<context id="gambas">
<include>
<context id="string" style-ref="string" end-at-line-end="true">
<start>"</start>
<end>"</end>
<include>
<!--<context ref="printf"/>-->
<context id="escaped-character" style-ref="escaped-character">
<match>\%{escaped-character}</match>
</context>
<context ref="def:line-continue"/>
</include>
</context>
<context id="as" style-ref="datatype" end-at-line-end="true">
<start>AS</start>
</context>
<context id="keyword" style-ref="keyword">
<keyword>USE</keyword>
<keyword>INCLUDE</keyword>
<keyword>STRUCT</keyword>
<keyword>CONST</keyword>
<keyword>PRIVATE</keyword>
<keyword>PUBLIC</keyword>
<keyword>STATIC</keyword>
<keyword>EVENT</keyword>
<keyword>INHERITS</keyword>
<keyword>IMPLEMENTS</keyword>
<keyword>EXPORT</keyword>
<keyword>OF</keyword>
<keyword>DIM</keyword>
<keyword>NEW</keyword>
<keyword>PROCEDURE</keyword>
<keyword>RETURN</keyword>
<keyword>OPTIONAL</keyword>
<keyword>OUTPUT</keyword>
<keyword>DO</keyword>
<keyword>LOOP</keyword>
<keyword>WHILE</keyword>
<keyword>UNTIL</keyword>
<keyword>REPEAT</keyword>
<keyword>WEND</keyword>
<keyword>IF</keyword>
<keyword>THEN</keyword>
<keyword>ELSE</keyword>
<keyword>ENDIF</keyword>
<keyword>FOR</keyword>
<keyword>TO</keyword>
<keyword>FROM</keyword>
<keyword>STEP</keyword>
<keyword>NEXT</keyword>
<keyword>SELECT</keyword>
<keyword>CASE</keyword>
<keyword>EXIT</keyword>
<keyword>BREAK</keyword>
<keyword>CONTINUE</keyword>
<keyword>GOTO</keyword>
<keyword>ME</keyword>
<keyword>LAST</keyword>
<keyword>TRY</keyword>
<keyword>FINALLY</keyword>
<keyword>CATCH</keyword>
<keyword>WITH</keyword>
<keyword>TRUE</keyword>
<keyword>FALSE</keyword>
<keyword>SWAP</keyword>
<keyword>NULL</keyword>
<keyword>EXTERN</keyword>
<keyword>EACH</keyword>
<keyword>IN</keyword>
<keyword>DEFAULT</keyword>
<keyword>STOP</keyword>
<keyword>QUIT</keyword>
<keyword>RAISE</keyword>
<keyword>ERROR</keyword>
<keyword>SUPER</keyword>
<keyword>ENUM</keyword>
<keyword>PRINT</keyword>
<keyword>INPUT</keyword>
<keyword>READ</keyword>
<keyword>WRITE</keyword>
<keyword>OPEN</keyword>
<keyword>CLOSE</keyword>
<keyword>SEEK</keyword>
<keyword>APPEND</keyword>
<keyword>CREATE</keyword>
<keyword>BINARY</keyword>
<keyword>LINE</keyword>
<keyword>FLUSH</keyword>
<keyword>EXEC</keyword>
<keyword>SHELL</keyword>
<keyword>WAIT</keyword>
<keyword>SLEEP</keyword>
<keyword>KILL</keyword>
<keyword>MOVE</keyword>
<keyword>COPY</keyword>
<keyword>INC</keyword>
<keyword>DEC</keyword>
<keyword>MKDIR</keyword>
<keyword>RMDIR</keyword>
<keyword>WATCH</keyword>
<keyword>LINK</keyword>
<keyword>LOCK</keyword>
<keyword>UNLOCK</keyword>
<keyword>LIBRARY</keyword>
<keyword>DEBUG</keyword>
<keyword>PIPE</keyword>
<keyword>RANDOMIZE</keyword>
<keyword>AND</keyword>
<keyword>OR</keyword>
<keyword>NOT</keyword>
<keyword>XOR</keyword>
<keyword>DIV</keyword>
<keyword>MOD</keyword>
<keyword>IS</keyword>
<keyword>LIKE</keyword>
</context>
<context id="function" style-ref="function">
<keyword>Left$</keyword>
<keyword>Left</keyword>
<keyword>Mid$</keyword>
<keyword>Mid</keyword>
<keyword>Right$</keyword>
<keyword>Right</keyword>
<keyword>Len</keyword>
<keyword>Space$</keyword>
<keyword>Space</keyword>
<keyword>String$</keyword>
<keyword>Trim$</keyword>
<keyword>Trim</keyword>
<keyword>LTrim$</keyword>
<keyword>LTrim</keyword>
<keyword>RTrim$</keyword>
<keyword>RTrim</keyword>
<keyword>Upper$</keyword>
<keyword>Upper</keyword>
<keyword>UCase$</keyword>
<keyword>UCase</keyword>
<keyword>Lower$</keyword>
<keyword>Lower</keyword>
<keyword>LCase$</keyword>
<keyword>LCase</keyword>
<keyword>Chr$</keyword>
<keyword>Chr</keyword>
<keyword>Asc</keyword>
<keyword>InStr</keyword>
<keyword>RInStr</keyword>
<keyword>Subst$</keyword>
<keyword>Subst</keyword>
<keyword>Replace$</keyword>
<keyword>Replace</keyword>
<keyword>Split</keyword>
<keyword>Scan</keyword>
<keyword>Comp</keyword>
<keyword>Conv</keyword>
<keyword>Conv$</keyword>
<keyword>SConv</keyword>
<keyword>SConv$</keyword>
<keyword>DConv</keyword>
<keyword>DConv$</keyword>
<keyword>Abs</keyword>
<keyword>Int</keyword>
<keyword>Fix</keyword>
<keyword>Sgn</keyword>
<keyword>Frac</keyword>
<keyword>Log</keyword>
<keyword>Exp</keyword>
<keyword>Sqr</keyword>
<keyword>Sin</keyword>
<keyword>Cos</keyword>
<keyword>Tan</keyword>
<keyword>Atn</keyword>
<keyword>ATan</keyword>
<keyword>Asn</keyword>
<keyword>ASin</keyword>
<keyword>Acs</keyword>
<keyword>ACos</keyword>
<keyword>Deg</keyword>
<keyword>Rad</keyword>
<keyword>Log10</keyword>
<keyword>Sinh</keyword>
<keyword>Cosh</keyword>
<keyword>Tanh</keyword>
<keyword>Asnh</keyword>
<keyword>ASinh</keyword>
<keyword>Acsh</keyword>
<keyword>ACosh</keyword>
<keyword>Atnh</keyword>
<keyword>ATanh</keyword>
<keyword>Exp2</keyword>
<keyword>Exp10</keyword>
<keyword>Log2</keyword>
<keyword>Cbr</keyword>
<keyword>Expm</keyword>
<keyword>Logp</keyword>
<keyword>Pi</keyword>
<keyword>Round</keyword>
<keyword>Rnd</keyword>
<keyword>Min</keyword>
<keyword>Max</keyword>
<keyword>If</keyword>
<keyword>IIf</keyword>
<keyword>Choose</keyword>
<keyword>.Array</keyword>
<keyword>ATan2</keyword>
<keyword>Atn2</keyword>
<keyword>Ang</keyword>
<keyword>Hyp</keyword>
<keyword>Mag</keyword>
<keyword>IsAscii</keyword>
<keyword>IsLetter</keyword>
<keyword>IsLCase</keyword>
<keyword>IsLower</keyword>
<keyword>IsUCase</keyword>
<keyword>IsUpper</keyword>
<keyword>IsDigit</keyword>
<keyword>IsHexa</keyword>
<keyword>IsSpace</keyword>
<keyword>IsBlank</keyword>
<keyword>IsPunct</keyword>
<keyword>Ascii?</keyword>
<keyword>Letter?</keyword>
<keyword>LCase?</keyword>
<keyword>Lower?</keyword>
<keyword>UCase?</keyword>
<keyword>Upper?</keyword>
<keyword>Digit?</keyword>
<keyword>Hexa?</keyword>
<keyword>Space?</keyword>
<keyword>Blank?</keyword>
<keyword>Punct?</keyword>
<keyword>BClr</keyword>
<keyword>BSet</keyword>
<keyword>BTst</keyword>
<keyword>BChg</keyword>
<keyword>Shl</keyword>
<keyword>Asl</keyword>
<keyword>Shr</keyword>
<keyword>Asr</keyword>
<keyword>Rol</keyword>
<keyword>Ror</keyword>
<keyword>Lsl</keyword>
<keyword>Lsr</keyword>
<keyword>IsBoolean</keyword>
<keyword>IsByte</keyword>
<keyword>IsShort</keyword>
<keyword>IsInteger</keyword>
<keyword>IsLong</keyword>
<keyword>IsSingle</keyword>
<keyword>IsFloat</keyword>
<keyword>IsDate</keyword>
<keyword>IsString</keyword>
<keyword>IsNull</keyword>
<keyword>IsObject</keyword>
<keyword>IsNumber</keyword>
<keyword>Boolean?</keyword>
<keyword>Byte?</keyword>
<keyword>Short?</keyword>
<keyword>Integer?</keyword>
<keyword>Long?</keyword>
<keyword>Single?</keyword>
<keyword>Float?</keyword>
<keyword>Date?</keyword>
<keyword>String?</keyword>
<keyword>Null?</keyword>
<keyword>Object?</keyword>
<keyword>Number?</keyword>
<keyword>TypeOf</keyword>
<keyword>CBool</keyword>
<keyword>CByte</keyword>
<keyword>CShort</keyword>
<keyword>CInt</keyword>
<keyword>CInteger</keyword>
<keyword>CLng</keyword>
<keyword>CLong</keyword>
<keyword>CSng</keyword>
<keyword>CSingle</keyword>
<keyword>CFlt</keyword>
<keyword>CFloat</keyword>
<keyword>CDate</keyword>
<keyword>CStr</keyword>
<keyword>CString</keyword>
<keyword>Bin$</keyword>
<keyword>Bin</keyword>
<keyword>Hex$</keyword>
<keyword>Hex</keyword>
<keyword>Val</keyword>
<keyword>Str$</keyword>
<keyword>Str</keyword>
<keyword>Format$</keyword>
<keyword>Format</keyword>
<keyword>Timer</keyword>
<keyword>Now</keyword>
<keyword>Year</keyword>
<keyword>Month</keyword>
<keyword>Day</keyword>
<keyword>Hour</keyword>
<keyword>Minute</keyword>
<keyword>Second</keyword>
<keyword>WeekDay</keyword>
<keyword>Week</keyword>
<keyword>Date</keyword>
<keyword>Time</keyword>
<keyword>DateAdd</keyword>
<keyword>DateDiff</keyword>
<keyword>Eval</keyword>
<keyword>Eof</keyword>
<keyword>Lof</keyword>
<keyword>Seek</keyword>
<keyword>Exist</keyword>
<keyword>Access</keyword>
<keyword>Stat</keyword>
<keyword>Dfree</keyword>
<keyword>Temp</keyword>
<keyword>Temp$</keyword>
<keyword>IsDir</keyword>
<keyword>Dir?</keyword>
<keyword>Dir</keyword>
<keyword>RDir</keyword>
<keyword>Alloc</keyword>
<keyword>Free</keyword>
<keyword>Realloc</keyword>
<keyword>StrPtr</keyword>
</context>
<context id="datatype" style-ref="datatype">
<keyword>Boolean</keyword>
<keyword>Byte</keyword>
<keyword>Date</keyword>
<keyword>Single</keyword>
<keyword>Float</keyword>
<keyword>Integer</keyword>
<keyword>Long</keyword>
<keyword>Short</keyword>
<keyword>String</keyword>
<keyword>Variant</keyword>
<keyword>Object</keyword>
<keyword>Boolean\[\]</keyword>
<keyword>Byte\[\]</keyword>
<keyword>Date\[\]</keyword>
<keyword>Single\[\]</keyword>
<keyword>Float\[\]</keyword>
<keyword>Integer\[\]</keyword>
<keyword>String\[\]</keyword>
<keyword>Variant\[\]</keyword>
<keyword>Object\[\]</keyword>
<keyword>Pointer</keyword>
<keyword>Collection</keyword>
</context>
</include>
</context>
</definitions>
</language>
More information about the Devel
mailing list