Skip to content

Commit

Permalink
Support (no) elseif.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCoder committed Oct 4, 2024
1 parent 7fe9854 commit e75ade8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/g4/activityParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ parser grammar activityParser;
options { tokenVocab=activityLexer; }

activityDiagram
: START? statement* (STOP | END)?
: START? (statement | STOP)* END?
;

statement
: activity
| ifStatement
Expand All @@ -30,9 +29,9 @@ activity
ifStatement
: IF condition
(EQUALS condition)?
THEN? branchLabel? statement*
(ELSEIF condition (EQUALS condition)? THEN? branchLabel? statement*)*
(ELSE branchLabel? statement*)?
THEN? branchLabel? (statement | STOP)*
(branchLabel? ELSEIF condition (EQUALS condition)? THEN? branchLabel? (statement | STOP)*)*
(branchLabel? ELSE branchLabel? (statement | STOP)*)?
ENDIF
;

Expand Down

0 comments on commit e75ade8

Please sign in to comment.