[Oberon] Re: N-O Scanner structure confusing ?

thoken at gmail.com thoken at gmail.com
Sat Feb 10 23:08:34 MET 2007


Hi!

All "Q"s need a "yes" except the last one,
cause the "scanner-reader" position is returned by Texts.Pos:

Texts.Scanner record is an extension of a Texts.Reader record.
A Texts.Scanner record variable therefore has the two fields org and off.
The two fields describe the position of the scanner and are changed by a read.
Every scan normally makes at least one read.
After a scan, Texts.Pos(S) returns S.org+S.off, the sum of the two field values
changed by the read operation that forced that scan to terminate.

That's what Oberon code may tell,
I wonder how execution of your code may telling you something else.

regards, Thomas

On 10 Feb 2007, Chris Glur <easlab at absamail.co.za> wrote:
> [...]
> Q- is it true that the Scanner is a descendant of the Reader ?
>
> Q- and that the Scanner 'uses' its parent to step&read as part
>   of its scanning task ?
>
> Q - and that if the reader's char-position was publicly
>   available, this would relate to the scanner's token position,
>    since the scanner uses the reader ?
>
> Q - but the reader explicitly makes the read-postn-variable
>    unavailable; isolating it via a function [procedure] ?
> [...]


More information about the Oberon mailing list