|
@@ -46,6 +46,9 @@ interface
|
|
|
{# Returns the minimal integer value of the type }
|
|
|
function get_min_value(def : tdef) : TConstExprInt;
|
|
|
|
|
|
+ {# Returns the maximal integer value of the type }
|
|
|
+ function get_max_value(def : tdef) : TConstExprInt;
|
|
|
+
|
|
|
{# Returns basetype of the specified integer range }
|
|
|
function range_to_basetype(l,h:TConstExprInt):tbasetype;
|
|
|
|
|
@@ -349,6 +352,20 @@ implementation
|
|
|
end;
|
|
|
|
|
|
|
|
|
+ { returns the max. value of the type }
|
|
|
+ function get_max_value(def : tdef) : TConstExprInt;
|
|
|
+ begin
|
|
|
+ case def.deftype of
|
|
|
+ orddef:
|
|
|
+ get_max_value:=torddef(def).high;
|
|
|
+ enumdef:
|
|
|
+ get_max_value:=tenumdef(def).max;
|
|
|
+ else
|
|
|
+ get_max_value:=0;
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+
|
|
|
+
|
|
|
{ true if p is an integer }
|
|
|
function is_integer(def : tdef) : boolean;
|
|
|
begin
|