[Oberon] PC.Compile singularities

Patrik Reali reali at acm.org
Wed Feb 26 01:21:05 CET 2003


> On Sun, 23 Feb 2003 10:55:57 +0100, Patrik Reali <reali at acm.org> wrote:
> >> Texts.Read (r, ch);
> >> IF r.eot OR ((r.lib # NIL) & (r.lib IS Fonts.Font)) THEN
> >> (* regular char or end of text, do nothing *)
> >> ELSE
> >> (* some kind of object, give the compiler a space
> >> instead *)
> >> ch := " ";
> >> END; (* if *)
> >>
> >> and it helped.
>
> The Texts module is from Oberon, isn't it?  So the above code is still
> Oberon System-dependent.
>

Yes, but it is (well will be) part of the Oberon front-end of Paco, which
will be a pure Aos application. For this reason, the scanner works with an
AosIO.Reader instead of a Texts.Reader. To be able to issue the right error
positions, the simplest solution is to add padding space characters in the
input stream. Creating another data structure to record this would be more
complex.


> > I like your solution, it is very simple. I'm just not sure if all
> > embedded objects are 1 byte wide. I will have to check.
>
> BTW Texts.Read will always return only one "character" for an Object.  The
> actual object can then be retrieved with r.lib.GetObj(r.lib, ORD(ch),
obj).
>
I didn't know this. Thanks for the information.

-Patrik




More information about the Oberon mailing list