[scintilla] Harbor, Flagship, Clipper, xBase, ... lexer

176 views
Skip to first unread message

Neil Hodgson

unread,
Apr 27, 2010, 5:55:36 AM4/27/10
to scintilla-interest
An updated version of the lexer responsible for xBase dialects has
been contributed to the feature request tracker. While it appears to
have benefits, it also changes behaviour compared to the current
lexer.

As I do not use any of these languages, I do not know if the
changes are worthwhile and would like to hear from those that have an
opinion.

The feature request is at
https://sourceforge.net/tracker/index.php?func=detail&aid=2992689&group_id=2439&atid=352439

There are source and executable downloads at
http://www.scintilla.org/scite.zip Source
http://www.scintilla.org/wscite.zip Windows executable

Neil

--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla...@googlegroups.com.
To unsubscribe from this group, send email to scintilla-inter...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.

Xavi

unread,
May 6, 2010, 2:05:49 PM5/6/10
to scintilla...@googlegroups.com
Thanks,

This update, is compatible with existing and incorporate .-
Comments Clipper: *, &&
Comments C/C++ Doxygen: /* ... */, //
Doxygen keywords
Strings: single quotes, double
Operators including @
Dates: {^...}
Constants: nil, .t., .f.
Word Operators: .not., .and., .or.
Disabled code pragmas: begindump, __cstream, enddump, __endtext

The latest CVS version also incorporates separate styles for the C dump/text.

To use flagship.properties and in many IDEs that use this great editor component with Harbour, just change or incorporate the
call to hbmk2.exe constructor. I.e .-
fsObj/fsExe=FlagShip by fsExe=hbmk2 (options are compatible and more in harbour-project.org).

Best regards,
--
Xavi

Xavi

unread,
May 27, 2010, 1:12:27 PM5/27/10
to scintilla...@googlegroups.com
I would like to incorporate separate terms for ending the numerics states before the new version 2.12 coming.

With this update, we continue accept almost anything because of hex. and number suffixes for C/C++ dump and allows much closer
formations xBase code as nA>0.AND. ...

+ Added separate terms for ending numerics states.

Index: LexFlagship.cxx
===================================================================
--- LexFlagship.cxx (revision 1.5)
+++ LexFlagship.cxx (working copy)
@@ -86,9 +86,13 @@
}
break;
case SCE_FS_NUMBER:
+ if (!IsAWordChar(sc.ch) && !(sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_FS_DEFAULT);
+ }
+ break;
case SCE_FS_NUMBER_C:
if (!IsAWordChar(sc.ch) && sc.ch != '.') {
- sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C);
+ sc.SetState(SCE_FS_DEFAULT_C);
}
break;
case SCE_FS_CONSTANT:

Please Neil could you make the change.
Attachment file with the patch and new full LexFlagship.cxx file, TIA.

BTW, in QScintilla not incorporated the class encapsulates for this lexer. Phil?

Best regards,
--
Xavi

LexFlagship.zip

Neil Hodgson

unread,
May 27, 2010, 8:31:51 PM5/27/10
to scintilla...@googlegroups.com
Xavi:

> With this update, we continue accept almost anything because of hex. and
> number suffixes for C/C++ dump and allows much closer formations xBase code
> as nA>0.AND. ...

It appears you want to disallow alphabetic characters in numeric
literals. However, some xBase variants allow such literals. The
wikipedia page for Harbour lists hexadecimal literals in "Number: 1,
1.1, -1, 0xFF":
http://en.wikipedia.org/wiki/Harbour_%28software%29#Built-in_data_types

Neil

Xavi

unread,
May 28, 2010, 6:19:27 AM5/28/10
to scintilla...@googlegroups.com
Hi Neil,

> It appears you want to disallow alphabetic characters in numeric

> literals. ...

No. This only force that after the point must be a digit.

Valid .-
Local dFecha := {^2010/05/28} // These are valid date in Harbour, VFP, ...
Local nA := 0xFF, nB := -1, nC := 1.1, nD := .2 // These are valid numbers

Not valid .-
Local nNo := 2. // Syntax error "syntax error at '.'"
Local nNo := 2.F // Syntax error "syntax error at '.'"

For C/C++ dump is not affected .-
float nfNum = 2. ; // These are valid float

And it allows a correct interpretation of constants and operators.
IF nA>0.AND.nA<9
...
ENDIF

Best regards,
--
Xavi

Neil Hodgson

unread,
May 28, 2010, 7:22:28 PM5/28/10
to scintilla...@googlegroups.com
Xavi:

> No. This only force that after the point must be a digit.

OK, committed.

New prerelease in CVS and available from

Reply all
Reply to author
Forward
0 new messages