[HP48/49] Command Line Parsing
|
02-16-2015, 01:01 PM
Post: #1
|
|||
|
|||
[HP48/49] Command Line Parsing
Hi,
I'm trying to improve the parsing routines of HPDL using the GetNextToken entry, and I don't understand how it work, especially on the content of the hxs mask that it expect to find on the stack. I think each one of the 256 nibbles represent a set of parsing rules to apply to the corresponding ASCII character, but If I'm right, what is the meaning of each bit ? Thank you for your help. |
|||
02-17-2015, 04:41 PM
(This post was last modified: 02-17-2015 04:42 PM by Han.)
Post: #2
|
|||
|
|||
RE: [HP48/49] Command Line Parsing
(02-16-2015 01:01 PM)Bruno Wrote: Hi, GetNextToken is actually a special pointer whose code resides at #1E181h. You can use Jazz on the HP50G to trace the algorithm via SDB and DB to get an idea of what the hxs mask is supposed to be. I haven't looked into the ROM beyond this; my suspicion, however, is that it may not be a mask but is instead a small scratch buffer to be used by the GetNextToken routine. I could very well be wrong. Graph 3D | QPI | SolveSys |
|||
02-17-2015, 04:51 PM
Post: #3
|
|||
|
|||
RE: [HP48/49] Command Line Parsing
Ha! Looks like I was wrong about the hxs-mask being a scratch buffer (as clearly explained in the entry description).
Graph 3D | QPI | SolveSys |
|||
02-18-2015, 11:33 AM
Post: #4
|
|||
|
|||
RE: [HP48/49] Command Line Parsing
Hi Han,
I'm pretty sure that each hxs-mask's nibble represent a set of rules for each characters, I'm playing with it but it's a little bit harder ! |
|||
02-18-2015, 03:33 PM
(This post was last modified: 02-18-2015 03:37 PM by Han.)
Post: #5
|
|||
|
|||
RE: [HP48/49] Command Line Parsing
Here's a snippet of ROM from the HP48SX that may give you some insight as to how the nibbles are used.
Code: ******************************************************************************* They are used mainly in FindTokEnd and GetNextSub Graph 3D | QPI | SolveSys |
|||
02-18-2015, 03:38 PM
Post: #6
|
|||
|
|||
RE: [HP48/49] Command Line Parsing
Here are part of the truth (from BNF.doc) :
The ttt is a a hxs containing 256 elements, one for each char. The table gives an implicit correspondence between ASCII characters and their TYPE, which is one of 16 values: 0 - neutral character 1 - normal character 2 - digit 3 - left delimiter 4 - right delimiter 5 - self delimiter 6 - escape character 7 - diphthong start [Not described in the ERS, but built-in in the HP48 GetNextToken: ] 8 - ? 9 - ? 10 - ? 11 - ? 12 - ? 13 - comment toggle 14 - comment off 15 - ? |
|||
02-18-2015, 03:39 PM
Post: #7
|
|||
|
|||
RE: [HP48/49] Command Line Parsing
Many thanks Han !!
|
|||
02-18-2015, 04:06 PM
Post: #8
|
|||
|
|||
RE: [HP48/49] Command Line Parsing
The defined types are
0 - neutral character 1 - normal character 2 - digit 3 - left delimiter 4 - right delimiter 5 - self delimiter 6 - escape character 7 - diphthong start 8 - radix/separator 1 9 - radix/separator 2 10 - radix/separator 3 11 - radix/separator 4 12 - other (used in symbolics) 13 - comment toggle 14 - comment off 15 - exponent separator HTH, Andreas http://www.software49g.gmxhome.de |
|||
02-18-2015, 08:54 PM
Post: #9
|
|||
|
|||
RE: [HP48/49] Command Line Parsing
Super, Thank you Andreas !
RPL is always more fascinating each time I discover another thing... |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)