Define IfFeature via a specialized class 36/80736/4
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 8 Mar 2019 14:04:34 +0000 (15:04 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 8 Mar 2019 18:17:30 +0000 (19:17 +0100)
commit5874f5da6ff34f70c5754f5a98dbd0a32820fba1
treeee02b019b1649b64ce892d4f205200a69967b5da
parent33bc94f1abc68aebd26bc12ac1c085d6ba001eb9
Define IfFeature via a specialized class

This reworks the grammar to use less recursion, as we can use
wildcards to eagerly combine expressions like "foo || bar || baz"
into any(foo, bar, baz) rather than or(foo, or(bar, baz)).

In order to properly support this contract, we define IfFeatureExpr,
which we specialize, so that we do not need to lug an opaque
predicate tree.

JIRA: YANGTOOLS-964
Change-Id: I048c3ced9c074e340031ac53c1117ce881b0a78b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/IfFeatureExpr.java [new file with mode: 0644]
yang/yang-parser-rfc7950/src/main/antlr/IfFeatureExpressionParser.g4
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/if_feature/IfFeaturePredicateVisitor.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/if_feature/IfFeatureStatementSupport.java