public void Reduce_AttributeAccessExpression() { var expr = new AttributeAccessExpression(1, 2, "a"); var reduced = expr.Accept(_visitor); Assert.IsInstanceOfType(reduced, typeof(AttributeAccessExpression)); Assert.AreEqual("a", ((AttributeAccessExpression)reduced).Name); Assert.AreEqual(1, reduced.Line); Assert.AreEqual(2, reduced.Column); }
public Bitmap Visit(AttributeAccessExpression expr) { // if this is a metadata attribute, assume it is in all files if (_metadataAttributes.Contains(expr.Name)) { return(new Bitmap(_subsets.Count, true)); } // find all subsets which contain this attribute var bitmap = new Bitmap(_subsets.Count); foreach (var index in _subsets.FindIndices(item => item == expr.Name)) { bitmap.Set(index); } return(bitmap); }
public override bool Visit(AttributeAccessExpression expr) { _names.Add(expr.Name); return(true); }