Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

UniHighlighter (SynEdit)

313 views
Skip to first unread message

Jeff

unread,
Jul 24, 2007, 4:25:47 PM7/24/07
to
Has anyone had any success getting the UniHighlighter
(http://www.delphist.com/UniHighlighter.html) component to work? I've
finally got the component installed in to BCB6 and have added it to a
project, but there are issues with it displaying. I appears to "echo" or
append characters (non-selectable) on the screen at the end of each line.

I'm also having trouble understanding how the remarks work in each section
of the highlighter.

Thanks,
Jeff


JD

unread,
Jul 24, 2007, 7:34:44 PM7/24/07
to

"Jeff" <Je...@nospam.com> wrote:
>

Use google groups or google advanced group search (and
search the students group IIRC). There's a help file out
the somewhere that I think was authored by Pete Frazer
(spelling?).

~ JD

Jeff

unread,
Jul 24, 2007, 7:52:29 PM7/24/07
to
> Use google groups or google advanced group search (and
> search the students group IIRC). There's a help file out
> the somewhere that I think was authored by Pete Frazer
> (spelling?).

I've dug around on Google Groups and wasn't able to find much of anything
and most of the web results are in Russian.


JD

unread,
Jul 24, 2007, 8:42:23 PM7/24/07
to

"Jeff" <Je...@nospam.com> wrote:
>
>> [...] or google advanced group search (and search the
>> students group IIRC).
>

> I've dug around on Google Groups and wasn't able to find
> much of anything [...]

I did a google advance group search and found it in less that
a minute (sorry that I didn't do that for you but I assumed
that you knew how):

http://groups.google.com/advanced_group_search

with all of the words: synedit help
Return only messages from the group at this location: borland.public.cppbuilder.students

which resulted in this link (and it's still valid!):

www.frasersoft.net/synedithelp.zip

(note that I did indeed spell the name wrong BUT i had the
right name! <g>).

~ JD

Jeff

unread,
Jul 25, 2007, 1:12:09 PM7/25/07
to
> http://groups.google.com/advanced_group_search

>
> which resulted in this link (and it's still valid!):
>
> www.frasersoft.net/synedithelp.zip

Thanks a lot for the great information on SynEdit, but my issues are with
UniHighlighter. It's a third-party component that provides custom syntax
highlighting to SynEdit. Has anyone had any luck working with the
UniHighlighter component?


Remy Lebeau (TeamB)

unread,
Jul 25, 2007, 2:37:02 PM7/25/07
to

"Jeff" <Je...@nospam.com> wrote in message
news:46a784b5$1...@newsgroups.borland.com...

> Thanks a lot for the great information on SynEdit, but my
> issues are with UniHighlighter. It's a third-party component
> that provides custom syntax highlighting to SynEdit. Has
> anyone had any luck working with the UniHighlighter
> component?

Have you tried contacting the component's author yet?


Gambit


Remy Lebeau (TeamB)

unread,
Jul 25, 2007, 2:47:28 PM7/25/07
to

"Jeff" <Je...@nospam.com> wrote in message
news:46a6...@newsgroups.borland.com...

> Has anyone had any success getting the UniHighlighter
> (http://www.delphist.com/UniHighlighter.html)
> component to work?

That version of UniHighligher hasn't been updated in 4 years. SynEdit is
still actively developed, so I doubt UniHighlighter has all of the latest
changes needed to work properly anymore.

I do notice that a slightly newer project was created for UniHighlighter on
SourceForge (http://sourceforge.net/projects/unihighlighter/) 3 years ago,
but it doesn't have any files on it.


Gambit


Jeff

unread,
Jul 25, 2007, 2:43:21 PM7/25/07
to
> Have you tried contacting the component's author yet?

Yes, he says "Unfortunately, I do not support this project any more. I have
started it, but right now it is developing and supporting by other guys."
The website still lists him as the author
(http://www.delphist.com/About.html).


Jeff

unread,
Jul 25, 2007, 3:20:46 PM7/25/07
to
> That version of UniHighligher hasn't been updated in 4 years. SynEdit is
> still actively developed, so I doubt UniHighlighter has all of the latest
> changes needed to work properly anymore.

Do you perhaps know of a better way to have custom syntax highlighters?


Jeff

unread,
Jul 25, 2007, 5:56:31 PM7/25/07
to
Has anyone used the SynGen application in order to build their own
highlighter? I can't seem to figure out how to use the .pas file that's
generated in my BCB6 project?


Remy Lebeau (TeamB)

unread,
Jul 25, 2007, 6:22:59 PM7/25/07
to

"Jeff" <Je...@nospam.com> wrote in message
news:46a7a2cb$1...@newsgroups.borland.com...

> Do you perhaps know of a better way to
> have custom syntax highlighters?

I don't think there is any other way, other than to write your own set of
highlighter classes.


Gambit


Remy Lebeau (TeamB)

unread,
Jul 25, 2007, 6:33:08 PM7/25/07
to

"Jeff" <Je...@nospam.com> wrote in message
news:46a7c748$1...@newsgroups.borland.com...

> Has anyone used the SynGen application in order to build
> their own highlighter? I can't seem to figure out how to
> use the .pas file that's generated in my BCB6 project?

You should be able to just add it to the project, then compile the .pas file
to generate a .hpp file, then #include that file into your C++ code, then
instantiate the class at runtime, and assign it to the SynEdit component you
are using. Are you having a particular problem with that?


Gambit


Jeff

unread,
Jul 25, 2007, 7:12:44 PM7/25/07
to
> You should be able to just add it to the project, then compile the .pas
> file
> to generate a .hpp file, then #include that file into your C++ code, then
> instantiate the class at runtime, and assign it to the SynEdit component
> you
> are using. Are you having a particular problem with that?

I can add the SynHighlighterSample.pas file to my project and compile it and
it generates the hpp file, but when I include it I get error E2352 (Cannot
create instance of abstract class 'TSynSampleSyn') on line 1 below.

Here's the instantiation code:
//Instantiate the highlighter and assign it
1 TSynSampleSyn hlSample = new TSynSampleSyn;
2
3 SynEdit->Highlighter = hlSample;
4 SynEdit->ClearAll;
5 SynEdit->Text = hlSample->SampleSource;


Remy Lebeau (TeamB)

unread,
Jul 25, 2007, 8:22:13 PM7/25/07
to

"Jeff" <Je...@nospam.com> wrote in message
news:46a7d924$1...@newsgroups.borland.com...

> I can add the SynHighlighterSample.pas file to my project and
> compile it and it generates the hpp file, but when I include it
> I get error E2352 (Cannot create instance of abstract class
> 'TSynSampleSyn') on line 1 below.

The compiler tells you why it is abstract exactly.

> 1 TSynSampleSyn hlSample = new TSynSampleSyn;

I assume you meant to declare a pointer variable instead. Also, don't
forget that it is a component, so you have to pass an Owner parameter to the
constructor:

TSynSampleSyn *hlSample = new TSynSampleSyn(this);


Gambit


Jeff

unread,
Jul 25, 2007, 8:29:34 PM7/25/07
to
> The compiler tells you why it is abstract exactly.

Here's what the compiler states:
Class 'TSynSampleSyn' is abstract because of '_fastcall
TSynCustomHighlighter::GetEol() = 0'

What does this mean?


Remy Lebeau (TeamB)

unread,
Jul 25, 2007, 8:39:44 PM7/25/07
to

"Jeff" <Je...@nospam.com> wrote in message
news:46a7eb26$1...@newsgroups.borland.com...

> Here's what the compiler states:
> Class 'TSynSampleSyn' is abstract because of '_fastcall
> TSynCustomHighlighter::GetEol() = 0'
>
> What does this mean?

It means that the TSynCustomHighlighter class has an abstract method named
GetEol() that descendant classes must implement, but your TSynSampleSyn
class does not actually have an implementation for it.


Gambit


Jeff

unread,
Jul 26, 2007, 11:54:33 AM7/26/07
to
> It means that the TSynCustomHighlighter class has an abstract method named
> GetEol() that descendant classes must implement, but your TSynSampleSyn
> class does not actually have an implementation for it.

SynHighlighterSample.pas has an implementation for it:
function TSynSampleSyn.GetEol: Boolean;
begin
Result := fTokenID = tkNull;
end;


Remy Lebeau (TeamB)

unread,
Jul 26, 2007, 2:28:04 PM7/26/07
to

"Jeff" <Je...@nospam.com> wrote in message
news:46a8c3f4$1...@newsgroups.borland.com...

> SynHighlighterSample.pas has an implementation for it:

Then either your implementation's signature does not match the signature in
TSynCustomHighlighter, or your implementation does not include the
'override' specifier. Those are the only two ways an abstract method would
not be overriden correctly.

The exact signature of TSynCustomHighlighter is declared as follows:

function GetEol: Boolean; virtual; abstract;

The signature in your class must look like this:

function GetEol: Boolean; override;


Gambit


Jeff

unread,
Jul 26, 2007, 2:39:24 PM7/26/07
to
> Then either your implementation's signature does not match the signature
> in
> TSynCustomHighlighter, or your implementation does not include the
> 'override' specifier. Those are the only two ways an abstract method
> would
> not be overriden correctly.
>
> The exact signature of TSynCustomHighlighter is declared as follows:
>
> function GetEol: Boolean; virtual; abstract;
>
> The signature in your class must look like this:
>
> function GetEol: Boolean; override;

SynHighlighterSample.pas contains this signature:

function GetEol: Boolean; override;

Any thoughts? I've emailed the SynEdit group but haven't seen a response
yet.


Remy Lebeau (TeamB)

unread,
Jul 26, 2007, 4:41:04 PM7/26/07
to

"Jeff" <Je...@nospam.com> wrote in message
news:46a8ea90$1...@newsgroups.borland.com...

> SynHighlighterSample.pas contains this signature:
>
> function GetEol: Boolean; override;
>
> Any thoughts?

What does it look like in your HPP file?


Gambit


Mark Guerrieri

unread,
Jul 30, 2007, 5:37:56 PM7/30/07
to
"Jeff" <Je...@nospam.com> wrote in message
news:46a6...@newsgroups.borland.com...

> Has anyone had any success getting the UniHighlighter
> (http://www.delphist.com/UniHighlighter.html) component to work? I've
> finally got the component installed in to BCB6 and have added it to a
> project, but there are issues with it displaying. I appears to "echo" or
> append characters (non-selectable) on the screen at the end of each line.

I am using the syntax highlighting components that are part of the SynEdit
package without issue (i.e. TSynMultiSyn, TSynHTMLSyn, TSynVBScriptSyn,
TSynJScriptSyn, etc.)

Mark


Jeff

unread,
Aug 2, 2007, 9:27:21 AM8/2/07
to
> I am using the syntax highlighting components that are part of the SynEdit
> package without issue (i.e. TSynMultiSyn, TSynHTMLSyn, TSynVBScriptSyn,
> TSynJScriptSyn, etc.)

I've used those as well and they work fine, I'm trying to build a custom
highlighter for a proprietary script format.


Jeff

unread,
Aug 2, 2007, 9:28:31 AM8/2/07
to
>
> What does it look like in your HPP file?

SynHighlighterSample.hpp:

// Borland C++ Builder
// Copyright (c) 1995, 2002 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'SynHighlighterSample.pas' rev:
6.00

#ifndef SynHighlighterSampleHPP
#define SynHighlighterSampleHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <SynEditHighlighter.hpp> // Pascal unit
#include <SynEditTypes.hpp> // Pascal unit
#include <Graphics.hpp> // Pascal unit
#include <Controls.hpp> // Pascal unit
#include <Windows.hpp> // Pascal unit
#include <Classes.hpp> // Pascal unit
#include <SysUtils.hpp> // Pascal unit
#include <SysInit.hpp> // Pascal unit
#include <System.hpp> // Pascal unit

//-- user
supplied -----------------------------------------------------------

namespace Synhighlightersample
{
//-- type
declarations -------------------------------------------------------
#pragma option push -b-
enum TtkTokenKind { tkComment, tkIdentifier, tkKey, tkNull, tkSpace,
tkString, tkTest, tkUnknown };
#pragma option pop

#pragma option push -b-
enum TRangeState { rsUnKnown, rsBraceComment, rsCStyleComment, rsString };
#pragma option pop

typedef void __fastcall (__closure *TProcTableProc)(void);

typedef TtkTokenKind __fastcall (__closure *TIdentFuncTableFunc)(void);

typedef TIdentFuncTableFunc *PIdentFuncTableFunc;

class DELPHICLASS TSynSampleSyn;
class PASCALIMPLEMENTATION TSynSampleSyn : public
Synedithighlighter::TSynCustomHighlighter
{
typedef Synedithighlighter::TSynCustomHighlighter inherited;

private:
char *fLine;
int fLineNumber;
TProcTableProc fProcTable[256];
TRangeState fRange;
int Run;
int fStringLen;
char *fToIdent;
int fTokenPos;
TtkTokenKind fTokenID;
TIdentFuncTableFunc fIdentFuncTable[97];
Synedithighlighter::TSynHighlighterAttributes* fCommentAttri;
Synedithighlighter::TSynHighlighterAttributes* fIdentifierAttri;
Synedithighlighter::TSynHighlighterAttributes* fKeyAttri;
Synedithighlighter::TSynHighlighterAttributes* fSpaceAttri;
Synedithighlighter::TSynHighlighterAttributes* fStringAttri;
Synedithighlighter::TSynHighlighterAttributes* fTestAttri;
int __fastcall KeyHash(char * ToHash);
bool __fastcall KeyComp(const AnsiString aKey);
TtkTokenKind __fastcall Func52(void);
TtkTokenKind __fastcall Func72(void);
TtkTokenKind __fastcall Func96(void);
void __fastcall IdentProc(void);
void __fastcall UnknownProc(void);
TtkTokenKind __fastcall AltFunc(void);
void __fastcall InitIdent(void);
TtkTokenKind __fastcall IdentKind(char * MayBe);
void __fastcall MakeMethodTables(void);
void __fastcall NullProc(void);
void __fastcall SpaceProc(void);
void __fastcall CRProc(void);
void __fastcall LFProc(void);
void __fastcall BraceCommentOpenProc(void);
void __fastcall BraceCommentProc(void);
void __fastcall CStyleCommentOpenProc(void);
void __fastcall CStyleCommentProc(void);
void __fastcall StringOpenProc(void);
void __fastcall StringProc(void);

protected:
virtual Synedittypes::TSynIdentChars __fastcall GetIdentChars();
virtual AnsiString __fastcall GetSampleSource();
virtual bool __fastcall IsFilterStored(void);

public:
__fastcall virtual TSynSampleSyn(Classes::TComponent* AOwner);
/* virtual class method */ virtual AnsiString __fastcall
GetLanguageName(TMetaClass* vmt);
virtual void * __fastcall GetRange(void);
virtual void __fastcall ResetRange(void);
virtual void __fastcall SetRange(void * Value);
virtual Synedithighlighter::TSynHighlighterAttributes* __fastcall
GetDefaultAttribute(int Index);
virtual bool __fastcall GetEOL(void);
AnsiString __fastcall GetKeyWords();
TtkTokenKind __fastcall GetTokenID(void);
virtual void __fastcall SetLine(AnsiString NewValue, int LineNumber);
virtual AnsiString __fastcall GetToken();
virtual Synedithighlighter::TSynHighlighterAttributes* __fastcall
GetTokenAttribute(void);
virtual int __fastcall GetTokenKind(void);
virtual int __fastcall GetTokenPos(void);
virtual void __fastcall Next(void);

__published:
__property Synedithighlighter::TSynHighlighterAttributes* CommentAttri =
{read=fCommentAttri, write=fCommentAttri};
__property Synedithighlighter::TSynHighlighterAttributes* IdentifierAttri =
{read=fIdentifierAttri, write=fIdentifierAttri};
__property Synedithighlighter::TSynHighlighterAttributes* KeyAttri =
{read=fKeyAttri, write=fKeyAttri};
__property Synedithighlighter::TSynHighlighterAttributes* SpaceAttri =
{read=fSpaceAttri, write=fSpaceAttri};
__property Synedithighlighter::TSynHighlighterAttributes* StringAttri =
{read=fStringAttri, write=fStringAttri};
__property Synedithighlighter::TSynHighlighterAttributes* TestAttri =
{read=fTestAttri, write=fTestAttri};
public:
#pragma option push -w-inl
/* TSynCustomHighlighter.Destroy */ inline __fastcall virtual
~TSynSampleSyn(void) { }
#pragma option pop

};


//-- var, const,
procedure ---------------------------------------------------
static const Shortint MaxKey = 0x60;

} /* namespace Synhighlightersample */
using namespace Synhighlightersample;
#pragma option pop // -w-
#pragma option pop // -Vx

#pragma delphiheader end.
//-- end
unit ----------------------------------------------------------------
#endif // SynHighlighterSample


Remy Lebeau (TeamB)

unread,
Aug 2, 2007, 2:52:53 PM8/2/07
to

"Jeff" <Je...@nospam.com> wrote in message
news:46b1dc2b$1...@newsgroups.borland.com...

> virtual bool __fastcall GetEOL(void);

Look very carefully at that signaure. Now look at the signature in
SynEditHighligher.hpp:

virtual bool __fastcall GetEol(void) = 0 ;

Notice anything different? The compiler is looking for a method named
"GetEol" but your method is named "GetEOL" instead. C++ is case-sensitive.


Gambit


Jeff

unread,
Aug 2, 2007, 3:24:32 PM8/2/07
to
> Notice anything different? The compiler is looking for a method named
> "GetEol" but your method is named "GetEOL" instead. C++ is
> case-sensitive.

I made sure that both files SynEditHighlighter.hpp and
SynHighlighterSample.hpp both contain the same case: virtual bool __fastcall
GetEol(void); and I still get the same compilation error.

Any thoughts?


Remy Lebeau (TeamB)

unread,
Aug 2, 2007, 5:19:06 PM8/2/07
to

"Jeff" <Je...@nospam.com> wrote in message
news:46b22fa8$1...@newsgroups.borland.com...

> I made sure that both files SynEditHighlighter.hpp and
> SynHighlighterSample.hpp both contain the same case:
> virtual bool __fastcall GetEol(void); and I still get the
> same compilation error.

You can't be getting the same error if they match exactly now.

Do keep in mind that your .hpp file may be getting regenerated each time you
compile the project, though. You have to make sure that the original .pas
file for your class is producing the proper .HPP code so that you don't have
to manually re-patch it each time.


Gambit


0 new messages