bnf.js 713 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. Language: Backus–Naur Form
  3. Website: https://en.wikipedia.org/wiki/Backus–Naur_form
  4. Author: Oleg Efimov <efimovov@gmail.com>
  5. */
  6. /** @type LanguageFn */
  7. function bnf(hljs) {
  8. return {
  9. name: 'Backus–Naur Form',
  10. contains: [
  11. // Attribute
  12. {
  13. className: 'attribute',
  14. begin: /</,
  15. end: />/
  16. },
  17. // Specific
  18. {
  19. begin: /::=/,
  20. end: /$/,
  21. contains: [
  22. {
  23. begin: /</,
  24. end: />/
  25. },
  26. // Common
  27. hljs.C_LINE_COMMENT_MODE,
  28. hljs.C_BLOCK_COMMENT_MODE,
  29. hljs.APOS_STRING_MODE,
  30. hljs.QUOTE_STRING_MODE
  31. ]
  32. }
  33. ]
  34. };
  35. }
  36. module.exports = bnf;