[fpc-devel]Hi for first time, and a question about tokens.pas

Peter Vreman peter at freepascal.org
Thu May 31 11:57:13 CEST 2001

> > Here it's working correct. Did you delete the .ppu files first and then 
> recompiled the
> > compiler?
> > 
> Yes, I always do that not to have problems. I think... repite error I haven't 
> it any more but... there some parts of the code (My new rtl) that doesn't 
> understand AND token, and I don't know why, does it matter the operators order 
> in token const declared in tokens.pas?
> If it does, Why ASSIGNMENT is the last token if it has only length 2. 

The order of the operators is not used for searching so the length and alphabetic ordering
is not necessary. I don't know if any other order is required, i guess not, i don't have
the time to check this out.
> Can I declare a TOKEN of length 1 such as "y" or "o"?

It should be possible if you change the length check in scanner in the function readtoken.

> I've seen that the assambler words are defined in other file something as 
> att386.inc (I dont remember very well the name). Is this the only place where 
> to change the "assambler tokens".
> Is there any place (I think I've seen it but I'm not sure) where there are 
> defined some assembler tokens in order to assemble the file generated by this 
> program with an external assembler? I want to know it not to change it.
> ===================
> I don't know... how have you managed to know if it detected "repite" that's to 
> say.

By debugging the compiler and checking the value that the token variable gets after
reading the token.

> The first thing I do is change tokens.pas and recompile the compiler, and then
> I try to compile a very easy file (writing hello in screen) but it doesn't 
> compile it automatically, it needs system unit, and many others in inc and 
> i386. And so... these files have to have the new tokens, that's to say, 
> I have to put unidad instead of unit. Programa instead of program and this with 
> a lot of files.
> You seem to have made it easier. How have done it? Because myself I had to 
> made a program (www.geocities.com/beatlesnap/pashis.zip) in order to translate 
> the basic rtl into my new tokens rtl.

Rename the innr.inc to compinnr.inc and fix the compiler accordingly to include that file
instead of innr.inc. This was already done in the 1.0.5 development compiler.

More information about the fpc-devel mailing list