Patchouli-Compiler icon indicating copy to clipboard operation
Patchouli-Compiler copied to clipboard

Too many exported types

Open r-k-o opened this issue 7 years ago • 17 comments

the compiler quits on winapi

with

Compile winapi.mod file pos 401631: Too many exported types

adding some more exports brings: file pos 524287: No :

r-k-o avatar Jan 22 '17 15:01 r-k-o

That means there are over 1024 export types in your module. If you want more, just change the const MaxExpTypes in Base module of the compiler, however, I don't recommend doing so because compiling time may be high.

congdm avatar Jan 22 '17 17:01 congdm

i did: MaxExpTypes* = 16384;

i did not help. i can compile a few lines more but it will bring up "file pos xxxxxxx: No :". maybe there is an other place that has to changed too. so i changed MaxRecTypes* = 16384 - but that did not help either.

r-k-o avatar Jan 22 '17 17:01 r-k-o

doubled the 2 constants again and now i get:

file pos 524287: param section?

and position being in line "CharToOemBuffW*: PROCEDURE(lpszSrc: PtrWSTR; lpszDst: PtrSTR; cchDstLength: INTEGER): BOOL;"

position at "PtrSTR" which is

PtrSTR* = INTEGER;

after trippling the constants values the error persists

r-k-o avatar Jan 22 '17 17:01 r-k-o

This is due to Parser module, not Base, so could you attach the source code?

congdm avatar Jan 22 '17 17:01 congdm

WinApi.mod.txt

r-k-o avatar Jan 22 '17 17:01 r-k-o

Ah, I remember that I also limit the size of input source code, just change the buffer array in Scanner module. Also the size of code array in Generator too.

congdm avatar Jan 22 '17 17:01 congdm

And why don't you break the WinAPI module into smaller modules, because not every program will use all of Win32 API, and the interface cost will be large.

congdm avatar Jan 22 '17 18:01 congdm

yes, i should split, but for learning that stuff i thought it would be easier going this way first.

r-k-o avatar Jan 22 '17 18:01 r-k-o

i know i am pestering you, but now i have a different error. i user the version before the "New Mark and Sweep algorithm". i compile the winapi, where i commented out huge portions. i compile the wintest and start the exe. a messagebox pops up showing "Error code: 8; Source pos 700104". this position is the end of file? WinApi.mod.txt wintest.mod.txt

r-k-o avatar Jan 23 '17 15:01 r-k-o

No problem at all =) Error Code 8 means this module cannot find RTL.DLL You should add the pragma (*$RTL-*) to both WinApi.mod and Wintest.mod, because they didn't need Oberon Run Time Library. For example, check Oberon07.Rtl.mod in my compiler, that module run on bare Win32.

congdm avatar Jan 23 '17 15:01 congdm

thanx for the help and also for the new integers.

r-k-o avatar Jan 23 '17 16:01 r-k-o

How can I start using the compiler on my windows

stepchuks9 avatar Oct 13 '17 06:10 stepchuks9

@stepchuks9 To start using it, just create your sourcefile in test folder, for example MyModule.mod, edit the Buildfile in test folder to add your module into it, and run the buildtest.bat

See the examples in test folder!

congdm avatar Oct 23 '17 09:10 congdm

thanks

stepchuks9 avatar Oct 26 '17 05:10 stepchuks9

How do I write an array of strings. VAR a: ARRAY 10 OF ARRAY 12 OF CHAR; gives me a 2-dimensional array of char. Is there a way to get something simpler than VAR a: ARRAY 10 OF RECORD b: ARRAY 12 OF CHAR END;

stepchuks9 avatar Oct 26 '17 05:10 stepchuks9

@stepchuks9 I believe VAR a: ARRAY 10 OF ARRAY 12 OF CHAR also counted as array of strings, for example, this code:

VAR a: ARRAY 10 OF ARRAY 12 OF CHAR;

PROCEDURE ReadString(VAR str: ARRAY OF CHAR);
BEGIN (* do something *)
END ReadString;

BEGIN
   ReadString(a[0])
END Module.

works.

congdm avatar Oct 31 '17 12:10 congdm

Thanks again.

stepchuks9 avatar Oct 31 '17 19:10 stepchuks9