[fpc-pascal]absolute identifier

ron wilson ron.wilson at coastgames.com
Tue Mar 26 02:56:34 CET 2002


hi everyone!

i'm modifying a lexer for use in my telnet game proxy and i need to move the
following variables into a type record so that i pass it as a variable and
manage multiple telnet streams with the same lexer code.  the current code
uses globals (yuk).

    yyinput, yyoutput : Text;        (* input and output file *)
    yyline            : String;      (* current input line *)
    yylineno, yycolno : Integer;     (* current input position *)
    yytext            : String;      (* matched text (should be considered
r/o) *)
    yyleng            : Byte         (* length of matched text *)
      absolute yytext;

the problem is that when i do this:

  type
    tyyvars = record
      yyinput, yyoutput : Text;        (* input and output file *)
      yyline            : String;      (* current input line *)
      yylineno, yycolno : Integer;     (* current input position *)
      yytext            : String;      (* matched text (should be considered
r/o) *)
      yyleng            : Byte         (* length of matched text *)
        absolute yytext;
    end;

i get the following error:
Fatal: Syntax error, ; expected but identifier ABSOLUTE found

i'm still re-learning pascal and i dont recall what the identifer ABSOLUTE
is for.  i can't seem to find any documentation on the net that can tell me
what it does.  if i remove the absolute,

      yyleng            : Byte;

it compiles fine, but gives a range check error on execution.  i think the
problem is here.  what function does the absolute identifier serve?  what
does the reference back to yytext mean?   how can i repair the code?  i'm
using turbo pascal lex/yacc, which also works with freepascal:
http://www.musikwissenschaft.uni-mainz.de/~ag/tply/tply.html
sure, a lexer may be overkill, but its making my life a lot easier!

thanks in advance,

ron wilson.





More information about the fpc-pascal mailing list