- if (first instanceof TerminalNode) {
- return parseTerminal((TerminalNode) first);
- }
- if (first instanceof FunctionCallContext) {
- return parseFunctionCall((FunctionCallContext) first);
- }
- if (first instanceof VariableReferenceContext) {
- return YangVariableReferenceExpr.of(parseQName(((VariableReferenceContext) first).qName()));
+ if (first instanceof TerminalNode terminal) {
+ return parseTerminal(terminal);
+ } else if (first instanceof FunctionCallContext function) {
+ return parseFunctionCall(function);
+ } else if (first instanceof VariableReferenceContext variable) {
+ return YangVariableReferenceExpr.of(parseQName(variable.qName()));
+ } else {
+ throw illegalShape(first);