PageRenderTime 17ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/diff-cpp.ss

http://github.com/yinwang0/ydiff
Scheme | 56 lines | 10 code | 22 blank | 24 comment | 0 complexity | a4591b2c8bfefe6b4f116104c57b7f05 MD5 | raw file
Possible License(s): GPL-3.0
  1. ;; ydiff - a language-aware tool for comparing programs
  2. ;; Copyright (C) 2011 Yin Wang (yinwang0@gmail.com)
  3. ;; This program is free software: you can redistribute it and/or modify
  4. ;; it under the terms of the GNU General Public License as published by
  5. ;; the Free Software Foundation, either version 3 of the License, or
  6. ;; (at your option) any later version.
  7. ;; This program is distributed in the hope that it will be useful,
  8. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. ;; GNU General Public License for more details.
  11. ;; You should have received a copy of the GNU General Public License
  12. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. (load "parse-cpp.ss")
  14. (load "diff.ss")
  15. ;-------------------------------------------------------------
  16. ; overrides
  17. ;-------------------------------------------------------------
  18. (define get-name
  19. (lambda (node)
  20. (let ([id-exp (match-tags node '(name identifier id))])
  21. (and id-exp (get-symbol (car (Expr-elts id-exp)))))))
  22. ;; (get-name (car (parse1 $statement "int f(int x) {}")))
  23. ;; (same-def? (car (parse1 $statement "int f(int x) {}"))
  24. ;; (car (parse1 $statement "int f(int x) {}")))
  25. ;; (different-def? (car (parse1 $statement "int f(int x) {}"))
  26. ;; (car (parse1 $statement "int g(int x) {}")))
  27. ;---------------------------------------------
  28. (define diff-cpp
  29. (lambda (file1 file2)
  30. (load "diff-cpp.ss")
  31. (diff file1 file2 parse-cpp)))
  32. ;---------------------------------------------
  33. ; (diff-cpp "tests/simulator-mips.cc" "tests/simulator-arm.cc")
  34. ; (diff-cpp "tests/d8-3404.cc" "tests/d8-8424.cc")