MarkusAmshove / natls

Language Server implementation for the Natural 4GL programming language
MIT License
12 stars 3 forks source link

DDM : subdescriptor #506

Open awilkins opened 3 weeks ago

awilkins commented 3 weeks ago

DDMs identify both superdescriptor and subdescriptor with S and the "SOURCE FIELDS" comment block

e.g. when you suffix your box IDs with a letter indicating their size so you can query just for large boxes

  1 AE BOX-ID-SIZE                A    6  N S
*      -------- SOURCE FIELD(S) -------
*      BOX-ID(1-5)
*      BOX-SIZE(1-1)

Currently naming fields that do not exist elsewhere in the same DDM means the DDM doesn't parse.

(I think? All I see are

"Could not resolve \<that DDM>" in natlint or

"Trailing token \<IDENTIFIER> not allowed here" in vscode

where it is referenced in views, but no error reports in the actual DDM in vscode / natlint).

MarkusAmshove commented 2 weeks ago

I did not know subdescriptors exist and can't really find documentation about them.

The diagnostic messages are weird because:

The DDM parser is a port from a previous project which was all about code generation, meaning the exceptions don't get converted into nice diagnostics at the moment :-)

Is the type of subdescriptor fields derived from the descriptor itself? Will BOX-ID be A5 and BOX-SIZE A1 ?

MarkusAmshove commented 2 weeks ago

How are the sub fields defined in VIEWs? These look like redefinitions on Adabas side, whereas we add REDEFINEs in our VIEWs

The generated "source fields" naming from predict also is confusing, as they are actually "target" fields in this case

MarkusAmshove commented 2 weeks ago

Did find the documentation: https://documentation.softwareag.com/adabas/ada701luw/basics/fdtrec.htm#fdtrecsub Sorry for the spam :-)

Claes65 commented 2 weeks ago

So I guess the only thing you can distinguish them from superdescriptors is that the have no child fields? But is there any point in distinguishing them?