Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build any unit as starting point #16

Closed
zertovitch opened this issue Oct 30, 2023 · 2 comments
Closed

Build any unit as starting point #16

zertovitch opened this issue Oct 30, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@zertovitch
Copy link
Owner

zertovitch commented Oct 30, 2023

Instead of building a main procedure (and only that)
HAC will build any unit X as starting point using an implicit
"super main":

with X;

procedure _Super_Main is
begin
  || X;     --  if X is a parameterless procedure
  || null;  --  if X is another kind of unit
end;

The advantage is that HAC will be able to check semantics of any unit.

  • hac.exe x.ad{s|b} can check any unit; you don't need to search
    for a main procedure WITH-ing that unit for that job.
  • the Semantics target can check any unit as starting point;
    as a consequence an editor like LEA can refresh the analysis
    of the unit being worked on even if it is not a potential main
    procedure.
@zertovitch zertovitch added the enhancement New feature or request label Oct 30, 2023
@zertovitch
Copy link
Owner Author

Compile_Main should be rearranged in order to call Compile_Unit instead of parsing an hypothetical main procedure.
It will remove code duplication between Compile_Main and Compile_Unit.
Perhaps the "super main" won't be needed in the end.

@zertovitch
Copy link
Owner Author

zertovitch commented Nov 10, 2023

The 2nd way was taken and since commit dc346c8, any kind of unit can be the starting point, including with non-trivial file catalogues like LEA's.
In a nutshell, you can start a build with:

  1. a subprogram spec (HAC will look for the body, among other bodies)
  2. a subprogram body
  3. a package spec (HAC will look for the body among other bodies)
  4. a package body (HAC will restart the build with the spec as in point 3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant