Own syntax schemes

Questions on using RSyntaxTextArea should go here.

Moderator: robert

Re: Own syntax schemes

Postby robert » Thu Aug 20, 2009 6:12 pm

It would be easy to add the ability to add new keywords, even to the existing JFlex-based TokenMakers. We could add an API to add/remove the additional keywords:

java code:

public void addHighlightedIdentifier(String word, int tokenType);
public boolean removeHighlightedIdentifier(String word);
public void clearAddedHighlightedIdentifiers();


The "tokenType" parameter would allow you to specify whether to colorize it as a keyword, function, etc.

Then you could write the code that scans your beanshell folder, and uses the methods above to set the additional words to highlight. You could simply run that code when your app starts up, and also assign it to an Action for a menu item to force reloading. Or perhaps use a Timer to periodically check the modified time of the directory, and auto-reload if the directory's contents have been modified since the last load.

The more involved (but still easy) solution is to make ALL keywords be in this "identifier" list, even the predefined ones. Then you could remove standard Java keywords (for example) you don't need/want. This is much more robust, but I just can't convince myself to go this route do to the (albeit likely small) performance hit that would be incurred.

I can see where the former solution would be very handy for situations like yours, basically dynamically adding functions. It would also be handy if you used ctags to parse source, and wanted the methods/classes/etc. identified to be highlighted.

Bug me enough and I'll see what I can do. :D
User avatar
robert
 
Posts: 805
Joined: Sat May 10, 2008 5:16 pm

Re: Own syntax schemes

Postby robert » Mon Oct 05, 2009 3:34 pm

I have a utility application I've been working on occasionally for awhile, that lets you create the .flex and .java sources for a custom TokenMaker class, and even test it out in an RSyntaxTextArea at "development time." This application is just starting out but already looks promising. Contact me or reply to this thread if you are interested in beta testing it.

Once it is robust enough I'll give it its own project in Subversion for downloading.
User avatar
robert
 
Posts: 805
Joined: Sat May 10, 2008 5:16 pm

Re: Own syntax schemes

Postby hubersn » Thu Oct 08, 2009 2:13 pm

Hi Robert,

it would be great if I could have a go at TokenMakerMaker - I'll try to use it to replace my simple "homebrew" syntax colourers.

Thanks,
hubersn
hubersn
 
Posts: 10
Joined: Fri Jul 31, 2009 11:45 pm

Re: Own syntax schemes

Postby robert » Fri Oct 09, 2009 12:34 pm

Hey hubersn,

I just send you mail offline pointing you to a TokenMakerMaker beta, along with some simple doc for it. Can't wait to hear some feedback!
User avatar
robert
 
Posts: 805
Joined: Sat May 10, 2008 5:16 pm

Re: Own syntax schemes

Postby any progress on this?? » Sat Nov 21, 2009 2:15 pm

this would be very nice....any chance we will see it any time soon?
thx for great project!

mike

===========================================================================================

And I actually have started working on a GUI frontend for this whole business. For those that don't want to learn JFlex, this little app will allow you to generate scanners for your own languages with ease. It'll even let you test it out, by launching an RSTA instance using your scanner in a window, so you can interactively test at build time! It'll generate the .java for you (e.g. the JFlex output, with any needed modifications), so you can just take that and drop it into your project.
any progress on this??
 

Re: Own syntax schemes

Postby robert » Sat Nov 21, 2009 9:43 pm

Strangely I never heard back from hubersn, or another guy I sent it out to. If you'd like to try out what I currently have, send me an email and I'll send it to you. Again, feedback from users will largely dictate what features get added first!
User avatar
robert
 
Posts: 805
Joined: Sat May 10, 2008 5:16 pm

Re: Own syntax schemes

Postby thx robert...i will try the solution » Mon Nov 23, 2009 11:26 am

my email is xxxxx@xxxxx.com. please send it to xxxxx@msn.com as well in case the code is stripped off by the av code at work.

many thanks and have a great holiday.

warmest regards,

mike
thx robert...i will try the solution
 

Re: Own syntax schemes

Postby robert » Tue Nov 24, 2009 4:03 am

Just an FYI Mike - I sent mail to your MSN account, since it sounds like it might not make it through to your work email. I also censored your email addresses in your post to keep you from getting spammed. :D

Thanks,

Robert
User avatar
robert
 
Posts: 805
Joined: Sat May 10, 2008 5:16 pm

Re: Own syntax schemes

Postby hubersn » Tue Nov 24, 2009 11:05 pm

robert wrote:Strangely I never heard back from hubersn, or another guy I sent it out to. If you'd like to try out what I currently have, send me an email and I'll send it to you. Again, feedback from users will largely dictate what features get added first!


Hi Robert,

we are currently doing a new release of our software, so I am currently "a bit busy". I will be able to provide meaningful feedback in approx. two weeks. Stay tuned...sorry for not being able to respond earlier.

hubersn
hubersn
 
Posts: 10
Joined: Fri Jul 31, 2009 11:45 pm

Re: Own syntax schemes

Postby mpitonia@enterasys.com » Fri Nov 27, 2009 9:48 pm

robert,

the ability to add keywords via:


public void addHighlightedIdentifier(String word, int tokenType);
public boolean removeHighlightedIdentifier(String word);
public void clearAddedHighlightedIdentifiers();


...is still highly desirable for me...any chance i could bribe you to add this at some time :)

regards,

mike
mpitonia@enterasys.com
 

PreviousNext

Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron