📕 subnode [[@ryan/20210516173242 lexical_analysis_in_racket]]
in 📚 node [[20210516173242-lexical_analysis_in_racket]]
-
source :: Lexical analysis in Racket
-
tags :: lexical analysis
Notes
Rackethas a library for making lexerseasily: parser-tools/lexer
.
#lang racket/base (require parser-tools/lexer) (define ab-lexer (lexer [#\a (display "You matched a.\n")] [#\b (display "You matched b.\n")]))
This will create a lexer that matches input character by character until,
finally, returning 'eof
.
The rest of this article contains a number of useful examples.
📖 stoas
- public document at doc.anagora.org/20210516173242-lexical_analysis_in_racket
- video call at meet.jit.si/20210516173242-lexical_analysis_in_racket