Acording to the Oxygene Grammar of oxygene HexInt should be known but isn’t, OR why does
procedure haveHex(h:HexInt);
begin
end;
led to Unknown Type “HexInt” compiler error ?
Or how to I spcifiy a formal parameter of type Hexadecimal Integer?
And you can do
var myHexInt := $c0FF FFFF;
(which is anyway funny as one could think of that this are two numbers and amybe over time var creates a set and not a hexadecimal integer)
I don’t know who developed that crap, because it makes me head sick writing a Txl Parser/Transformator to go from Oxygene to Oxygene; from OpenVMS Pascal to Oxygene Pascal; And can you imagin how many grammar files will have to be touched and making established things unstable in the future due to such new inventions?
HexInt isn’t a type, it’s a notation for integers. You’d still use Integer or Int64 as a type here, for example:
var x: Integer := 17; // decimal integer
var y: Integer := $11; // hex integer
var z: Integer := %10001; // binary integer
All are equivalent, just different notations. Now the whitespace issue is just to make it more readable. $c0ff ffff and $c0ffffff are equivalent, none of these syntaxes conflict with Pascal though; you just shouldn’t use the whitespace if you want to keep it compiling in VMS?
i’m sorry, but i’m confused here. numbers are numbers.if you represent them in base 1, 10, 16 (hex), or 42 doesn’t make any difference to the number. Why would you expect different data types for hex numbers vc decimal numbers — and how does the lack of them make Oxygene “crap”? It would make absolutely no sense at all to have a separate data type for hexadecimal (or any other representation) numbers…
Gentelmens
I hereby apologize for the word “crap”. It was not intended for Oxygene. If old Pascal code must be converted to Oxygene, with what is available in the market, in this case with the help of Txl, a very good tool for parser / transformer development, then one comes often to borders and limitten and other unknowsn. When then a syntax error occurs, this time in connection with “HexInt”, the missing documentation about it, and the rather unusual presentation C000 $ FFFF, then one has just extra work, and the word “crap” is loosely on the tongue. You just have to cope with additional challenges then. In this case, write an additional transformation rule and extend the grammar so that these patterns C000 $ FFFF EEEE is also recognized. Whitespace in this regard is almost ever a challeng, mainly if the strengths of the the available tool Txl is not in trimming strings and the like bevore parsing it.
And regarding types.
What would you say: does System.Double.Parse(String,String,String) indicate more of a type, in this case a Double or has this type Double meanwhile quitly mutated to a complex class with methods.
Where does the namespace of Double start and where does it end and why?
How can that be made into a grammar?
HexInt was found when I was reading your old documentation at the day when I wrote my claim.
That was when I come to the eronous idea that HexInt is a type; I should have known it better.
How would you define in BNF or any other languages used to define non-terminakl symbols to make a parser going for
System.Double d = System.Double.Parse(“double represented in string form”);
How do you structure you grammar to parse such a simple statment correct?
AND It has nothing to do with Oxygene but with grammar writing !
I see a namespace-non-terminal ! how shall the parser know how much to read in for the name space terminal symbol?
I see a word Double which is widely used as predefined type, now it seams to become an class with methods such as Parse();
Regarding the pattern to search, is it required to have all kind of this System.x.y.z as predefined patterns or is there a better way to know where a name space starts and wher it ends. Because the next element will then be the name of a class with methdos. (I am stil new to parser making, but on a good way with Txl)
Josef: (E)BNF can’t contain everything. It’s used to define the syntax but for example “Double” shouldn’t be in there. Double is just one of many types.
So say you want to parse System.Double.Parse you can do something like we did (cleaned version):