unary method
Implementation
UnaryContext unary() {
dynamic _localctx = UnaryContext(context, state);
enterRule(_localctx, 12, RULE_unary);
int _la;
try {
int _alt;
state = 97;
errorHandler.sync(this);
switch (interpreter!.adaptivePredict(tokenStream, 8, context)) {
case 1:
_localctx = MemberExprContext(_localctx);
enterOuterAlt(_localctx, 1);
state = 84;
member(0);
break;
case 2:
_localctx = LogicalNotContext(_localctx);
enterOuterAlt(_localctx, 2);
state = 86;
errorHandler.sync(this);
_la = tokenStream.LA(1)!;
do {
state = 85;
_localctx.s19 = match(TOKEN_EXCLAM);
_localctx.ops.add(_localctx.s19);
state = 88;
errorHandler.sync(this);
_la = tokenStream.LA(1)!;
} while (_la == TOKEN_EXCLAM);
state = 90;
member(0);
break;
case 3:
_localctx = NegateContext(_localctx);
enterOuterAlt(_localctx, 3);
state = 92;
errorHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
state = 91;
_localctx.s18 = match(TOKEN_MINUS);
_localctx.ops.add(_localctx.s18);
break;
default:
throw NoViableAltException(this);
}
state = 94;
errorHandler.sync(this);
_alt = interpreter!.adaptivePredict(tokenStream, 7, context);
} while (_alt != 2 && _alt != ATN.INVALID_ALT_NUMBER);
state = 96;
member(0);
break;
}
} on RecognitionException catch (re) {
_localctx.exception = re;
errorHandler.reportError(this, re);
errorHandler.recover(this, re);
} finally {
exitRule();
}
return _localctx;
}