public static StyleVariable ParseTree(ITree tree) { var name = tree.GetChild(0).Text; var variable = new StyleVariable {Name = name}; switch(tree.GetChild(1).Text) { case "LITERAL": variable.Value = new LiteralExpression(tree.GetChild(1)); break; default: variable.Value = StyleExpression.ParseExpression(tree.GetChild(1).GetChild(0)); break; } return variable; }
public void AddVariable(StyleVariable variable) { Variables.Add(variable); }
private void AddVariable(StyleVariable variable) { Variables.Add(variable); }