metormaon / flue

MIT License
1 stars 0 forks source link

Polish Java's out of the box and dusty grammar #7

Open yossigil opened 3 years ago

yossigil commented 3 years ago

The Java grammar is sometimes intentionally stupid.... to make it easier to write a parser:


            StatementNoShortIf >> StatementWithoutTrailingSubstatement
                    | LabeledStatementNoShortIf
                    | IfThenElseStatementNoShortIf
                    | WhileStatementNoShortIf
                    | ForStatementNoShortIf
        Sounds a hack/ while the following requires refactoring:

        ```        
        WhileStatement >> "while" & "(" & Expression & ")" & Statement

        WhileStatementNoShortIf >> "while" & "(" & Expression & ")" & StatementNoShortIf

        ````