HP Forums
UserRPL. Detect lines with syntax error - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: UserRPL. Detect lines with syntax error (/thread-8099.html)



UserRPL. Detect lines with syntax error - pier4r - 04-03-2017 08:38 AM

Reading old discussions I stumbled on one that reports that the Jazz compiler/builder for sysRPL can tell the user if there is a syntax error and on which line.

Instead when I use userRPL and I pass a program to the calculator in text mode, getting back a "syntax error", the information given back are much more cryptic and often not helpful. (especially for files that in origin are 21 Kbytes and at the end -after trimming the comments - are 3 Kbytes)

So I normally end up toggling large part of a program as "comments" until I identify the part with the unwanted error.

Is there a way to get more information about the syntax error message? That would speed up a part of debugging.


RE: UserRPL. Detect lines with syntax error - Vtile - 04-03-2017 12:57 PM

Splitting the 21k to smaller building blogs? I know, I know this is not the answer you are after. Smile


RE: UserRPL. Detect lines with syntax error - pier4r - 04-03-2017 05:08 PM

I do already, sort of. I take blocks aways and I copy to the calculator, until the block I inserted produces the error, and then I take smaller blocks from the block away, and so on. I hoped to something more specific. Like "look I did not expect this char C at line Y"


RE: UserRPL. Detect lines with syntax error - Thomas Radtke - 04-03-2017 06:18 PM

When I don't know where a program (of any language) breaks, I usually have messages printed along the execution of it to learn where it still worked.


RE: UserRPL. Detect lines with syntax error - pier4r - 04-03-2017 08:06 PM

(04-03-2017 06:18 PM)Thomas Radtke Wrote:  When I don't know where a program (of any language) breaks, I usually have messages printed along the execution of it to learn where it still worked.

That's fine, but that comes before the parsing of the program. You likely mean output at runtime, I mean before it runs.


RE: UserRPL. Detect lines with syntax error - Thomas Radtke - 04-04-2017 04:08 PM

Ah, sorry! Got it now. Has been quite some time since I used my 48G and wasn't aware of this particular problem.


RE: UserRPL. Detect lines with syntax error - Vtile - 04-05-2017 04:09 PM

It usually have to do something about object types (wrong type of data) or the special characters on command names. Atleast the emu48 do parse the programs with STR-> command or similar when it receives userRPL program, [IIRC] the same happens when you use inbuild editor in calculator and place the object to the stack [/IIRC].

There is people here who knows the system better than me.


RE: UserRPL. Detect lines with syntax error - pier4r - 04-05-2017 05:56 PM

Yes often it is due the trigraphs (asci codes for special symbols).

Like instead of "\->" I write "\.>" (the characters are near on the german/italian layout) , the point is, in a 10 kb file in notepad++, it is not so immediate to spot the error.