UNIX Free Pascal


.. lex


13.66. , , .

%{

uses lexlib;

const

_AND=1;

_ASM=2;

_ARRAY=3;

_BEGIN=4;

_CASE=5;

_CONST=6;

_CONSTRUCTOR=7;

_DESTRUCTOR=8;

_DIV=9;

_DO=10;

_DOWNTO=11;

_ELSE=12;

_END=13;

_EXPORTS=14;

_FILE=15;

_FOR=16;

_FUNCTION=17;

_GOTO=18;

_IF=19;

_IMPLEMENTATION=20;

_IN=21;

_INHERITED=22;

_INLINE=23;

_INTERFACE=24;

_LABEL=25;

_LIBRARY=26;

_MOD=27;

_NIL=28;

_NOT=29;

_OBJECT=30;

_OF=31;

_OR=32;

_PACKED=33;

_PROCEDURE=34;

_PROGRAM=35;

_RECORD=36;

_REPEAT=37;

_SET=38;

_SHL=39;

_SHR=40;

_STRING=41;

_THEN=42;

_TO=43;

_TYPE=44;

_UNIT=45;

_UNTIL=46;

_USES=47;

_VAR=48;

_WHILE=49;

_WITH=50;

_XOR=51;

_STR=52;

_IDENT=53;

%}

letter [a-zA-Z]

digit [0-9]

%%

'[^']*' begin yydone:=true; yyretval:=_STR; end;

\"[^\"]\" begin yydone:=true; yyretval:=_STR; end;

"end." begin yydone:=true; yyretval:=_END; end;

and begin yydone:=true; yyretval:=_AND; end;

asm begin yydone:=true; yyretval:=_ASM; end;

array begin yydone:=true; yyretval:=_ARRAY; end;

begin begin yydone:=true; yyretval:=_BEGIN; end;

case begin yydone:=true; yyretval:=_CASE; end;

const begin yydone:=true; yyretval:=_CONST; end;

constructor begin yydone:=true; yyretval:=_CONSTRUCTOR; end;

destructor begin yydone:=true; yyretval:=_DESTRUCTOR; end;

div begin yydone:=true; yyretval:=_DIV; end;

do begin yydone:=true; yyretval:=_DO; end;

downto begin yydone:=true; yyretval:=_DOWNTO; end;

else begin yydone:=true; yyretval:=_ELSE; end;

end begin yydone:=true; yyretval:=_END; end;

exports begin yydone:=true; yyretval:=_EXPORTS; end;

file begin yydone:=true; yyretval:=_FILE; end;

for begin yydone:=true; yyretval:=_FOR; end;

function begin yydone:=true; yyretval:=_FUNCTION; end;




- -  - -  - -