Пример #1
0
	public ConstructorDefinitionStatement  constructor_def_statement() //throws RecognitionException, TokenStreamException
{
		ConstructorDefinitionStatement mdstmt;
		
		
			  mdstmt = new ConstructorDefinitionStatement( currentAccessLevel ); 
			
		
		match(DEF);
		match(LITERAL_initialize);
		{
			switch ( LA(1) )
			{
			case LPAREN:
			{
				match(LPAREN);
				{
					switch ( LA(1) )
					{
					case IDENT:
					case STATICIDENT:
					case INSTIDENT:
					case STAR:
					case BAND:
					{
						methodParams(mdstmt);
						break;
					}
					case RPAREN:
					{
						break;
					}
					default:
					{
						throw new NoViableAltException(LT(1), getFilename());
					}
					 }
				}
				match(RPAREN);
				break;
			}
			case EOF:
			case STATEMENT_END:
			case SEMI:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			 }
		}
		statement_term();
		suite(mdstmt.Statements);
		match(END);
		return mdstmt;
	}
Пример #2
0
		public virtual void VisitConstructorDefinitionStatement(ConstructorDefinitionStatement statement)
		{
			if (VisitEnter(statement))
			{
				VisitNodes(statement.Arguments);
				VisitNodes(statement.Statements);

				VisitLeave(statement);
			}
		}
Пример #3
0
		public override void VisitConstructorDefinitionStatement(ConstructorDefinitionStatement statement)
		{
			nodeStack.Push( CurrentNode.Nodes.Add("Constructor " + statement.Name ));
			CurrentNode.Tag = statement;

			CurrentNode.EnsureVisible();

			base.VisitConstructorDefinitionStatement(statement);

			nodeStack.Pop();
		}