ABAP code syntax highlighting

September 19th, 2006. Tagged: abap, PEAR, SAP

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:

Tell your friends about this post: Facebook, Twitter, Google+

9 Responses

  1. [...] 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. [...] Another contribution to PEAR was the ABAP language definition for the Text_Highlighter package [...]

  3. SELECT

    VBAP~MATNR
    VBAP~KWMENG
    VBAP~WERKS

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

    ENDSELECT.

  4. общо казано бързо ипотеки склонни да бъдат скъп .
    Ще намерите себе си плащат за годишен процента плащане която може да бъде някои 100
    лева или така на сто . За да дам един пример можеш да изплати 20
    лева заряд до назаем 100.00 лева
    за две няколко седмици . Клиентът
    федерацията на България има някои хубави прилични изчисления контрастиращи бързо опциите кредитиране в други опции .
    . Разплащателната предходната % е просто не неизвестен докато ви
    ще даде 426 Процент с помощта на бърз ипотека

  5. Wow, incredible blog layout! How long have you been blogging
    for? you make blogging look easy. The overall look of your
    website is great, let alone the content!

  6. I love what you guys are usually up too. Such clever work and exposure!

    Keep up the fantastic works guys I’ve included you guys to
    my personal blogroll.

  7. I’m not positive where you are getting your information, but good topic.
    I must spend a while learning much more or working out more.
    Thank you for wonderful information I was on the lookout for this info for my mission.

  8. I’ve read several just right stuff here. Certainly value bookmarking for revisiting.
    I wonder how so much attempt you put to create any such fantastic informative site.

  9. ESO provides only started, and you will now get to get pleasure
    from all of the highest level content material and gearing the Folkk Scrolls On-line persona while using ideal products
    inside video game to help dominate dungeons as well as other players.

    The absolute right place to start with your way will
    be by gaining quickly encounter and gold which usually
    will hedlp you to buy Legendary and special products for any low cost.
    Currently with ESO, Daily dungeons function for the reason that major selection for gamers
    to realize quick gold as wepl as quick expertise.

    Earning gold by regukar dungeons is certain!
    Daily dungeons can ensure that your period is obviously rewarded akong with thousands of gold.

Leave a Reply