× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: more detailed information on parsing
  • From: esimpson@xxxxxxxxxx
  • Date: Mon, 23 Apr 2001 09:37:26 -0400
  • Importance: Normal

Just a bit more information for those interested in how parsing is done...

We provide source for a sample parser written in C as Violaine's mentioned
in her note.  All of the parsers provided by CODE/400 are written in C/C++.
It is possible to write a parser in Java or even REXX (I don't think REXX
is very suited for this type of programming though).

When a file is opened, its parser is set by its language profile (e.g.
RPGLE400.LXL for ILE RPG).  You can query the parser by entering "PARSER"
in the editor command line.  The parser is really just a command the editor
runs every time a line is changed.  The command that gets run could do
anything it wanted but what usually happens is that the line is retokenized
(and possibly syntax checked).  For tokenization, you have to set the font
for each character in the line.  A font is really just a foreground colour
and background colour.  Fonts are defined in the language profile (e.g.
'SET FONT.D BLUE/WHITE               "Indicator"').  The parser analyzes
the source line and generates a corresponding font string.  You can query
the font string for a line by entering "FONTS" in the editor command line.

Source line:
     C                   MOVE      ARRAY(2)      ARRAY(3)
Font line:
AABBBCDDFEEIIIIIIIIIIIIIILLLLLLLLLLHHHHHHHHHHHHHHIIIIIIII


Eric Simpson
IBM Toronto Lab
Phone:  (416) 448-3226,  T/L:  778-3226
Email and SameTime Connect:  esimpson@ca.ibm.com


Jon.Paris@hal.it@midrange.com on 04/18/2001 04:08:29 PM

Please respond to CODE400-L@midrange.com

Sent by:  owner-code400-l@midrange.com


To:   CODE400-L@midrange.com
cc:
Subject:  Re: Extra extra



 >> How do I set the color scheme for CODE to highlight TAGS and reserved
words for these languages the way it does for the "original" languages ?

It already does it for HTML - I've used it quite a lot lately.

As to the others maybe an IBMer can answer but from my distant memories I
seem to recall that you have to write a tokenizer for the langauge in
question and that needs to be done in C or whatever (no matter how good you
are with Rexx!)


+---
| This is the CODE/400 Mailing List!
| To submit a new message, send your mail to CODE400-L@midrange.com.
| To subscribe to this list send email to CODE400-L-SUB@midrange.com.
| To unsubscribe from this list send email to CODE400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: larry@paque.net
+---



+---
| This is the CODE/400 Mailing List!
| To submit a new message, send your mail to CODE400-L@midrange.com.
| To subscribe to this list send email to CODE400-L-SUB@midrange.com.
| To unsubscribe from this list send email to CODE400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: larry@paque.net
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.