/var/spool/weblog
   


Prof Avery's weblog
vapo-rub in your margarine tub

<spool@kenytt.net>

CSU Fullerton Perl Powered Python vi Hacker

Geek News

del.icio.us bookmarks

RSS


       
Tue, Apr 19, 2005

Optical Illusions
The optical illusion I mentioned in class is here, you'll probably want to collect the whole set.

/var/spool/courses/csuf/2005/spring/cpsc465 #

Example Lexical Analyzer
As you finish up working on the parser, if you're feeling shaky about your own scanner, you can grab lexer.zip.

This is a scanner generated by Flex, the GNU Fast Lexical Analyzer generator. You need the .c and .h files to compile a working program.

The file example.l is the Flex source file; you won't need this unless you want to change the scanner. The file lex.yy.c was generated with the command flex -l example.l.

Take a look at main.c to see how the lexical analyzer works. Call yylex() to get the next token. The value returned by yylex() will be one of the token types defined in y.tab.h. When yylex() finishes, the variable yytext will contain the corresponding lexeme.

/var/spool/courses/csuf/2005/spring/cpsc423 #


       

 

January 2018
Sun Mon Tue Wed Thu Fri Sat
 
     

RSS

Topics


Archives