public SerializedType VisitArrayType(Core.Pascal.Array array) { var dt = array.ElementType.Accept(this); foreach (var dim in array.Dimensions) { var loId = dim.Low as Id; DataType dtLo; if (loId != null && typelib.Types.TryGetValue(loId.Name, out dtLo)) { var et = dtLo as Core.Types.EnumType; if (et != null) { dt = new ArrayType_v1 { ElementType = dt, Length = et.Members.Count, }; continue; } } var lo = dim.Low.Accept(ceval); if (dim.High != null) { // Range a..b size is (b-a)+1 var hi = dim.High.Accept(ceval); dt = new ArrayType_v1 { ElementType = dt, Length = (int)(hi.ToInt64() - lo.ToInt64()) + 1 }; } else { dt = new ArrayType_v1 { ElementType = dt, Length = (int)lo.ToInt64() }; } } return(dt); }
public Constant VisitArrayType(Core.Pascal.Array array) { throw new NotImplementedException(); }