Hi all,

I don't understand the error message here. The parser seems to be looking for a position-token but the lexer is sending srcloc-tokens? Is there a simple fix? Using Racket 7.7 on WIn 10.

I am also confused about whether to use br-parser-tools or parser-tools package. br-* is the more recent?

Thanks,

Jon


#lang racket

(require br-parser-tools/lex)
(require br-parser-tools/yacc)

(define-empty-tokens etoks (ZERO ONE EOF))

(define simple-lex
  (lexer-srcloc
   ["0" (token-ZERO)]
   ["1" (token-ONE)]
   [(eof) (token-EOF)]
   ))


(define (err-proc tok-ok? tok-name tok-value start-pos end-pos)
  (display "Ugghh!"))

(define simple-parse
  (parser
   (tokens etoks)
   (start S)
   (end EOF)
   (src-pos)
   (error err-proc)
   (grammar
    (S [(ONE ZERO) 'OK])
    )))


(define (make-scanner ip [path #f])
  (λ () (simple-lex ip)))

(simple-parse (make-scanner (open-input-string "01")))

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/6a0f7471-86f2-b889-0c8c-fdc400dfeb87%40comcast.net.

Reply via email to