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?



      
_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to