Example #1
0
	public IfThenElseStmtContext ifThenElseStmt() {
		IfThenElseStmtContext _localctx = new IfThenElseStmtContext(Context, State);
		EnterRule(_localctx, 82, RULE_ifThenElseStmt);
		int _la;
		try {
			State = 1028;
			switch ( Interpreter.AdaptivePredict(TokenStream,121,Context) ) {
			case 1:
				_localctx = new InlineIfThenElseContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 1003; Match(IF);
				State = 1004; Match(WS);
				State = 1005; ifConditionStmt();
				State = 1006; Match(WS);
				State = 1007; Match(THEN);
				State = 1008; Match(WS);
				State = 1009; blockStmt();
				State = 1014;
				switch ( Interpreter.AdaptivePredict(TokenStream,118,Context) ) {
				case 1:
					{
					State = 1010; Match(WS);
					State = 1011; Match(ELSE);
					State = 1012; Match(WS);
					State = 1013; blockStmt();
					}
					break;
				}
				}
				break;
			case 2:
				_localctx = new BlockIfThenElseContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 1016; ifBlockStmt();
				State = 1020;
				ErrorHandler.Sync(this);
				_la = TokenStream.La(1);
				while (_la==ELSEIF) {
					{
					{
					State = 1017; ifElseIfBlockStmt();
					}
					}
					State = 1022;
					ErrorHandler.Sync(this);
					_la = TokenStream.La(1);
				}
				State = 1024;
				_la = TokenStream.La(1);
				if (_la==ELSE) {
					{
					State = 1023; ifElseBlockStmt();
					}
				}

				State = 1026; Match(END_IF);
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}
Example #2
0
		public BlockIfThenElseContext(IfThenElseStmtContext context) { CopyFrom(context); }
Example #3
0
		public InlineIfThenElseContext(IfThenElseStmtContext context) { CopyFrom(context); }
Example #4
0
		public virtual void CopyFrom(IfThenElseStmtContext context) {
			base.CopyFrom(context);
		}