Example #1
0
	protected void macro_block(
		StatementCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		
		
		
		try {      // for error handling
			{
				switch ( LA(1) )
				{
				case EOL:
				case EOS:
				{
					eos();
					break;
				}
				case ESEPARATOR:
				case ABSTRACT:
				case BREAK:
				case CONTINUE:
				case CALLABLE:
				case CAST:
				case CHAR:
				case CLASS:
				case CONSTRUCTOR:
				case DEF:
				case DESTRUCTOR:
				case ENUM:
				case EVENT:
				case FINAL:
				case FOR:
				case FALSE:
				case GOTO:
				case INTERFACE:
				case INTERNAL:
				case IF:
				case NEW:
				case NULL:
				case OVERRIDE:
				case PASS:
				case PARTIAL:
				case PUBLIC:
				case PROTECTED:
				case PRIVATE:
				case RAISE:
				case RETURN:
				case SELF:
				case SUPER:
				case STATIC:
				case STRUCT:
				case THEN:
				case TRY:
				case TRANSIENT:
				case TRUE:
				case TYPEOF:
				case UNLESS:
				case VIRTUAL:
				case WHILE:
				case YIELD:
				case TRIPLE_QUOTED_STRING:
				case LPAREN:
				case DOUBLE_QUOTED_STRING:
				case SINGLE_QUOTED_STRING:
				case ID:
				case MULTIPLY:
				case LBRACK:
				case SPLICE_BEGIN:
				case DOT:
				case COLON:
				case LBRACE:
				case QQ_BEGIN:
				case SUBTRACT:
				case LONG:
				case INCREMENT:
				case DECREMENT:
				case ONES_COMPLEMENT:
				case INT:
				case BACKTICK_QUOTED_STRING:
				case RE_LITERAL:
				case DOUBLE:
				case FLOAT:
				case TIMESPAN:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
			{
				switch ( LA(1) )
				{
				case PASS:
				{
					{
						match(PASS);
						eos();
					}
					break;
				}
				case ESEPARATOR:
				case ABSTRACT:
				case BREAK:
				case CONTINUE:
				case CALLABLE:
				case CAST:
				case CHAR:
				case CLASS:
				case CONSTRUCTOR:
				case DEF:
				case DESTRUCTOR:
				case ENUM:
				case EVENT:
				case FINAL:
				case FOR:
				case FALSE:
				case GOTO:
				case INTERFACE:
				case INTERNAL:
				case IF:
				case NEW:
				case NULL:
				case OVERRIDE:
				case PARTIAL:
				case PUBLIC:
				case PROTECTED:
				case PRIVATE:
				case RAISE:
				case RETURN:
				case SELF:
				case SUPER:
				case STATIC:
				case STRUCT:
				case THEN:
				case TRY:
				case TRANSIENT:
				case TRUE:
				case TYPEOF:
				case UNLESS:
				case VIRTUAL:
				case WHILE:
				case YIELD:
				case TRIPLE_QUOTED_STRING:
				case LPAREN:
				case DOUBLE_QUOTED_STRING:
				case SINGLE_QUOTED_STRING:
				case ID:
				case MULTIPLY:
				case LBRACK:
				case SPLICE_BEGIN:
				case DOT:
				case COLON:
				case LBRACE:
				case QQ_BEGIN:
				case SUBTRACT:
				case LONG:
				case INCREMENT:
				case DECREMENT:
				case ONES_COMPLEMENT:
				case INT:
				case BACKTICK_QUOTED_STRING:
				case RE_LITERAL:
				case DOUBLE:
				case FLOAT:
				case TIMESPAN:
				{
					{ // ( ... )+
						int _cnt291=0;
						for (;;)
						{
							if ((tokenSet_17_.member(LA(1))) && (tokenSet_91_.member(LA(2))))
							{
								stmt(container);
							}
							else if ((tokenSet_38_.member(LA(1))) && (tokenSet_39_.member(LA(2)))) {
								type_member_stmt(container);
							}
							else
							{
								if (_cnt291 >= 1) { goto _loop291_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; }
							}
							
							_cnt291++;
						}
_loop291_breakloop:						;
					}    // ( ... )+
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "macro_block");
				recover(ex,tokenSet_67_);
			}
			else
			{
				throw ex;
			}
		}
	}
Example #2
0
	protected void type_member_stmt(
		StatementCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		
			TypeMemberCollection members = new TypeMemberCollection();
		
		
		try {      // for error handling
			type_definition_member(members);
			if (0==inputState.guessing)
			{
				
						foreach (var member in members)
							container.Add(new TypeMemberStatement(member));
					
			}
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "type_member_stmt");
				recover(ex,tokenSet_55_);
			}
			else
			{
				throw ex;
			}
		}
	}
Example #3
0
	protected void stmt(
		StatementCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		
				Statement s = null;
				StatementModifier m = null;
			
		
		try {      // for error handling
			{
				switch ( LA(1) )
				{
				case DEF:
				{
					s=nested_function();
					break;
				}
				case FOR:
				{
					s=for_stmt();
					break;
				}
				case WHILE:
				{
					s=while_stmt();
					break;
				}
				case IF:
				{
					s=if_stmt();
					break;
				}
				case UNLESS:
				{
					s=unless_stmt();
					break;
				}
				case TRY:
				{
					s=try_stmt();
					break;
				}
				case RETURN:
				{
					s=return_stmt();
					break;
				}
				default:
					bool synPredMatched310 = false;
					if ((((LA(1)==THEN||LA(1)==ID) && (tokenSet_4_.member(LA(2))))&&(IsValidMacroArgument(LA(2)))))
					{
						int _m310 = mark();
						synPredMatched310 = true;
						inputState.guessing++;
						try {
							{
								macro_name();
								{
									if ((tokenSet_5_.member(LA(1))))
									{
										expression();
									}
									else {
									}
									
								}
							}
						}
						catch (RecognitionException)
						{
							synPredMatched310 = false;
						}
						rewind(_m310);
						inputState.guessing--;
					}
					if ( synPredMatched310 )
					{
						s=macro_stmt();
					}
					else {
						bool synPredMatched314 = false;
						if (((tokenSet_37_.member(LA(1))) && (tokenSet_81_.member(LA(2)))))
						{
							int _m314 = mark();
							synPredMatched314 = true;
							inputState.guessing++;
							try {
								{
									slicing_expression();
									{
										switch ( LA(1) )
										{
										case ASSIGN:
										{
											match(ASSIGN);
											break;
										}
										case DEF:
										case DO:
										case COLON:
										{
											{
												switch ( LA(1) )
												{
												case COLON:
												{
													match(COLON);
													break;
												}
												case DO:
												{
													match(DO);
													break;
												}
												case DEF:
												{
													match(DEF);
													break;
												}
												default:
												{
													throw new NoViableAltException(LT(1), getFilename());
												}
												 }
											}
											break;
										}
										default:
										{
											throw new NoViableAltException(LT(1), getFilename());
										}
										 }
									}
								}
							}
							catch (RecognitionException)
							{
								synPredMatched314 = false;
							}
							rewind(_m314);
							inputState.guessing--;
						}
						if ( synPredMatched314 )
						{
							s=assignment_or_method_invocation_with_block_stmt();
						}
						else {
							bool synPredMatched316 = false;
							if (((LA(1)==ID) && (LA(2)==AS||LA(2)==COMMA)))
							{
								int _m316 = mark();
								synPredMatched316 = true;
								inputState.guessing++;
								try {
									{
										declaration();
										match(COMMA);
									}
								}
								catch (RecognitionException)
								{
									synPredMatched316 = false;
								}
								rewind(_m316);
								inputState.guessing--;
							}
							if ( synPredMatched316 )
							{
								s=unpack_stmt();
							}
							else if ((LA(1)==ID) && (LA(2)==AS)) {
								s=declaration_stmt();
							}
							else if ((tokenSet_82_.member(LA(1))) && (tokenSet_83_.member(LA(2)))) {
								{
									{
										switch ( LA(1) )
										{
										case GOTO:
										{
											s=goto_stmt();
											break;
										}
										case COLON:
										{
											s=label_stmt();
											break;
										}
										case YIELD:
										{
											s=yield_stmt();
											break;
										}
										case BREAK:
										{
											s=break_stmt();
											break;
										}
										case CONTINUE:
										{
											s=continue_stmt();
											break;
										}
										case RAISE:
										{
											s=raise_stmt();
											break;
										}
										case ESEPARATOR:
										case CAST:
										case CHAR:
										case FALSE:
										case NULL:
										case SELF:
										case SUPER:
										case THEN:
										case TRUE:
										case TYPEOF:
										case TRIPLE_QUOTED_STRING:
										case LPAREN:
										case DOUBLE_QUOTED_STRING:
										case SINGLE_QUOTED_STRING:
										case ID:
										case MULTIPLY:
										case LBRACK:
										case SPLICE_BEGIN:
										case DOT:
										case LBRACE:
										case QQ_BEGIN:
										case SUBTRACT:
										case LONG:
										case INCREMENT:
										case DECREMENT:
										case ONES_COMPLEMENT:
										case INT:
										case BACKTICK_QUOTED_STRING:
										case RE_LITERAL:
										case DOUBLE:
										case FLOAT:
										case TIMESPAN:
										{
											s=expression_stmt();
											break;
										}
										default:
										{
											throw new NoViableAltException(LT(1), getFilename());
										}
										 }
									}
									{
										switch ( LA(1) )
										{
										case IF:
										case UNLESS:
										case WHILE:
										{
											m=stmt_modifier();
											if (0==inputState.guessing)
											{
												if (s != null) s.Modifier = m;
											}
											break;
										}
										case EOL:
										case EOS:
										{
											break;
										}
										default:
										{
											throw new NoViableAltException(LT(1), getFilename());
										}
										 }
									}
									eos();
								}
							}
						else
						{
							throw new NoViableAltException(LT(1), getFilename());
						}
						}}break; }
					}
					if (0==inputState.guessing)
					{
						
								if (s != null && container != null)
								{
									container.Add(s);
								}
							
					}
				}
				catch (RecognitionException ex)
				{
					if (0 == inputState.guessing)
					{
						reportError(ex, "stmt");
						recover(ex,tokenSet_84_);
					}
					else
					{
						throw ex;
					}
				}
			}
Example #4
0
	protected void simple_stmt(
		StatementCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		
				Statement s = null;
				_compact = true;
			
		
		try {      // for error handling
			{
				if (((LA(1)==THEN||LA(1)==ID) && (tokenSet_24_.member(LA(2))))&&(IsValidMacroArgument(LA(2))))
				{
					s=closure_macro_stmt();
				}
				else {
					bool synPredMatched323 = false;
					if (((tokenSet_37_.member(LA(1))) && (tokenSet_88_.member(LA(2)))))
					{
						int _m323 = mark();
						synPredMatched323 = true;
						inputState.guessing++;
						try {
							{
								slicing_expression();
								match(ASSIGN);
							}
						}
						catch (RecognitionException)
						{
							synPredMatched323 = false;
						}
						rewind(_m323);
						inputState.guessing--;
					}
					if ( synPredMatched323 )
					{
						s=assignment_or_method_invocation();
					}
					else if ((LA(1)==RETURN)) {
						s=return_expression_stmt();
					}
					else {
						bool synPredMatched325 = false;
						if (((LA(1)==ID) && (LA(2)==AS||LA(2)==COMMA)))
						{
							int _m325 = mark();
							synPredMatched325 = true;
							inputState.guessing++;
							try {
								{
									declaration();
									match(COMMA);
								}
							}
							catch (RecognitionException)
							{
								synPredMatched325 = false;
							}
							rewind(_m325);
							inputState.guessing--;
						}
						if ( synPredMatched325 )
						{
							s=unpack();
						}
						else if ((LA(1)==ID) && (LA(2)==AS)) {
							s=declaration_stmt();
						}
						else if ((tokenSet_82_.member(LA(1))) && (tokenSet_89_.member(LA(2)))) {
							{
								{
									switch ( LA(1) )
									{
									case GOTO:
									{
										s=goto_stmt();
										break;
									}
									case COLON:
									{
										s=label_stmt();
										break;
									}
									case YIELD:
									{
										s=yield_stmt();
										break;
									}
									case BREAK:
									{
										s=break_stmt();
										break;
									}
									case CONTINUE:
									{
										s=continue_stmt();
										break;
									}
									case RAISE:
									{
										s=raise_stmt();
										break;
									}
									case ESEPARATOR:
									case CAST:
									case CHAR:
									case FALSE:
									case NULL:
									case SELF:
									case SUPER:
									case THEN:
									case TRUE:
									case TYPEOF:
									case TRIPLE_QUOTED_STRING:
									case LPAREN:
									case DOUBLE_QUOTED_STRING:
									case SINGLE_QUOTED_STRING:
									case ID:
									case MULTIPLY:
									case LBRACK:
									case SPLICE_BEGIN:
									case DOT:
									case LBRACE:
									case QQ_BEGIN:
									case SUBTRACT:
									case LONG:
									case INCREMENT:
									case DECREMENT:
									case ONES_COMPLEMENT:
									case INT:
									case BACKTICK_QUOTED_STRING:
									case RE_LITERAL:
									case DOUBLE:
									case FLOAT:
									case TIMESPAN:
									{
										s=expression_stmt();
										break;
									}
									default:
									{
										throw new NoViableAltException(LT(1), getFilename());
									}
									 }
								}
							}
						}
						else
						{
							throw new NoViableAltException(LT(1), getFilename());
						}
						}}
					}
					if (0==inputState.guessing)
					{
						
								if (null != s)
								{
									container.Add(s);
								}
							
					}
					if (0==inputState.guessing)
					{
						_compact=false;
					}
				}
				catch (RecognitionException ex)
				{
					if (0 == inputState.guessing)
					{
						reportError(ex, "simple_stmt");
						recover(ex,tokenSet_19_);
					}
					else
					{
						throw ex;
					}
				}
			}
Example #5
0
        //throws RecognitionException, TokenStreamException
        protected void type_member_stmt(
            StatementCollection container
            )
        {
            TypeMemberCollection members = new TypeMemberCollection();

            try {      // for error handling
            type_member(members);
            if (0==inputState.guessing)
            {

                        container.Add(new TypeMemberStatement(members[0]));

            }
            }
            catch (RecognitionException ex)
            {
            if (0 == inputState.guessing)
            {
                reportError(ex);
                recover(ex,tokenSet_86_);
            }
            else
            {
                throw ex;
            }
            }
        }
Example #6
0
        //throws RecognitionException, TokenStreamException
        protected void block(
		StatementCollection container
	)
        {
            try {      // for error handling
            {
                switch ( LA(1) )
                {
                case EOL:
                case EOS:
                {
                    eos();
                    break;
                }
                case ESEPARATOR:
                case BREAK:
                case CONTINUE:
                case CAST:
                case CHAR:
                case DEF:
                case FOR:
                case FALSE:
                case GOTO:
                case IF:
                case NULL:
                case PASS:
                case RAISE:
                case RETURN:
                case SELF:
                case SUPER:
                case THEN:
                case TRY:
                case TRUE:
                case TYPEOF:
                case UNLESS:
                case WHILE:
                case YIELD:
                case TRIPLE_QUOTED_STRING:
                case LPAREN:
                case DOUBLE_QUOTED_STRING:
                case SINGLE_QUOTED_STRING:
                case ID:
                case MULTIPLY:
                case LBRACK:
                case SPLICE_BEGIN:
                case DOT:
                case COLON:
                case LBRACE:
                case QQ_BEGIN:
                case SUBTRACT:
                case LONG:
                case INCREMENT:
                case DECREMENT:
                case ONES_COMPLEMENT:
                case INT:
                case BACKTICK_QUOTED_STRING:
                case RE_LITERAL:
                case DOUBLE:
                case FLOAT:
                case TIMESPAN:
                {
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            {
                switch ( LA(1) )
                {
                case PASS:
                {
                    {
                        match(PASS);
                        eos();
                    }
                    break;
                }
                case ESEPARATOR:
                case BREAK:
                case CONTINUE:
                case CAST:
                case CHAR:
                case DEF:
                case FOR:
                case FALSE:
                case GOTO:
                case IF:
                case NULL:
                case RAISE:
                case RETURN:
                case SELF:
                case SUPER:
                case THEN:
                case TRY:
                case TRUE:
                case TYPEOF:
                case UNLESS:
                case WHILE:
                case YIELD:
                case TRIPLE_QUOTED_STRING:
                case LPAREN:
                case DOUBLE_QUOTED_STRING:
                case SINGLE_QUOTED_STRING:
                case ID:
                case MULTIPLY:
                case LBRACK:
                case SPLICE_BEGIN:
                case DOT:
                case COLON:
                case LBRACE:
                case QQ_BEGIN:
                case SUBTRACT:
                case LONG:
                case INCREMENT:
                case DECREMENT:
                case ONES_COMPLEMENT:
                case INT:
                case BACKTICK_QUOTED_STRING:
                case RE_LITERAL:
                case DOUBLE:
                case FLOAT:
                case TIMESPAN:
                {
                    { // ( ... )+
                        int _cnt197=0;
                        for (;;)
                        {
                            if ((tokenSet_17_.member(LA(1))))
                            {
                                stmt(container);
                            }
                            else
                            {
                                if (_cnt197 >= 1) { goto _loop197_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; }
                            }

                            _cnt197++;
                        }
            _loop197_breakloop:						;
                    }    // ( ... )+
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            }
            catch (RecognitionException ex)
            {
            if (0 == inputState.guessing)
            {
                reportError(ex, "block");
                recover(ex,tokenSet_65_);
            }
            else
            {
                throw ex;
            }
            }
        }
Example #7
0
        //throws RecognitionException, TokenStreamException
        protected void stmt(
            StatementCollection container
            )
        {
            Statement s = null;
                StatementModifier m = null;

            try {      // for error handling
            {
                switch ( LA(1) )
                {
                case FOR:
                {
                    s=for_stmt();
                    break;
                }
                case WHILE:
                {
                    s=while_stmt();
                    break;
                }
                case IF:
                {
                    s=if_stmt();
                    break;
                }
                case UNLESS:
                {
                    s=unless_stmt();
                    break;
                }
                case TRY:
                {
                    s=try_stmt();
                    break;
                }
                case RETURN:
                {
                    s=return_stmt();
                    break;
                }
                default:
                    bool synPredMatched260 = false;
                    if (((tokenSet_75_.member(LA(1))) && (tokenSet_76_.member(LA(2)))))
                    {
                        int _m260 = mark();
                        synPredMatched260 = true;
                        inputState.guessing++;
                        try {
                            {
                                atom();
                                { // ( ... )+
                                    int _cnt259=0;
                                    for (;;)
                                    {
                                        if ((LA(1)==NEWLINE))
                                        {
                                            match(NEWLINE);
                                        }
                                        else
                                        {
                                            if (_cnt259 >= 1) { goto _loop259_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; }
                                        }

                                        _cnt259++;
                                    }
            _loop259_breakloop:									;
                                }    // ( ... )+
                                match(DOT);
                            }
                        }
                        catch (RecognitionException)
                        {
                            synPredMatched260 = false;
                        }
                        rewind(_m260);
                        inputState.guessing--;
                    }
                    if ( synPredMatched260 )
                    {
                        {
                            s=expression_stmt();
                            eos();
                        }
                    }
                    else {
                        bool synPredMatched264 = false;
                        if ((((LA(1)==ID) && (tokenSet_3_.member(LA(2))))&&(IsValidMacroArgument(LA(2)))))
                        {
                            int _m264 = mark();
                            synPredMatched264 = true;
                            inputState.guessing++;
                            try {
                                {
                                    match(ID);
                                    {
                                        if ((tokenSet_4_.member(LA(1))))
                                        {
                                            expression();
                                        }
                                        else {
                                        }

                                    }
                                }
                            }
                            catch (RecognitionException)
                            {
                                synPredMatched264 = false;
                            }
                            rewind(_m264);
                            inputState.guessing--;
                        }
                        if ( synPredMatched264 )
                        {
                            s=macro_stmt();
                        }
                        else {
                            bool synPredMatched268 = false;
                            if (((tokenSet_66_.member(LA(1))) && (tokenSet_77_.member(LA(2)))))
                            {
                                int _m268 = mark();
                                synPredMatched268 = true;
                                inputState.guessing++;
                                try {
                                    {
                                        slicing_expression();
                                        {
                                            switch ( LA(1) )
                                            {
                                            case ASSIGN:
                                            {
                                                match(ASSIGN);
                                                break;
                                            }
                                            case DEF:
                                            case DO:
                                            case COLON:
                                            {
                                                {
                                                    switch ( LA(1) )
                                                    {
                                                    case COLON:
                                                    {
                                                        match(COLON);
                                                        break;
                                                    }
                                                    case DO:
                                                    {
                                                        match(DO);
                                                        break;
                                                    }
                                                    case DEF:
                                                    {
                                                        match(DEF);
                                                        break;
                                                    }
                                                    default:
                                                    {
                                                        throw new NoViableAltException(LT(1), getFilename());
                                                    }
                                                     }
                                                }
                                                break;
                                            }
                                            default:
                                            {
                                                throw new NoViableAltException(LT(1), getFilename());
                                            }
                                             }
                                        }
                                    }
                                }
                                catch (RecognitionException)
                                {
                                    synPredMatched268 = false;
                                }
                                rewind(_m268);
                                inputState.guessing--;
                            }
                            if ( synPredMatched268 )
                            {
                                s=assignment_or_method_invocation_with_block_stmt();
                            }
                            else {
                                bool synPredMatched270 = false;
                                if (((LA(1)==ID) && (LA(2)==AS||LA(2)==COMMA)))
                                {
                                    int _m270 = mark();
                                    synPredMatched270 = true;
                                    inputState.guessing++;
                                    try {
                                        {
                                            declaration();
                                            match(COMMA);
                                        }
                                    }
                                    catch (RecognitionException)
                                    {
                                        synPredMatched270 = false;
                                    }
                                    rewind(_m270);
                                    inputState.guessing--;
                                }
                                if ( synPredMatched270 )
                                {
                                    s=unpack_stmt();
                                }
                                else if ((LA(1)==ID) && (LA(2)==AS)) {
                                    s=declaration_stmt();
                                }
                                else if ((tokenSet_78_.member(LA(1))) && (tokenSet_76_.member(LA(2)))) {
                                    {
                                        {
                                            switch ( LA(1) )
                                            {
                                            case GOTO:
                                            {
                                                s=goto_stmt();
                                                break;
                                            }
                                            case COLON:
                                            {
                                                s=label_stmt();
                                                break;
                                            }
                                            case YIELD:
                                            {
                                                s=yield_stmt();
                                                break;
                                            }
                                            case BREAK:
                                            {
                                                s=break_stmt();
                                                break;
                                            }
                                            case CONTINUE:
                                            {
                                                s=continue_stmt();
                                                break;
                                            }
                                            case RAISE:
                                            {
                                                s=raise_stmt();
                                                break;
                                            }
                                            case ESEPARATOR:
                                            case CAST:
                                            case CHAR:
                                            case FALSE:
                                            case NULL:
                                            case SELF:
                                            case SUPER:
                                            case TRUE:
                                            case TYPEOF:
                                            case ID:
                                            case TRIPLE_QUOTED_STRING:
                                            case LPAREN:
                                            case DOUBLE_QUOTED_STRING:
                                            case SINGLE_QUOTED_STRING:
                                            case LBRACK:
                                            case SUBTRACT:
                                            case SPLICE_BEGIN:
                                            case DOT:
                                            case MULTIPLY:
                                            case LBRACE:
                                            case QQ_BEGIN:
                                            case LONG:
                                            case INCREMENT:
                                            case DECREMENT:
                                            case ONES_COMPLEMENT:
                                            case INT:
                                            case RE_LITERAL:
                                            case DOUBLE:
                                            case FLOAT:
                                            case TIMESPAN:
                                            {
                                                s=expression_stmt();
                                                break;
                                            }
                                            default:
                                            {
                                                throw new NoViableAltException(LT(1), getFilename());
                                            }
                                             }
                                        }
                                        {
                                            switch ( LA(1) )
                                            {
                                            case IF:
                                            case UNLESS:
                                            case WHILE:
                                            {
                                                m=stmt_modifier();
                                                if (0==inputState.guessing)
                                                {
                                                    s.Modifier = m;
                                                }
                                                break;
                                            }
                                            case EOF:
                                            case EOS:
                                            case NEWLINE:
                                            {
                                                break;
                                            }
                                            default:
                                            {
                                                throw new NoViableAltException(LT(1), getFilename());
                                            }
                                             }
                                        }
                                        eos();
                                    }
                                }
                            else
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                            }}}break; }
                        }
                        if (0==inputState.guessing)
                        {

                                    if (null != s)
                                    {
                                        container.Add(s);
                                    }

                        }
                    }
                    catch (RecognitionException ex)
                    {
                        if (0 == inputState.guessing)
                        {
                            reportError(ex);
                            recover(ex,tokenSet_79_);
                        }
                        else
                        {
                            throw ex;
                        }
                    }
        }
            private Statement expandBmlElement(string tagname, IEnumerable<Expression> argsource,
                                               StatementCollection statements, bool usestart, bool useend){
                var innerblock = new Block();

                if (usestart){
                    buildStartTag(tagname, argsource, innerblock);
                }

                foreach (Statement statement in statements)
                {
                    
                    innerblock.add(statement);

                }
                if (useend){
                    if (tagname != "bmlempty"){
                        innerblock.add(BrailBuildingHelper.WriteOut("</" + tagname + ">"));
                    }
                }
                return innerblock;
            }
Example #9
0
	protected void block(
		StatementCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		
		try {      // for error handling
			{
				switch ( LA(1) )
				{
				case EOF:
				case EOS:
				case NEWLINE:
				{
					eos();
					break;
				}
				case ESEPARATOR:
				case BREAK:
				case CONTINUE:
				case CAST:
				case CHAR:
				case ELIF:
				case ELSE:
				case END:
				case ENSURE:
				case EXCEPT:
				case FAILURE:
				case FOR:
				case FALSE:
				case GOTO:
				case IF:
				case NULL:
				case OR:
				case RAISE:
				case RETURN:
				case SELF:
				case SUPER:
				case THEN:
				case TRY:
				case TRUE:
				case TYPEOF:
				case UNLESS:
				case WHILE:
				case YIELD:
				case ID:
				case TRIPLE_QUOTED_STRING:
				case DOUBLE_QUOTED_STRING:
				case SINGLE_QUOTED_STRING:
				case LBRACK:
				case LPAREN:
				case SUBTRACT:
				case SPLICE_BEGIN:
				case DOT:
				case COLON:
				case MULTIPLY:
				case LBRACE:
				case QQ_BEGIN:
				case LONG:
				case INCREMENT:
				case DECREMENT:
				case ONES_COMPLEMENT:
				case INT:
				case RE_LITERAL:
				case DOUBLE:
				case FLOAT:
				case TIMESPAN:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
			{    // ( ... )*
				for (;;)
				{
					if ((tokenSet_18_.member(LA(1))))
					{
						stmt(container);
					}
					else
					{
						goto _loop162_breakloop;
					}
					
				}
_loop162_breakloop:				;
			}    // ( ... )*
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex);
				recover(ex,tokenSet_60_);
			}
			else
			{
				throw ex;
			}
		}
	}
Example #10
0
 protected Expression SerializeCollection(Node sourceNode, string typeName, StatementCollection nodes)
 {
     return(SerializeCollectionWith((item) => LiftStatement(Serialize(item)), sourceNode, typeName, nodes));
 }
Example #11
0
 public Boo.Lang.Compiler.Ast.StatementCollection PopRange(int begin)
 {
     Boo.Lang.Compiler.Ast.StatementCollection range = new Boo.Lang.Compiler.Ast.StatementCollection(_parent);
     range.InnerList.Extend(InternalPopRange(begin));
     return(range);
 }