DEFINITION MODULE lexicTOAL;

FROM SYSTEM   IMPORT ADDRESS;
FROM nString  IMPORT STRING;
FROM XStreams IMPORT CMDSTREAM;

EXPORT QUALIFIED  TOALTOKENSTREAM, TOKEN, KEYWORD, TAGSTRING,
                  GetToken, TokenString, NewTokenStream;

CONST    TagLen = 64;

TYPE  TAGSTRING = ARRAY [0..TagLen-1] OF CHAR;
          TOKEN = (Tag, KeyWord, Bar, Sep, Langl, Rangl, Lparen, Rparen, Plus,
                   Minus, Comma, Equals, Rarrow, Hash, Percent, Star,
                   EndStream);
		 
        KEYWORD = (NotAKeyword, cell, cells, constrain, east, endcell,
                   endheap, export, from, heap, ignore, import,
                   instance, join, lambda,
                   micron, mirrored, nets, north, ports,
                   rotatedby, side, south, units, use,
                   west, aLayer);
 TOALTOKENSTREAM = POINTER TO RECORD
                    cs : CMDSTREAM;
                 Token : TOKEN;
               Keyword : KEYWORD;
                TagStr : TAGSTRING;
                  Hook : ADDRESS;
                  END;

PROCEDURE NewTokenStream(cs : CMDSTREAM) : TOALTOKENSTREAM;
PROCEDURE GetToken(TokenStream : TOALTOKENSTREAM);
PROCEDURE TokenString(Tok : TOKEN;  Key : KEYWORD) : STRING;

END lexicTOAL.
