void declaration(out Declaration dec) { dec = new Declaration(); Expression exp = null; string ident = null; identity(out ident); dec.Name = ident; Expect(42); expr(out exp); dec.Expression = exp; if (la.kind == 43) { Get(); dec.Important = true; } }
static string Render(Declaration dec) { StringBuilder txt = new StringBuilder(); txt.AppendFormat("{0}: <span class=\"expression\">{1}</span>{2}", dec.Name, Render(dec.Expression), dec.Important ? " !important" : ""); return txt.ToString(); }