예제 #1
0
	public MultipleVariableDeclarationStatement  declaration_statement() //throws RecognitionException, TokenStreamException
{
		MultipleVariableDeclarationStatement stmt;
		
		
			  stmt = new MultipleVariableDeclarationStatement(currentAccessLevel); 
			  Identifier ident = null;
			  IExpression initExp = null; 
			
		
		ident=identifier_withtype();
		if (0==inputState.guessing)
		{
			stmt.AddIdentifier(ident);
		}
		{    // ( ... )*
			for (;;)
			{
				if ((LA(1)==COMMA))
				{
					match(COMMA);
					ident=identifier_withtype();
					if (0==inputState.guessing)
					{
						stmt.AddIdentifier(ident);
					}
				}
				else
				{
					goto _loop42_breakloop;
				}
				
			}
_loop42_breakloop:			;
		}    // ( ... )*
		{
			switch ( LA(1) )
			{
			case ASSIGN:
			{
				match(ASSIGN);
				initExp=test();
				if (0==inputState.guessing)
				{
					stmt.AddInitExp(initExp);
				}
				{    // ( ... )*
					for (;;)
					{
						if ((LA(1)==COMMA))
						{
							match(COMMA);
							initExp=test();
							if (0==inputState.guessing)
							{
								stmt.AddInitExp(initExp);
							}
						}
						else
						{
							goto _loop45_breakloop;
						}
						
					}
_loop45_breakloop:					;
				}    // ( ... )*
				break;
			}
			case EOF:
			case STATEMENT_END:
			case SEMI:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			 }
		}
		return stmt;
	}