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

Phoenix: Add multi-mission sequence branch (logic, conditionals, loops) detection, highlighting, and code folding #1412

Open
shaheerk94 opened this issue Aug 1, 2024 · 1 comment · Fixed by #1455
Assignees
Labels
feature New feature or request sequencing Anything related to the sequencing domain

Comments

@shaheerk94
Copy link

shaheerk94 commented Aug 1, 2024

Checked for duplicates

No - I haven't checked

Alternatives considered

No - I haven't considered

Related problems

Many projects that Phoenix will have to support will write complex sequences with complex logic. The form in which logic takes will be different per sequencing language (VML, FCPL, Fprime, etc.), so implementing branch detection in a multi-mission way is key.

Describe the feature request

Allow generic definition of branch detection per sequence language grammar. Each grammar should come with its own branch detection logic. Add branch detection logic for VML and FCPL.

In FCPL, the following commands (sequence directives) indicate the start of a branch:

SEQ_DIR_IF
SEQ_DIR_IF_OR
SEQ_DIR_IF_AND
SEQ_DIR_ELSE (ends previous branch and starts new branch)
SEQ_DIR_WAIT_UNTIL
SEQ_DIR_WAIT_UNTIL_VAR
SEQ_DIR_WAIT_UNTIL_AND
SEQ_DIR_WAIT_UNTIL_OR
SEQ_DIR_WAIT_UNTIL_TIMEOUT (ends previous branch and starts new branch)
SEQ_DIR_LOOP

And the following indicate the end of a branch:
SEQ_DIR_END_IF
SEQ_DIR_END_LOOP
SEQ_DIR_END_WAIT_UNTIL

In VML, the following tokens indicate the starts and ends of branches:

flow: branch | return | delay;
branch: branch_always | branch_true | branch_false;
branch_always: BRANCH label_name;
branch_true: BRANCH_TRUE simple_expr label_name; branch_false: BRANCH_FALSE simple_expr label_name;
if: IF if_condition;
else_if: ELSE_IF if_condition; else: ELSE;
end_if: END_IF; if_condition: compound_expr;
while: WHILE while_condition; end_while: END_WHILE; while_condition: compound_expr;
for: FOR for_assignment
for_bound optional_step DO;
end_for: END_FOR;
for_assignment: variable_name ASSIGNMENT compound_expr;
for_bound: for_direction
compound_expr; for_direction: TO| DOWN_TO;

(would appreciate someone double checking this list for me)

For VML, see docs in #1411 for more detail

@shaheerk94 shaheerk94 added the feature New feature or request label Aug 1, 2024
@shaheerk94 shaheerk94 added this to Aerie Aug 1, 2024
@github-project-automation github-project-automation bot moved this to Todo in Aerie Aug 1, 2024
@duranb duranb added the sequencing Anything related to the sequencing domain label Aug 1, 2024
@dandelany dandelany moved this from Todo to In Progress in Aerie Sep 5, 2024
@joswig joswig mentioned this issue Sep 9, 2024
4 tasks
@dandelany dandelany moved this from In Progress to In Review in Aerie Sep 26, 2024
@github-project-automation github-project-automation bot moved this from In Review to Done in Aerie Sep 26, 2024
@joswig joswig reopened this Sep 26, 2024
@joswig
Copy link
Collaborator

joswig commented Sep 26, 2024

Only part of this is done for VML and we need to merge that with FCPL implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request sequencing Anything related to the sequencing domain
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants