initial
[prop.git] / app / setl-pe / setl-lexer.pcc
blob04aeeec5cfb215c6b4b49d23dfcc3563f0930364
1 #include <iostream.h>
2 #include "setl-lexeme.ph"
3 #include "setl-syntax.ph"
5 ///////////////////////////////////////////////////////////////////////////////
6 //
7 // Instantiate the token type
8 //
9 ///////////////////////////////////////////////////////////////////////////////
10 instantiate datatype SETL_Token;
12 ///////////////////////////////////////////////////////////////////////////////
14 //  This is the lexical scanner routine for our typed-SETL language
16 ///////////////////////////////////////////////////////////////////////////////
17 int SETLSyntax::get_token()
18 {  matchscan while (lexer_buf)
19    {  lexeme class SETL_Token:        { return ?lexeme; }
20    |  /[(){}<>\[\],\+\-\*\/;.&^%#!]/: { return lexer_buf[0]; }
21    |  /[ \t\n]+/:                     // skip spaces
22    }
23    return EOF;