Skip to content

Instantly share code, notes, and snippets.

View ali-bahjati's full-sized avatar
🧙‍♂️
We gotta make these good times last!

Ali Behjati ali-bahjati

🧙‍♂️
We gotta make these good times last!
  • Douro Labs
  • Amsterdam, Netherlands
  • X @LiTiTwo
View GitHub Profile
@danking
danking / gist:1068185
Created July 6, 2011 19:55
A very simple example showing how to use Racket's lexing and parsing utilities
#lang racket
(require parser-tools/lex
(prefix-in re- parser-tools/lex-sre)
parser-tools/yacc)
(provide (all-defined-out))
(define-tokens a (NUM VAR))
(define-empty-tokens b (+ - EOF LET IN))
(define-lex-trans number
(syntax-rules ()