Tapatalk

PML Palm Markup Language - Problem....

PML Palm Markup Language - Problem....

1
NewbieNewbie
1

    Feb 09, 2009#1

    Hi!

    I tried generating a highlighting definition for the Palm Markup Language PML.
    It is used to format eBooks for the eReader, which can be used on most handheld devices (http://www.ereader.com)
    On first sight it looks a bit like LATEX, but has some showstoppers.
    Example: To underline a word, you add "\u" infront and after the word you want underlined, same with italics, you use "\i" (without the quotes).
    Similar to HTML, \c\u\iCentered Underlined Italic Text\i\u\c is perfectly legal.
    Adding a Space before "Centered" would underline the space.
    ....but he said "\iNo!\i"
    is a typical example.
    You see the problem - no good delimiters.

    I created a definition like

    Code: Select all

    /L15"Palm Markup" LATEX_LANG Noquote File Extensions = pml
    /Delimiters = ! "	$%&'()*+,-./:;<=>?@[\]^_{|}~0123456789defghjqwyzADEFGHIJKLMNOPRUVWYZ
    /C1"Color Group 1"
    \a
    /C2"Color Group 2"
    \B
    \c
    \i
    \k
    \l
    \m
    \n
    \o
    \p
    \r
    \s
    \u
    \v
    /C3"Color Group 3"
    \Q
    \Sb
    \Sp
    \T
    \b
    \t
    /C5"Color Group 4"
    %
    =
    \-
    \\
    /C6"Color Group 6"
    \C 
    \X
    \x
    
    The "Language" IS CaseSensitive, the "Keyword" set is not complete, as there originally are X0, X1, X2, X3, X4 for Part- and Chapter-Markers, for example. They would only work by removing 0-4 from the delimiter set, where I added all letters that aren't actually used by the language. but of course it wouldn't mark the first \B in \c\BBoldCentered\B\c ...

    in \\c only the \\ should be highlighted, as it's a visible backslash followed by a normal letter, so I added \\ in the special characters "Color Group 4", but it does highlight \c anyway.
    Removing \ from the delimiters makes things much worse, and I also experimented without the LATEX in the first line - no use.

    From a PML example text:

    Code: Select all

    \\i \Q="italic"
    Italic text. Close the block with \\i.
    
    \uExample:\u 
    He said \\iHello\\i as he came in.
    
    \uResult:\u 
    He said \iHello\i as he came in.
    
    all \u should be highlighted, the \\ around the first hello, and the \i around the second.

    I wonder if it's at all possible to do this without regex highlighting, in which case I'd need a new editor...
    Any ideas?
    Greetings and thanks in advance!
    Michael

    P.S.: Missing whitespace anywhere? Blame mykeyboard...
    P.P.S.: \a followed by 3 digits encodes a special character. Those digits should be marked, too. I can add all known legal charcodes, but would have to remove 0-9 from the delimiters then, this is why I have only \a in color group 1...

    6,685587
    Grand MasterGrand Master
    6,685587

      Feb 13, 2009#2

      I think there is no possibility to highlight Palm Markup Language files correct with UltraEdit's syntax highlighting engine. This language uses only very simple escape sequences with the backslash as escape character. There is no delimiter character after such an escape sequence and so there is really a big delimiter problem for the syntax highlighting engine of UltraEdit which is based on words. I'm sorry, but I think you need a different text editor which supports syntax highlighting with regular expressions. I really don't have any idea how to get such a syntax correct highlighted in UltraEdit.
      Best regards from an UC/UE/UES for Windows user from Austria