RPGLE - String Literal Parsing [message #1791986] |
Mon, 09 July 2018 07:01  |
Eclipse User |
|
|
|
I would like to be able to correctly parse strings as defined for the RPGLE language.
Attached are some example strings that I would like to be able to parse.
Request:
Please help me, work out the logic to correctly parse the example strings attached.
This issues I am encountering relates to the following:
Issue 1 - Escape Characters:
- Strings Literals are contained in single quotes, 'I am a Simple String'
- Strings with nested quotes are escaped with another single quote. 'I have a nested '' in me'
- No other escape characters allowed
Issue 2 - String Literal Continuation:
For character, date, time, and timestamp literals :
- A hyphen (-) indicates continuation is in the first available position in the continued field (=> Aka Blanks Honored)
- A plus (+) indicates continuation with the first non-blank character in or past the first position in the continued field (=> Aka Blanks NOT Honored)
References
IBM Knowledge Center - Continuation Rules for RPGLE
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.52270 seconds