jEdit Community - Resources for users of the jEdit Text Editor
Trouble writing an edit mode with line continuation characters
Submitted by logris on Tuesday, 28 November, 2006 - 21:35

I am trying to write an edit mode for "JPL", the code behind a 4GL language called Panther and created by Prolifics. I have run into a problem that I cannot find a solution to and I would like to pose it to the JEdit community for any ideas.

Panther statements are newline terminated with a line continuation character. This seems to be the root of my problems. I would like to syntax highlight embedded SQL-like statements using keywords that only pertain to the embedded language. Here is an example of the embedded statement I would like to highlight:

// Call some function
call some_func()

// Begin the embedded SQL to highlight
DBMS SQL SELECT column \
FROM table \
WHERE column = 'Value'

// Do something else
for i= ...

The statement I want to highlight always begins with 'DBMS' and ends at the end of line, unless there is a line continuation character. There can be any number of continued lines. The statement ends at the end of the first line without a continuation character. For now, I will assume nothing can go after the continuation character (no comments).

Any ideas on how to match and delegate this statement to a seperate set of <RULES>? The best I have found so far is use <SEQ> to match the beginning DBMS statement and use <SEQ_REGEXP> to match on " [^\s\\]*$" with a hash character of " " for the end, but that tends to mess up my last token's highlighting.

Maybe there is a way to match on newline or detect the end of line? Or delegate when no more tokens are left on a line? Or match across a line?

Any help would be appreciated. Thanks. =)

Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
The latest edition of jEdit i
by loveSteven on Mon, 16/07/2007 - 08:53
The latest edition of jEdit is 4.3. I found it rather useful than 4.2, although some said 4.2 is more stable. I've tried EditPlus and Emacs.. jEdit is the best of all .When writing edit mode , I didn't face the same problem as you . So maybe what you have to do is just downloading the newest edition . Good luck!

Julie
Forgot to add that I am using
by logris on Tue, 28/11/2006 - 21:38
Forgot to add that I am using JEdit 4.2final.
 
You need upgrade to latest jE
by srobert on Fri, 11/05/2007 - 02:16
You need upgrade to latest jEdit version, I try with JEdit 4.3pre9(2007-01-20 10:31), It seem had fixed this problem. good luck.

--------------------------
software reviews
User login
Browse archives
« March 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82338
Context Free Art (*.cfdg)   0.31   46043
JBuilder scheme   .001   18487
BBEdit scheme   1.0   18107
ColdFusion scheme   1.0   18015
R Edit Mode - extensive version   0.1   17461
Advanced HTML edit mode   1.0   16194
Matlab Edit Mode   1.0   16057
jEdit XP icons   1.0   15220
XP icons for jEdit   1.1   14281