Eclipse Syntax Highlighter For Proxo/Sidki - Intro
|
Nov. 04, 2009, 07:39 AM
(This post was last modified: Nov. 21, 2009 11:50 AM by ProxoDent.)
Post: #1
|
|||
|
|||
Eclipse Syntax Highlighter For Proxo/Sidki - Intro
I've finished up a working syntax highlighter / colorer for use with *.ptron and *.ptxt files in Eclipse. Colorer-take5 plug-in for Eclipse is required as the rules were written in CT5's hrc format.
I won't post the actual working files yet because I'd like to document it further, test it for a bit longer, and maybe add some color-scheme files. Some plug-ins for Eclipse can be a little quirky. So far everything seems stable enough. In the meantime, I'll post some screenshots of it and provide a link to a 'blog' I set-up on Live.com. On the blog, you can view some video clips of the paired-symbol matching and outline features I coded (I'm not sure how long I'll leave the link active / available to the public). I really doubt there will be much interest in this, but it was a nice diversion putting it together for myself. ![]() ---------------------------------------- 2009-11-20 - Version 1.0.0 uploaded. Files in 'zip' attachment (7): ptron.hrc ptxt.hrc ptron01.hrd ptxt01.hrd FilterOutlined.gif SectionOutlined.gif README.txt The README.txt file contains info and INSTALL instructions. I will not reproduce all of it here as it is quite lengthy, but here are the 'Requirements' section and selected 'Notes' from the file. The info may be of interest to anyone thinking about trying this out without having to download the zip file and digging through everything else. It may have the effect of persuading or dissuading you to continue. Code: ----- I'll post modified files required for console-based editors like FAR Manager later. |
|||
Nov. 04, 2009, 09:37 AM
Post: #2
|
|||
|
|||
RE: Eclipse Syntax Highlighter For Proxo/Sidki - Intro
You got to kidding me! Proxo needs a syntax highlighter. LOL!
|
|||
Nov. 04, 2009, 12:25 PM
(This post was last modified: Nov. 04, 2009 12:27 PM by ProxRocks.)
Post: #3
|
|||
|
|||
RE: Eclipse Syntax Highlighter For Proxo/Sidki - Intro
looks pretty impressive...
i've seen similar for Notepad++ i've always kinda wondered if parenthesis-pairs could be paired somehow? |
|||
Nov. 13, 2009, 07:48 AM
Post: #4
|
|||
|
|||
RE: Eclipse Syntax Highlighter For Proxo/Sidki - Intro
Stop teasing, GIMME! :P
Im new at all this and regex stuff does my head in, looking at your screenshots its obvious this would help me alot. Is there anychance it would work with this.... http://colorer.sourceforge.net/farplugin.html ...its just that eclipse is a bit much for me and I dont want to have to download it again (dialup and all) but I will ![]() Really looking forward to this. If anyone has a syntax highlighter for any other app Id really appreciate that also, except the Ultraedit one.....I dont like Ultraedit |
|||
Nov. 13, 2009, 02:55 PM
Post: #5
|
|||
|
|||
RE: Eclipse Syntax Highlighter For Proxo/Sidki - Intro
(Nov. 13, 2009 07:48 AM)PAEz Wrote: Is there anychance it would work with this.... No. Far Manager is a Windows-based file manager similar to Midnight Commander (MC is available on Linux-based systems, including Cygwin). Both of those file managers have plug-ins available to them that allow use of the Colorer library, but rather than being used for syntax highlighting, the library is used to distinguish file types, directory types, etc. (Nov. 13, 2009 07:48 AM)PAEz Wrote: ...its just that eclipse is a bit much for me and I dont want to have to download it again (dialup and all) but I will See below. (Nov. 13, 2009 07:48 AM)PAEz Wrote: If anyone has a syntax highlighter for any other app Id really appreciate that also, except the Ultraedit one.....I dont like Ultraedit I originally put together an Eclipse syntax highlighter using jEdit's format for use with another Eclipse plug-in. However, I realized early on I didn't really like the editor provided by the plug-in for one reason or another, so I switched to Colorer-Take5's plug-in. Colorer-Take5 is more complex to write syntax code for, but it is more flexible and customizable. The Colorer-Take5 plug-in does not provide a GUI for changing colors, so it is also more difficult to explain how to use, thus another reason for my delay in posting it: I'll have to do an instructional write-up explaining how to use it. In the meantime, since you would prefer not to use Eclipse anyway, I'll post the jEdit-format file, which surprise, can be used with jEdit. It's not my editor of choice (I generally don't like JAVA apps, Eclipse excepted), but it might work for you. Give it a try if you haven't already (download is ~3MB), and I'll post the Proxo syntax highlighter for it later today or tonight**. It may have some warts because, as I said, I don't use it, nor do I intend to use it. I'll clean it up a little, though. http://www.jedit.org/ ----- ** I reserve the right to change my mind after waking up a bit more and realizing just how warty I left the code the last time I worked on it. ![]() |
|||
Nov. 13, 2009, 04:10 PM
Post: #6
|
|||
|
|||
RE: Eclipse Syntax Highlighter For Proxo/Sidki - Intro
Quote:No. Far Manager is a Windows-based file manager similar to Midnight Commander (MC is available on Linux-based systems, including Cygwin). Both of those file managers have plug-ins available to them that allow use of the Colorer library, but rather than being used for syntax highlighting, the library is used to distinguish file types, directory types, etc.Are you sure? I got Far for something to do and the plugin and it was highlighting pas files (in edit, not view). The Eclipse one looks better but either would help (Ill get Eclipse). You fussy people worring about how good your code is :P....Im a crap coder so I wouldnt care :P Looking forward to either, thanks. |
|||
Nov. 13, 2009, 07:25 PM
Post: #7
|
|||
|
|||
RE: Eclipse Syntax Highlighter For Proxo/Sidki - Intro
(Nov. 13, 2009 04:10 PM)PAEz Wrote:Quote:No. Far Manager is a Windows-based file manager similar to Midnight Commander (MC is available on Linux-based systems, including Cygwin). Both of those file managers have plug-ins available to them that allow use of the Colorer library, but rather than being used for syntax highlighting, the library is used to distinguish file types, directory types, etc.Are you sure? I got Far for something to do and the plugin and it was highlighting pas files (in edit, not view). Well. No. I'm not sure. I'm wrong actually (the underlined part above is where I went wrong ... the most important part). I actually built and installed Colorer for Midnight Commander on my Arch Linux installation some time ago ... I guess so long ago I forgot why I built and installed it. Anyway, I downloaded FAR Manager to see how it would work. After modifying some code to get things right (especially modifying RGB colors to work in console), everything seems to work including matching pairs and even the Outliner. Screen shots posted. I'll get the jEdit file up anyway later on today/tonight/early tomorrow morning, but I already noticed a problem when I reviewed the screen shot I posted ... text following a '#' that was actually part of the Proxo code was highlighted as a comment. That shouldn't be difficult to fix. Hopefully, I can set some time aside within the week to finish documenting the Colorer-Take5 (Eclipse / FAR / MC) version and get a set of instructions drafted for installation and modifying the colors. |
|||
Nov. 14, 2009, 06:17 AM
Post: #8
|
|||
|
|||
RE: Eclipse Syntax Highlighter For Proxo/Sidki - Intro
MORE TEASING!!
![]() ![]() ![]() Great to hear it does work with FAR and thanks for taking the time to check. Dont worry to much about the jedit one if Im going to be able to use a lighter option than eclipse with the plugin, Im impatient but Id rather you spend your time on the plugin. Im going to need those instructions on changeing colours as the FAR one has a bit to much contrast for my liking, sure does look sweet tho. Ooooh, that outliner is an added bonus! |
|||
Nov. 15, 2009, 02:30 PM
(This post was last modified: Nov. 15, 2009 08:43 PM by ProxoDent.)
Post: #9
|
|||
|
|||
RE: Eclipse Syntax Highlighter For Proxo/Sidki - Intro
(Nov. 14, 2009 06:17 AM)PAEz Wrote: Dont worry to much about the jedit one if Im going to be able to use a lighter option than eclipse with the plugin, Im impatient but Id rather you spend your time on the plugin. I took your suggestion yesterday and skipped working on the jEdit highlighter. However, during the course of the day, I used jEdit for some work just to see how it stacked up against my preconceived dislike for JAVA apps, and I have to admit I liked it enough to finish the jEdit-based highlighting code rather than just clean it up. Among other things, I added / modified code so the paired symbols matching now respects escapes and allows for Perl character class rules within square-brackets just as I had done for the Colorer-Take5 version. I think if you give this a try with jEdit, you'll like it. I originally gave up on it because the Eclipse plug-in (I don't know who wrote it) that uses the jEdit format was pretty wonky: it didn't respect the rules I was writing which were based on jEdit's documentation (possibly because the plug-in may be based on an older version of jEdit's format), it didn't utilize the paired-matching capability, and the editor supplied was very basic and did some unexpected things that I couldn't tolerate (among the examples, undo'ing edits would never turn off the 'unsaved' status indicator despite the fact that the file had been returned to its original state). However, none of the issues are present when using the syntax code with jEdit itself. Don't worry, I'll continue with the Colorer-Take5 code documentation, because it is likely the one I'll use the most. But I also use Eclipse for bigger projects (mostly Perl and Python). I don't think I'd wish it on anybody to set up Eclipse for the sole purpose of editing Proxomitron files. But that's your call. Editing files in MC or FAR doesn't appeal to me either; if I was going to use a console editor, I'd use Vim or emacs. That said, it's always nice to have options. Okay, let's get to it: 1. Install jEdit; 2. Copy the attached 'ptron.xml' file (after unzipping it) to the 'modes' sub-directory under the jEdit root; 3. Open the existing 'catalog' file (also in the 'modes' sub-directory) and add this code to the file: Code: <MODE NAME="ptron" FILE="ptron.xml" Make sure the code is placed between the <MODES> </MODES> tags (it's easiest just to stick it at the end of the file right before the closing </MODES> tag. Here's the mapping of the colors, and the corresponding RGB codes to set in jEdit if you want to make the syntax look exactly like it appears in the screen shots (the mapping documentation is in the xml file as well): Code: Color Mapping Also, jEdit has settings for adjusting the font appearance that were mandatory for me, otherwise jEdit was unusable. Adjust these settings if you have issues:
Final caveat: I am definitely not a syntax-writing guru, and I learned the coding format strictly for this project. I also lose interest in side-projects pretty quickly, so any issues found may need to be addressed by the end-user. ![]() |
|||
Nov. 15, 2009, 08:02 PM
Post: #10
|
|||
|
|||
RE: Eclipse Syntax Highlighter For Proxo/Sidki - Intro
That works nicely.
![]() jEdit feels cumbersome here however (in Ubuntu 9.10). IIRC Notepad++ syntax highlighting is based on Scintilla/SciTE, which is available for Linux too. |
|||
Nov. 15, 2009, 08:30 PM
(This post was last modified: Nov. 15, 2009 08:42 PM by ProxoDent.)
Post: #11
|
|||
|
|||
RE: Eclipse Syntax Highlighter For Proxo/Sidki - Intro
(Nov. 15, 2009 08:02 PM)sidki3003 Wrote: That works nicely. I use Arch Linux primarily, but I did all the work described in this thread on Windows, so I haven't tried jEdit on Linux yet (I do have Ubuntu installed as well, but it doesn't get much use ... still haven't upgraded to 9.10). Compared to Scite, everything probably feels cumbersome. ![]() And speaking of Scite, which is my default editor on both Windows and Linux, but for which I haven't a clue or desire to build a lexer, where can I pick up the syntax highlighter (hopefully you're not just referring to adding keywords to the Properties file)? Thanks. I uploaded a revised ptron.xml (v1.0.2 available in the original post). Changelog: - Added a couple of missing Proxo matching commands: -- $FILE -- $RESP - Edited some majorly incoherent code comments so that they are at least only slightly incoherent. They'll be revisited when I have more time. |
|||
Nov. 15, 2009, 08:42 PM
Post: #12
|
|||
|
|||
RE: Eclipse Syntax Highlighter For Proxo/Sidki - Intro
Yep, i do mean syntax highlighting. I haven't SciTE installed right now, never really delved into it anyway, so i can't be of help here.
![]() |
|||
Nov. 20, 2009, 03:45 PM
Post: #13
|
|||
|
|||
RE: Eclipse Syntax Highlighter For Proxo/Sidki - Intro
(Nov. 13, 2009 07:25 PM)ProxoDent Wrote: Hopefully, I can set some time aside within the week to finish documenting the Colorer-Take5 (Eclipse / FAR / MC) version and get a set of instructions drafted for installation and modifying the colors. In the interest of keeping my word and as a show of good faith , I'm posting the core files required for use with the Colorer-Take5 Eclipse plug-in. I'll be back on later with the instructions on how to use them. ![]() The files are attached to the original post in this thread (as will be any updates, additions or instructions). |
|||
Nov. 21, 2009, 12:50 AM
Post: #14
|
|||
|
|||
RE: Eclipse Syntax Highlighter For Proxo/Sidki - Intro
Okay.
Proxo-CT5 v1.0.0 is uploaded and available in the original post. All files needed to get it working in Eclipse are included along with instructions. |
|||
« Next Oldest | Next Newest »
|