author | unc0rr |
Fri, 11 May 2012 23:34:35 +0400 | |
changeset 7062 | 7efe16575779 |
parent 7054 | 7e8fb07ef91c |
child 7064 | 0cf7cad767aa |
permissions | -rw-r--r-- |
6512 | 1 |
system; |
2 |
||
3 |
type |
|
6635
c2fa29fe2a58
Some progress, still can't find the source of bad behavior
unc0rr
parents:
6552
diff
changeset
|
4 |
Integer = integer; |
6512 | 5 |
LongInt = integer; |
6 |
LongWord = integer; |
|
6516 | 7 |
Cardinal = integer; |
8 |
PtrInt = integer; |
|
6520 | 9 |
Word = integer; |
10 |
Byte = integer; |
|
11 |
SmallInt = integer; |
|
12 |
ShortInt = integer; |
|
6653 | 13 |
QWord = integer; |
6891
ab9843957664
Improve rendering of function types, ranges, and more
unc0rr
parents:
6873
diff
changeset
|
14 |
GLint = integer; |
ab9843957664
Improve rendering of function types, ranges, and more
unc0rr
parents:
6873
diff
changeset
|
15 |
GLuint = integer; |
6838 | 16 |
gl_unsigned_byte = integer; |
7044 | 17 |
int = integer; |
6516 | 18 |
|
19 |
pointer = pointer; |
|
20 |
||
6649
7f78e8a6db69
Fix a bug with type declaration trying to resolve type being declared
unc0rr
parents:
6635
diff
changeset
|
21 |
float = float; |
6838 | 22 |
single = float; |
6516 | 23 |
double = float; |
24 |
real = float; |
|
6653 | 25 |
extended = float; |
6891
ab9843957664
Improve rendering of function types, ranges, and more
unc0rr
parents:
6873
diff
changeset
|
26 |
GLfloat = float; |
6838 | 27 |
gl_float = float; |
6516 | 28 |
|
29 |
boolean = boolean; |
|
30 |
LongBool = boolean; |
|
31 |
||
32 |
string = string; |
|
33 |
shortstring = string; |
|
34 |
ansistring = string; |
|
6838 | 35 |
widechar = string; |
6516 | 36 |
|
37 |
char = char; |
|
6873 | 38 |
PChar = ^char; |
6926
6e832f8f4d8e
Make adler32 friendlier for pas2c - this should work the same (needs testing ofc)
nemo
parents:
6902
diff
changeset
|
39 |
PPChar = ^Pchar; |
6520 | 40 |
|
41 |
PByte = ^Byte; |
|
42 |
PLongInt = ^LongInt; |
|
43 |
PLongWord = ^LongWord; |
|
44 |
PInteger = ^Integer; |
|
6663 | 45 |
|
46 |
Handle = integer; |
|
47 |
stderr = Handle; |
|
6838 | 48 |
|
6893 | 49 |
png_structp = pointer; |
50 |
png_size_t = integer; |
|
51 |
||
6512 | 52 |
var |
53 |
false, true: boolean; |
|
6855
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
54 |
|
6838 | 55 |
write, writeLn, read, readLn: procedure; |
6855
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
56 |
|
6520 | 57 |
StrLen, ord, Succ, Pred : function : integer; |
6838 | 58 |
inc, dec, Low, High, Lo, Hi : function : integer; |
59 |
odd, even : function : boolean; |
|
60 |
||
6520 | 61 |
Now : function : integer; |
6838 | 62 |
|
63 |
new, dispose, FillChar, Move : procedure; |
|
64 |
||
65 |
trunc, round : function : integer; |
|
7041 | 66 |
abs, sqr : function : integer; |
6838 | 67 |
|
6967
1224c6fb36c3
Support recurrent function calls. The code is kinda hackish and ugly, but I really spent a few hours thinking on a good solution.
unc0rr
parents:
6926
diff
changeset
|
68 |
StrPas, FormatDateTime, copy, delete, str, pos, trim, LowerCase : function : shortstring; |
6856 | 69 |
Length, StrToInt : function : integer; |
70 |
SetLength, val : procedure; |
|
6898 | 71 |
_pchar : function : PChar; |
6838 | 72 |
|
6855
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
73 |
assign, rewrite, reset, flush, BlockWrite, BlockRead, close : procedure; |
6902
7d4e5ce73b98
Make pas2c even smarter. Now uIO.c compiles fine, and only 1 warning when compiled with -Wall (clang).
unc0rr
parents:
6898
diff
changeset
|
74 |
IOResult : integer; |
6853 | 75 |
exit, break, halt, continue : procedure; |
6843
59da15acb2f2
Finally fix the bug with pointer declarations polluting namespace with bad records
unc0rr
parents:
6838
diff
changeset
|
76 |
TextFile, file : Handle; |
6853 | 77 |
FileMode : integer; |
6855
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
78 |
FileExists, DirectoryExists, eof : function : boolean; |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
79 |
ExtractFileName : function : string; |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
80 |
exitcode : integer; |
6853 | 81 |
|
82 |
ParamCount : function : integer; |
|
83 |
ParamStr : function : string; |
|
6838 | 84 |
|
7062 | 85 |
sqrt, arctan2, cos, sin, power : function : float; |
86 |
pi : float; |
|
6838 | 87 |
|
88 |
TypeInfo, GetEnumName : function : shortstring; |
|
89 |
||
90 |
UTF8ToUnicode, WrapText: function : shortstring; |
|
91 |
||
92 |
sizeof : function : integer; |
|
93 |
||
94 |
GetMem : function : pointer; |
|
95 |
FreeMem : procedure; |
|
96 |
||
97 |
gl_texture_2d, glbindtexture, gltexparameterf, gl_rgba, |
|
98 |
glteximage2d, glvertexpointer, gltexcoordpointer, |
|
99 |
gl_triangle_fan, gldrawarrays, glpushmatrix, glpopmatrix, |
|
100 |
gltranslatef, glscalef, glrotatef, gldisable, glenable, |
|
101 |
gl_line_smooth, gllinewidth, gl_lines, gl_line_loop, |
|
102 |
glcolor4ub, gl_texture_wrap_s, gltexparameteri, |
|
103 |
gl_texture_wrap_t, gl_texture_min_filter, |
|
104 |
gl_linear, gl_texture_mag_filter, glgentextures, |
|
6855
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
105 |
gldeletetextures, glreadpixels, glclearcolor, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
106 |
gl_line_strip, gldeleterenderbuffersext, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
107 |
gldeleteframebuffersext, glext_loadextension, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
108 |
gl_max_texture_size, glgetintegerv, gl_renderer, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
109 |
glgetstring, gl_vendor, gl_version, glgenframebuffersext, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
110 |
glbindframebufferext, glgenrenderbuffersext, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
111 |
glbindrenderbufferext, glrenderbufferstorageext, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
112 |
glframebufferrenderbufferext, glframebuffertexture2dext, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
113 |
gl_framebuffer_ext, gl_depth_component, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
114 |
gl_depth_attachment_ext, gl_renderbuffer_ext, gl_rgba8, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
115 |
gl_color_attachment0_ext, gl_modelview, gl_blend, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
116 |
gl_src_alpha, gl_one_minus_src_alpha, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
117 |
gl_perspective_correction_hint, gl_fastest, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
118 |
gl_dither, gl_vertex_array, gl_texture_coord_array, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
119 |
glviewport, glloadidentity, glmatrixmode, glhint, |
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
120 |
glblendfunc, glenableclientstate, gl_color_buffer_bit, |
6856 | 121 |
glclear, gldisableclientstate, gl_color_array, |
122 |
glcolorpointer, gl_depth_buffer_bit, gl_quads, |
|
123 |
glbegin, glend, gltexcoord2f, glvertex2d, |
|
6893 | 124 |
gl_true, gl_false, glcolormask, gl_projection, |
125 |
gl_texture_priority, glenum, gl_clamp_to_edge, |
|
6967
1224c6fb36c3
Support recurrent function calls. The code is kinda hackish and ugly, but I really spent a few hours thinking on a good solution.
unc0rr
parents:
6926
diff
changeset
|
126 |
gl_extensions, gl_bgra : procedure; |
6838 | 127 |
|
128 |
TThreadId : function : integer; |
|
6854
873929cbd54b
Normalize RecordFields before conversion. Helps with namespaces problem.
unc0rr
parents:
6853
diff
changeset
|
129 |
BeginThread, ThreadSwitch : procedure; |
873929cbd54b
Normalize RecordFields before conversion. Helps with namespaces problem.
unc0rr
parents:
6853
diff
changeset
|
130 |
InterlockedIncrement, InterlockedDecrement : procedure; |
6853 | 131 |
|
132 |
random : function : integer; |
|
6855
807156c01475
Finish the toughest part of the converter. Now it knows types of everything, so could correctly recognize bitwise operators and type convertions.
unc0rr
parents:
6854
diff
changeset
|
133 |
randomize : procedure; |
6853 | 134 |
|
135 |
Assigned : function : boolean; |
|
6854
873929cbd54b
Normalize RecordFields before conversion. Helps with namespaces problem.
unc0rr
parents:
6853
diff
changeset
|
136 |
|
6898 | 137 |
_strconcat, _strappend, _strprepend : function : string; |
7054 | 138 |
_strcompare, _strncompare, _strcomparec : function : boolean; |
6893 | 139 |
|
140 |
png_structp, png_set_write_fn, png_get_io_ptr, |
|
141 |
png_get_libpng_ver, png_create_write_struct, |
|
142 |
png_create_info_struct, png_destroy_write_struct, |
|
143 |
png_write_row, png_set_ihdr, png_write_info, |
|
144 |
png_write_end : procedure; |
|
6894 | 145 |
|
146 |
EnumToStr : function : string; |