Disammbler und Simulator angepasst. Arrays begonnen (defunct)
This commit is contained in:
@ -18,5 +18,24 @@ public enum VarType {
|
||||
TIME_OF_DAY = 18, // Tageszeit (TOD) -> TimeSpan / DateTime
|
||||
TOD = TIME_OF_DAY,
|
||||
DATE_AND_TIME = 19,// Datum + Uhrzeit (DT) -> DateTime
|
||||
DT = DATE_AND_TIME
|
||||
DT = DATE_AND_TIME,
|
||||
// Array marker - actual array types use ArrayType class
|
||||
ARRAY = 20
|
||||
}
|
||||
|
||||
// Represents an array type in structured text
|
||||
public class ArrayType {
|
||||
public VarType ElementType { get; set; } // Type of array elements
|
||||
public int Start { get; set; } // Start index
|
||||
public int End { get; set; } // End index
|
||||
public int Length => End - Start + 1; // Number of elements
|
||||
|
||||
public ArrayType(VarType elementType, int start, int end) {
|
||||
ElementType = elementType;
|
||||
Start = start;
|
||||
End = end;
|
||||
if (end < start) throw new System.ArgumentException("Array end index must be greater than or equal to start index");
|
||||
}
|
||||
|
||||
public override string ToString() => $"ARRAY [{Start}..{End}] OF {ElementType}";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user