ABAP code syntax highlighting

Just finished and eager to share - I added a new syntax definition to the Text_Highlighter PEAR package (see also here). It's for highlighting code written in the SAP's own ABAP programming language.

A live demo is available at the hiliteme.com site, just pick ABAP from the drop-down of programming languages. Any feedback is appreciated, because it's a brand new thing and may have bugs or incompletenesses (is that a word?). So feel free to highlight your ABAP code and post it to blogs or forums.

The implementation wasn't hard, the Text_Highlighter package is made to be extended and even provides the tools for that. All you need to do is create an XML file that contains keywords and other syntax rules, such as formats of the comments and so on. Then there is a command line tool that takes the XML file and generates a class out of it. The class is later on used when highlighting. Here's the XML file in case you want to improve on it and generate your own ABAP.php class:

This entry was posted on Tuesday, September 19th, 2006 and is filed under abap, PEAR, SAP. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


Get notification for future posts: follow me on Twitter or subscribe to my RSS feed

3 Responses to “ABAP code syntax highlighting”

  1. phpied.com » Blog Archive » JSON renderer for Text_Highlight Says:

    [...] Text_Highlighter is one of my favourite PEAR packages, seems like I’m addicted to highlighting source code. After adding BB code and simple HTML renderers and an ABAP code syntax definition, today I played with adding a JSON renderer. Useful in case you want to get highlighted source code in your new shiny AJAX app. [...]

  2. phpied.com » Blog Archive » Personal news update Nov/06 Says:

    [...] Another contribution to PEAR was the ABAP language definition for the Text_Highlighter package [...]

  3. webler Says:

    SELECT

    VBAP~MATNR
    VBAP~KWMENG
    VBAP~WERKS

    into nacharbeit
    from VBAP WHERE VBAP~VBELN = verkbel AND VBAP~PSTYV = ‘REN’.

    ENDSELECT.

Leave a Reply