Пример #1
0
 public override Template Visit(GlobalUsing global_using)
 {
     Template template = new Template("using <list; separator=\" \">;");
     template.Add("list", global_using.List);
     return template;
 }
Пример #2
0
 public abstract Template Visit(GlobalUsing global_using);
Пример #3
0
	private GlobalUsing global_using()
	{
		EnterRule_global_using();
		EnterRule("global_using", 4);
		TraceIn("global_using", 4);
		GlobalUsing value = default(GlobalUsing);


		CommonTree b = default(CommonTree);
		List<Attr> attr = default(List<Attr>);
		string a = default(string);


			value = new GlobalUsing();

		try { DebugEnterRule(GrammarFileName, "global_using");
		DebugLocation(62, 1);
		try
		{
			// SugarWalker.g:67:2: ( ^( Stmt_Using (attr= attribute )? (a= ident |b= 'namespace' )* ) )
			DebugEnterAlt(1);
			// SugarWalker.g:67:4: ^( Stmt_Using (attr= attribute )? (a= ident |b= 'namespace' )* )
			{
			DebugLocation(67, 4);
			DebugLocation(67, 6);
			Match(input,Stmt_Using,Follow._Stmt_Using_in_global_using238); 

			if (input.LA(1) == TokenTypes.Down)
			{
				Match(input, TokenTypes.Down, null); 
				DebugLocation(67, 17);
				// SugarWalker.g:67:17: (attr= attribute )?
				int alt3=2;
				try { DebugEnterSubRule(3);
				try { DebugEnterDecision(3, false);
				int LA3_0 = input.LA(1);

				if ((LA3_0==Attribute))
				{
					alt3 = 1;
				}
				} finally { DebugExitDecision(3); }
				switch (alt3)
				{
				case 1:
					DebugEnterAlt(1);
					// SugarWalker.g:67:18: attr= attribute
					{
					DebugLocation(67, 22);
					PushFollow(Follow._attribute_in_global_using243);
					attr=attribute();
					PopFollow();

					DebugLocation(67, 33);
					 value.Attribute = attr; 

					}
					break;

				}
				} finally { DebugExitSubRule(3); }

				DebugLocation(67, 65);
				// SugarWalker.g:67:65: (a= ident |b= 'namespace' )*
				try { DebugEnterSubRule(4);
				while (true)
				{
					int alt4=3;
					try { DebugEnterDecision(4, false);
					int LA4_0 = input.LA(1);

					if ((LA4_0==IDENT))
					{
						alt4 = 1;
					}
					else if ((LA4_0==136))
					{
						alt4 = 2;
					}


					} finally { DebugExitDecision(4); }
					switch ( alt4 )
					{
					case 1:
						DebugEnterAlt(1);
						// SugarWalker.g:67:67: a= ident
						{
						DebugLocation(67, 68);
						PushFollow(Follow._ident_in_global_using254);
						a=ident();
						PopFollow();

						DebugLocation(67, 75);
						 value.List.Add(a); 

						}
						break;
					case 2:
						DebugEnterAlt(2);
						// SugarWalker.g:68:22: b= 'namespace'
						{
						DebugLocation(68, 23);
						b=(CommonTree)Match(input,136,Follow._136_in_global_using281); 
						DebugLocation(68, 36);
						 value.List.Add("namespace"); 

						}
						break;

					default:
						goto loop4;
					}
				}

				loop4:
					;

				} finally { DebugExitSubRule(4); }


				Match(input, TokenTypes.Up, null); 
			}


			}

		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		}
		finally
		{
			TraceOut("global_using", 4);
			LeaveRule("global_using", 4);
			LeaveRule_global_using();
		}
		DebugLocation(69, 1);
		} finally { DebugExitRule(GrammarFileName, "global_using"); }
		return value;

	}
Пример #4
0
 public abstract Template Visit(GlobalUsing global_using);