mode-vhdl.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. define("ace/mode/vhdl_highlight_rules",["ace_require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(ace_require, exports, module) {
  2. "use strict";
  3. var oop = ace_require("../lib/oop");
  4. var TextHighlightRules = ace_require("./text_highlight_rules").TextHighlightRules;
  5. var VHDLHighlightRules = function() {
  6. var keywords = "access|after|ailas|all|architecture|assert|attribute|"+
  7. "begin|block|buffer|bus|case|component|configuration|"+
  8. "disconnect|downto|else|elsif|end|entity|file|for|function|"+
  9. "generate|generic|guarded|if|impure|in|inertial|inout|is|"+
  10. "label|linkage|literal|loop|mapnew|next|of|on|open|others|"+
  11. "out|port|process|pure|range|record|reject|report|return|"+
  12. "select|severity|shared|signal|subtype|then|to|transport|"+
  13. "type|unaffected|united|until|wait|when|while|with";
  14. var storageType = "bit|bit_vector|boolean|character|integer|line|natural|"+
  15. "positive|real|register|signed|std_logic|"+
  16. "std_logic_vector|string||text|time|unsigned|variable";
  17. var storageModifiers = "array|constant";
  18. var keywordOperators = "abs|and|mod|nand|nor|not|rem|rol|ror|sla|sll|sra"+
  19. "srl|xnor|xor";
  20. var builtinConstants = (
  21. "true|false|null"
  22. );
  23. var keywordMapper = this.createKeywordMapper({
  24. "keyword.operator": keywordOperators,
  25. "keyword": keywords,
  26. "constant.language": builtinConstants,
  27. "storage.modifier": storageModifiers,
  28. "storage.type": storageType
  29. }, "identifier", true);
  30. this.$rules = {
  31. "start" : [ {
  32. token : "comment",
  33. regex : "--.*$"
  34. }, {
  35. token : "string", // " string
  36. regex : '".*?"'
  37. }, {
  38. token : "string", // ' string
  39. regex : "'.*?'"
  40. }, {
  41. token : "constant.numeric", // float
  42. regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
  43. }, {
  44. token : "keyword", // pre-compiler directives
  45. regex : "\\s*(?:library|package|use)\\b"
  46. }, {
  47. token : keywordMapper,
  48. regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  49. }, {
  50. token : "keyword.operator",
  51. regex : "&|\\*|\\+|\\-|\\/|<|=|>|\\||=>|\\*\\*|:=|\\/=|>=|<=|<>"
  52. }, {
  53. token : "punctuation.operator",
  54. regex : "\\'|\\:|\\,|\\;|\\."
  55. },{
  56. token : "paren.lparen",
  57. regex : "[[(]"
  58. }, {
  59. token : "paren.rparen",
  60. regex : "[\\])]"
  61. }, {
  62. token : "text",
  63. regex : "\\s+"
  64. } ]
  65. };
  66. };
  67. oop.inherits(VHDLHighlightRules, TextHighlightRules);
  68. exports.VHDLHighlightRules = VHDLHighlightRules;
  69. });
  70. define("ace/mode/vhdl",["ace_require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/vhdl_highlight_rules"], function(ace_require, exports, module) {
  71. "use strict";
  72. var oop = ace_require("../lib/oop");
  73. var TextMode = ace_require("./text").Mode;
  74. var VHDLHighlightRules = ace_require("./vhdl_highlight_rules").VHDLHighlightRules;
  75. var Mode = function() {
  76. this.HighlightRules = VHDLHighlightRules;
  77. this.$behaviour = this.$defaultBehaviour;
  78. };
  79. oop.inherits(Mode, TextMode);
  80. (function() {
  81. this.lineCommentStart = "--";
  82. this.$id = "ace/mode/vhdl";
  83. }).call(Mode.prototype);
  84. exports.Mode = Mode;
  85. }); (function() {
  86. window.ace_require(["ace/mode/vhdl"], function(m) {
  87. if (typeof module == "object" && typeof exports == "object" && module) {
  88. module.exports = m;
  89. }
  90. });
  91. })();