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
(progn
  (defparameter *raw*
    (generate-world
     "RA"
     '((grammar rule-abbreviation-grammar :lalr-1 :expression)
       
       (deftag syntax-error)
       (deftype context integer)
       (deftype environment integer)
       (deftype semantic-exception (tag syntax-error))
       
       (rule :subexpression ((validate (-> (context environment) void)))
         (production :subexpression (keyword) subexpression-keyword
           ((validate (cxt :unused) (env :unused)))))
       
       (rule :expression ((validate (-> (context environment) void)) (validate2 (-> (context environment) void)))
         (production :expression (:subexpression) expression-unary
           ((validate cxt env) :forward)
           ((validate2 cxt env)
            ((validate :subexpression) cxt env)))
         (production :expression (:expression * :subexpression) expression-multiply
           ((validate cxt env) :forward)
           ((validate2 cxt env)
            ((validate :expression) cxt env)
            ((validate :subexpression) cxt env)))
         (production :expression (:subexpression + :subexpression) expression-add
           ((validate cxt env) :forward)
           ((validate2 cxt env)
            ((validate :subexpression 1) cxt env)
            ((validate :subexpression 2) cxt env)))
         (production :expression (this) expression-this
           ((validate cxt env) :forward)
           ((validate2 (cxt :unused) (env :unused)))))
       (%print-actions ("Validation" validate) ("Evaluation" eval))
       )))
  
  (defparameter *rag* (world-grammar *raw* 'rule-abbreviation-grammar)))

#|
(values
  (depict-rtf-to-local-file
   "Test/RuleAbbreviationSemantics.rtf"
   "Rule Abbreviation Semantics"
   #'(lambda (rtf-stream)
       (depict-world-commands rtf-stream *raw* :heading-offset 1)))
  (depict-html-to-local-file
   "Test/RuleAbbreviationSemantics.html"
   "Rule Abbreviation Semantics"
   t
   #'(lambda (html-stream)
       (depict-world-commands html-stream *raw* :heading-offset 1))
   :external-link-base ""))
|#

(length (grammar-states *rag*))