buildingSMART / mvdXML

Repository used by the mvdXML group to support mvdXML specification and implementation.
28 stars 10 forks source link

mvdXML 1.2 grammar suggestion #12

Closed pjanck closed 2 years ago

pjanck commented 3 years ago
boolean_expression
: ( NOT ) boolean_term (logical_interconnection ( NOT ) boolean_term)* ;
boolean_term
: ( leftside operator rightside ) | ( LPAREN boolean_expression RPAREN );

Propose to change to

boolean_expression
:  boolean_term (logical_interconnection boolean_term)* ;
boolean_term
: ( ( NOT )* leftside operator rightside ) | ( LPAREN boolean_expression RPAREN );
pjanck commented 3 years ago

I can prepare a PR after #19 and #21 have been merged (for easier traceability).

pjanck commented 3 years ago

Looking at #13 as well, I'd like to propose another solution:

boolean_expression
:  boolean_term (logical_interconnection boolean_term)* ;
boolean_term
: NOT? ( leftside operator rightside | LPAREN boolean_expression RPAREN );

In this way, NOT can be combined with both alternatives of the boolean_term.

MatthiasWeise commented 2 years ago

Proposed move of the NOT statement from boolean_expression to boolean_term is ok with me. I would suggest the following adjustment to last proposal:

boolean_expression
: boolean_term (logical_interconnection boolean_term)* ;
boolean_term
: NOT? ((leftside operator rightside) | (LPAREN boolean_expression RPAREN));
pjanck commented 2 years ago

Applied in #21 .