[racket] Using lex and yacc
Are there any examples on using lex and yacc, as I'm having trouble getting
started. I am trying to write a simple calculator. Here's what I've got so far:
#lang racket/base
(require parser-tools/lex)
(define lex (lexer
((:+ "[0-9]") (values 'int (string->number lexeme)))
((:+ whitespace) null)
((:: "+") (values 'plus 0))
((:: "-") (values 'minus 0))
((:: "*") (values 'mult 0))
((:: "/") (values 'div 0))))
When I try to compile it, I get
regular-expression: undefined operator in: (:+ "[0-9]")
How do I correct this?