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. =)