DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Untracked file

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
(progn
  (defparameter *waw*
    (generate-world
     "WA"
     '((lexer writable-action-lexer
              :lalr-1
              :main
              ((:digit (#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)
                       ((value $digit-value))))
              (($digit-value integer digit-value digit-char-36)))
       
       (%charclass :digit)
       
       (deftype semantic-exception integer)
       
       (defvar g integer 0)
       
       (rule :expr ((serial-num (writable-cell integer)) (walk (-> () void)) (value (-> () (vector integer))))
         (production :expr (:digit) expr-digit
           ((walk)
            (<- g (+ g 1))
            (action<- (serial-num :expr 0) g))
           ((value)
            (return (vector (+ (* 10 (serial-num :expr 0)) (value :digit))))))
         (production :expr (:digit :expr) expr-more
           ((walk)
            ((walk :expr))
            (<- g (+ g 1))
            (action<- (serial-num :expr 0) g))
           ((value)
            (const i integer (+ (* 10 (serial-num :expr 0)) (value :digit)))
            (return (cons i ((value :expr)))))))
       
       (rule :main ((value (vector integer)))
         (production :main (:expr) main-expr
           (value (begin
                   ((walk :expr))
                   (return ((value :expr)))))))
       (%print-actions)
       )))
  
  (defparameter *wal* (world-lexer *waw* 'writable-action-lexer))
  (defparameter *wag* (lexer-grammar *wal*)))

#|
(depict-rtf-to-local-file
 "Test/WritableActionSemantics.rtf"
 "Writable Action Semantics"
 #'(lambda (rtf-stream)
     (depict-world-commands rtf-stream *waw* :heading-offset 1)))

(depict-html-to-local-file
 "Test/WritableActionSemantics.html"
 "Writable Action Semantics"
 t
 #'(lambda (html-stream)
     (depict-world-commands html-stream *waw* :heading-offset 1))
 :external-link-base "")


(lexer-pparse *wal* "7")
(lexer-pparse *wal* "7500")
|#

(length (grammar-states *wag*))