2024-01-16 21:26:16 +08:00
|
|
|
|
/*
|
|
|
|
|
Language: Backus–Naur Form
|
|
|
|
|
Website: https://en.wikipedia.org/wiki/Backus–Naur_form
|
|
|
|
|
Author: Oleg Efimov <efimovov@gmail.com>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** @type LanguageFn */
|
|
|
|
|
function bnf(hljs) {
|
2023-12-18 13:12:25 +08:00
|
|
|
|
return {
|
2024-01-16 21:26:16 +08:00
|
|
|
|
name: 'Backus–Naur Form',
|
2023-12-18 13:12:25 +08:00
|
|
|
|
contains: [
|
|
|
|
|
// Attribute
|
|
|
|
|
{
|
|
|
|
|
className: 'attribute',
|
2024-01-16 21:26:16 +08:00
|
|
|
|
begin: /</,
|
|
|
|
|
end: />/
|
2023-12-18 13:12:25 +08:00
|
|
|
|
},
|
|
|
|
|
// Specific
|
|
|
|
|
{
|
|
|
|
|
begin: /::=/,
|
2024-01-16 21:26:16 +08:00
|
|
|
|
end: /$/,
|
|
|
|
|
contains: [
|
|
|
|
|
{
|
|
|
|
|
begin: /</,
|
|
|
|
|
end: />/
|
|
|
|
|
},
|
|
|
|
|
// Common
|
|
|
|
|
hljs.C_LINE_COMMENT_MODE,
|
|
|
|
|
hljs.C_BLOCK_COMMENT_MODE,
|
|
|
|
|
hljs.APOS_STRING_MODE,
|
|
|
|
|
hljs.QUOTE_STRING_MODE
|
|
|
|
|
]
|
2023-12-18 13:12:25 +08:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
2024-01-16 21:26:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module.exports = bnf;
|