wisent.srt 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. ;; wisent.srt --- SRecode templates for Emacs/WISENT grammar files.
  2. ;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
  3. ;; Author: Eric M. Ludlam <eric@siege-engine.com>
  4. ;; This file is part of GNU Emacs.
  5. ;; GNU Emacs is free software: you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation, either version 3 of the License, or
  8. ;; (at your option) any later version.
  9. ;; GNU Emacs is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  15. set mode "wisent-grammar-mode"
  16. set comment_start ";;"
  17. set comment_prefix ";;"
  18. set comment_end ""
  19. context file
  20. template empty :file :user :time
  21. "Insert a skeleton for a grammar file."
  22. ----
  23. {{>:filecomment}}
  24. ;;; Commentary:
  25. ;;
  26. ;; Parser for {{?TARGETMODE}} mode
  27. %languagemode {{TARGETMODE}}-mode
  28. %parsetable wisent-{{TARGETMODE}}-parser-tables
  29. %keywordtable wisent-{{TARGETMODE}}-keywords
  30. %tokentable wisent-{{TARGETMODE}}-tokens
  31. %languagemode {{TARGETMODE}}-mode
  32. %setupfunction wisent-{{TARGETMODE}}-default-setup
  33. %start goal
  34. ;;; KEYWORDS
  35. %type <keyword>
  36. %%
  37. goal
  38. : {{^}}
  39. ;
  40. %%
  41. (define-lex wisent-{{TARGETMODE}}-lexer
  42. "Lexical analyzer to handle {{TARGETMODE}} buffers."
  43. ;; semantic-lex-newline
  44. semantic-lex-ignore-whitespace
  45. semantic-lex-ignore-newline
  46. semantic-lex-ignore-comments
  47. semantic-lex-default-action
  48. )
  49. ;; {{FILENAME}} ends here
  50. ----
  51. context declaration
  52. template function
  53. ----
  54. {{?NAME}}
  55. : {{^}}
  56. ;
  57. ----
  58. bind "f"
  59. template keyword
  60. ----
  61. %keyword {{?NAME:upcase}} "{{NAME:downcase}}"
  62. %put {{NAME:upcase}} summary "{{NAME}} {{^}}"
  63. ----
  64. bind "k"
  65. template token
  66. ----
  67. %type <{{?LEXTOKEN}}>
  68. %token <{{LEXTOKEN}}> {{LEXTOKEN}}
  69. ----
  70. bind "t"
  71. ;; end