コード例 #1
0
 public abstract Template Visit(StarType type);
コード例 #2
0
ファイル: TargetCpp.cs プロジェクト: Connect2Begin/SugarCpp
 public override Template Visit(StarType type)
 {
     Template template = new Template("<type>*");
     template.Add("type", type.Type.Accept(this));
     return template;
 }
コード例 #3
0
ファイル: SugarWalker.cs プロジェクト: Connect2Begin/SugarCpp
	private SugarType type_star()
	{
		EnterRule_type_star();
		EnterRule("type_star", 17);
		TraceIn("type_star", 17);
		SugarType value = default(SugarType);


		SugarType a = default(SugarType);

		try { DebugEnterRule(GrammarFileName, "type_star");
		DebugLocation(232, 1);
		try
		{
			// SugarWalker.g:233:2: ( ^( Type_Star a= type_name '*' ( '*' )* ) )
			DebugEnterAlt(1);
			// SugarWalker.g:233:4: ^( Type_Star a= type_name '*' ( '*' )* )
			{
			DebugLocation(233, 4);
			DebugLocation(233, 6);
			Match(input,Type_Star,Follow._Type_Star_in_type_star955); 

			Match(input, TokenTypes.Down, null); 
			DebugLocation(233, 17);
			PushFollow(Follow._type_name_in_type_star959);
			a=type_name();
			PopFollow();

			DebugLocation(233, 28);
			Match(input,95,Follow._95_in_type_star961); 
			DebugLocation(233, 32);
			 value = new StarType(a); 
			DebugLocation(233, 62);
			// SugarWalker.g:233:62: ( '*' )*
			try { DebugEnterSubRule(31);
			while (true)
			{
				int alt31=2;
				try { DebugEnterDecision(31, false);
				int LA31_0 = input.LA(1);

				if ((LA31_0==95))
				{
					alt31 = 1;
				}


				} finally { DebugExitDecision(31); }
				switch ( alt31 )
				{
				case 1:
					DebugEnterAlt(1);
					// SugarWalker.g:233:63: '*'
					{
					DebugLocation(233, 63);
					Match(input,95,Follow._95_in_type_star966); 
					DebugLocation(233, 67);
					 value = new StarType(value); 

					}
					break;

				default:
					goto loop31;
				}
			}

			loop31:
				;

			} finally { DebugExitSubRule(31); }


			Match(input, TokenTypes.Up, null); 


			}

		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		}
		finally
		{
			TraceOut("type_star", 17);
			LeaveRule("type_star", 17);
			LeaveRule_type_star();
		}
		DebugLocation(234, 1);
		} finally { DebugExitRule(GrammarFileName, "type_star"); }
		return value;

	}