public override Template Visit(GlobalTypeDef global_typedef) { Template template = new Template("typedef <type> <name>;"); template.Add("type", global_typedef.Type); template.Add("name", global_typedef.Name); return template; }
public override Template Visit(GlobalTypeDef global_typedef) { Template template = new Template("using <name> = <type>;"); template.Add("type", global_typedef.Type.Accept(this)); template.Add("name", global_typedef.Name); return template; }
public abstract Template Visit(GlobalTypeDef global_typedef);
private GlobalTypeDef global_typedef() { EnterRule_global_typedef(); EnterRule("global_typedef", 6); TraceIn("global_typedef", 6); GlobalTypeDef value = default(GlobalTypeDef); List<Attr> attr = default(List<Attr>); string a = default(string); string b = default(string); try { DebugEnterRule(GrammarFileName, "global_typedef"); DebugLocation(95, 1); try { // SugarWalker.g:96:2: ( ^( Stmt_Typedef (attr= attribute )? a= type_name b= ident ) ) DebugEnterAlt(1); // SugarWalker.g:96:4: ^( Stmt_Typedef (attr= attribute )? a= type_name b= ident ) { DebugLocation(96, 4); DebugLocation(96, 6); Match(input,Stmt_Typedef,Follow._Stmt_Typedef_in_global_typedef406); Match(input, TokenTypes.Down, null); DebugLocation(96, 19); // SugarWalker.g:96:19: (attr= attribute )? int alt11=2; try { DebugEnterSubRule(11); try { DebugEnterDecision(11, false); int LA11_0 = input.LA(1); if ((LA11_0==Attribute)) { alt11 = 1; } } finally { DebugExitDecision(11); } switch (alt11) { case 1: DebugEnterAlt(1); // SugarWalker.g:96:20: attr= attribute { DebugLocation(96, 24); PushFollow(Follow._attribute_in_global_typedef411); attr=attribute(); PopFollow(); } break; } } finally { DebugExitSubRule(11); } DebugLocation(96, 38); PushFollow(Follow._type_name_in_global_typedef417); a=type_name(); PopFollow(); DebugLocation(96, 50); PushFollow(Follow._ident_in_global_typedef421); b=ident(); PopFollow(); Match(input, TokenTypes.Up, null); DebugLocation(97, 2); value = new GlobalTypeDef(a, b); if (attr != null) value.Attribute = attr; } } catch (RecognitionException re) { ReportError(re); Recover(input,re); } finally { TraceOut("global_typedef", 6); LeaveRule("global_typedef", 6); LeaveRule_global_typedef(); } DebugLocation(101, 1); } finally { DebugExitRule(GrammarFileName, "global_typedef"); } return value; }