".ss" -> ".rkt" scan done.

original commit: 3157955d40f89d83fb3d5fa7a2f20639cda69579
tokens
Eli Barzilay 14 years ago
parent 57a7231b45
commit 509800c0df

@ -59,7 +59,7 @@
[comment (:: #\; (:* (:~ #\newline)) #\newline)]
;; See ${PLTHOME}/collects/syntax-color/scheme-lexer.ss for an example of
;; See ${PLTHOME}/collects/syntax-color/scheme-lexer.rkt for an example of
;; using regexp macros to avoid the cut and paste.
; [numR (:: prefixR complexR)]
; [complexR (:or realR

@ -2,19 +2,19 @@
;; Provides the syntax used to create lexers and the functions needed to
;; create and use the buffer that the lexer reads from. See docs.
(require-for-syntax mzlib/list
syntax/stx
syntax/define
syntax/boundmap
"private-lex/util.ss"
"private-lex/actions.ss"
"private-lex/front.ss"
"private-lex/unicode-chars.ss")
"private-lex/util.rkt"
"private-lex/actions.rkt"
"private-lex/front.rkt"
"private-lex/unicode-chars.rkt")
(require mzlib/stxparam
syntax/readerr
"private-lex/token.ss")
"private-lex/token.rkt")
(provide lexer lexer-src-pos define-lex-abbrev define-lex-abbrevs define-lex-trans

@ -2,8 +2,8 @@
(require mzlib/list
(prefix is: mzlib/integer-set)
"re.ss"
"util.ss")
"re.rkt"
"util.rkt")
(provide build-dfa print-dfa (struct dfa (num-states start-state final-states/actions transitions)))

@ -1,6 +1,6 @@
#lang scheme/base
(require (for-syntax scheme/base)
"../lex.ss"
"../lex.rkt"
rackunit)
(define-syntax (catch-syn-error stx)

@ -1,11 +1,11 @@
(module front mzscheme
(require (prefix is: mzlib/integer-set)
mzlib/list
syntax/stx
"util.ss"
"stx.ss"
"re.ss"
"deriv.ss")
syntax/stx
"util.rkt"
"stx.rkt"
"re.rkt"
"deriv.rkt")
(provide build-lexer)

@ -2,7 +2,7 @@
(require mzlib/list
scheme/match
(prefix is: mzlib/integer-set)
"util.ss")
"util.rkt")
(provide ->re build-epsilon build-zero build-char-set build-concat
build-repeat build-or build-and build-neg

@ -1,6 +1,6 @@
(module stx mzscheme
(require syntax/boundmap
"util.ss")
"util.rkt")
(provide parse)
@ -32,7 +32,7 @@
(define (disarm stx)
(syntax-disarm stx orig-insp))
;; parse : syntax-object (box (list-of syntax-object)) -> s-re (see re.ss)
;; parse : syntax-object (box (list-of syntax-object)) -> s-re (see re.rkt)
;; checks for errors and generates the plain s-exp form for s
;; Expands lex-abbrevs and applies lex-trans.
(define (parse stx disappeared-uses)

@ -1,6 +1,6 @@
(module token mzscheme
(require-for-syntax "token-syntax.ss")
(require-for-syntax "token-syntax.rkt")
;; Defining tokens

@ -1,5 +1,5 @@
(module unicode-chars mzscheme
(require "util.ss")
(require "util.rkt")
(provide (all-defined))

@ -5,7 +5,7 @@
(require mzlib/class
mzlib/list
"yacc-helper.ss"
"yacc-helper.rkt"
mzlib/contract)
;; Each production has a unique index 0 <= index <= number of productions

@ -1,11 +1,11 @@
(module input-file-parser mzscheme
;; routines for parsing the input to the parser generator and producing a
;; grammar (See grammar.ss)
;; grammar (See grammar.rkt)
(require "yacc-helper.ss"
"../private-lex/token-syntax.ss"
"grammar.ss"
(require "yacc-helper.rkt"
"../private-lex/token-syntax.rkt"
"grammar.rkt"
mzlib/class
mzlib/contract)
(require-for-template mzscheme)
@ -57,7 +57,7 @@
(values args biggest-pos))))
;; Given the list of terminal symbols and the precedence/associativity definitions,
;; builds terminal structures (See grammar.ss)
;; builds terminal structures (See grammar.rkt)
;; build-terms: symbol list * symbol list list -> term list
(define (build-terms term-list precs)
(let ((counter 0)
@ -87,7 +87,7 @@
(hash-table-get prec-table term-sym (lambda () #f))))
term-list)))
;; Retrieves the terminal symbols from a terminals-def (See terminal-syntax.ss)
;; Retrieves the terminal symbols from a terminals-def (See terminal-syntax.rkt)
;; get-terms-from-def: identifier? -> (listof identifier?)
(define (get-terms-from-def term-syn)
(let ((t (syntax-local-value term-syn (lambda () #f))))

@ -1,11 +1,11 @@
(module lalr mzscheme
;; Compute LALR lookaheads from DeRemer and Pennello 1982
(require "lr0.ss"
"grammar.ss"
mzlib/list
mzlib/class)
(require "lr0.rkt"
"grammar.rkt"
mzlib/list
mzlib/class)
(provide compute-LA)
@ -228,7 +228,7 @@
;; -> (trans-key -> term list)
;; DeRemer and Pennello 1982
;; Computes (f x) = (f- x) union Union{(f y) | y in (edges x)}
;; A specialization of digraph in the file graph.ss
;; A specialization of digraph in the file graph.rkt
(define (digraph-tk->terml nodes edges f- num-states)
(letrec (
;; Will map elements of trans-key to term sets represented as bit vectors

@ -2,14 +2,14 @@
;; Handle the LR0 automaton
(require "grammar.ss"
"graph.ss"
mzlib/list
mzlib/class)
(require "grammar.rkt"
"graph.rkt"
mzlib/list
mzlib/class)
(provide build-lr0-automaton lr0%
(struct trans-key (st gs)) trans-key-list-remove-dups
kernel-items kernel-index)
(struct trans-key (st gs)) trans-key-list-remove-dups
kernel-items kernel-index)
;; kernel = (make-kernel (LR1-item list) index)
;; the list must be kept sorted according to item<? so that equal? can

@ -1,5 +1,5 @@
(module parser-actions mzscheme
(require "grammar.ss")
(require "grammar.rkt")
(provide (all-defined-except make-reduce make-reduce*)
(rename make-reduce* make-reduce))

@ -1,8 +1,8 @@
(module parser-builder mzscheme
(require "input-file-parser.ss"
"grammar.ss"
"table.ss"
(require "input-file-parser.rkt"
"grammar.rkt"
"table.rkt"
mzlib/class
mzlib/contract)
(require-for-template mzscheme)
@ -69,7 +69,7 @@
#`(when #f
(let ((bind void) ... (tmp void) ...)
(void bound ... ... term-group ... start ... end ... prec ...))))))
(require mzlib/list "parser-actions.ss")
(require mzlib/list "parser-actions.rkt")
(define (build-parser filename src-pos suppress input-terms start end assocs prods)
(let* ((grammar (parse-input input-terms start end assocs prods src-pos))
(table (build-table grammar filename suppress))

@ -1,14 +1,14 @@
#lang scheme/base
;; Routine to build the LALR table
(require "grammar.ss"
"lr0.ss"
"lalr.ss"
"parser-actions.ss"
mzlib/contract
(require "grammar.rkt"
"lr0.rkt"
"lalr.rkt"
"parser-actions.rkt"
mzlib/contract
mzlib/list
mzlib/class)
mzlib/class)
(provide/contract
(build-table ((is-a?/c grammar%) string? any/c . -> .

@ -1,8 +1,8 @@
(module yacc-helper mzscheme
(require mzlib/list
"../private-lex/token-syntax.ss")
"../private-lex/token-syntax.rkt")
;; General helper routines
(provide duplicate-list? remove-duplicates overlap? vector-andmap display-yacc)

@ -1,19 +1,19 @@
#lang scheme/base
(require (for-syntax scheme/base
"private-yacc/parser-builder.ss"
"private-yacc/grammar.ss"
"private-yacc/yacc-helper.ss"
"private-yacc/parser-actions.ss"))
(require "private-lex/token.ss"
"private-yacc/parser-actions.ss"
mzlib/etc
mzlib/pretty
syntax/readerr)
(provide parser)
"private-yacc/parser-builder.rkt"
"private-yacc/grammar.rkt"
"private-yacc/yacc-helper.rkt"
"private-yacc/parser-actions.rkt"))
(require "private-lex/token.rkt"
"private-yacc/parser-actions.rkt"
mzlib/etc
mzlib/pretty
syntax/readerr)
(provide parser)
;; convert-parse-table : (vectorof (listof (cons/c gram-sym? action?))) ->
;; (vectorof (symbol runtime-action hashtable))
(define-for-syntax (convert-parse-table table)
@ -255,7 +255,7 @@
;; The table is a vector that maps each state to a hash-table that maps a
;; terminal symbol to either an accept, shift, reduce, or goto structure.
; We encode the structures according to the runtime-action data definition in
;; parser-actions.ss
;; parser-actions.rkt
(define (parser-body debug? err starts ends table all-term-syms actions src-pos)
(local ((define extract
(if src-pos

Loading…
Cancel
Save