2023-07-03 06:18:27 -04:00
|
|
|
@top Bibliography {
|
2023-07-12 04:11:01 -04:00
|
|
|
(Other | Declaration | CommentDeclaration | PreambleDeclaration | StringDeclaration)*
|
2023-07-03 06:18:27 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@tokens {
|
2023-07-12 04:11:01 -04:00
|
|
|
Other { ![@ \t\n] ![@]* }
|
|
|
|
whiteSpace { $[\t\n ]+ }
|
2023-07-12 06:58:00 -04:00
|
|
|
Identifier { ![,{} \t\n%]+ }
|
2023-07-03 06:18:27 -04:00
|
|
|
StringName { $[a-zA-Z:_] $[a-zA-Z:_0-9-]* }
|
|
|
|
FieldName {$[a-zA-Z-_0-9]+}
|
|
|
|
LiteralString {
|
|
|
|
'"' (!["] | "\\" _)* '"'?
|
|
|
|
}
|
|
|
|
EntryTypeName { $[a-zA-Z]+ }
|
|
|
|
Number { @digit+ }
|
|
|
|
StringKeyword {"@"$[Ss]$[Tt]$[Rr]$[Ii]$[Nn]$[Gg]}
|
2023-07-12 04:11:01 -04:00
|
|
|
PreambleKeyword {"@"$[Pp]$[Rr]$[Ee]$[Aa]$[Mm]$[Bb]$[Ll]$[Ee]}
|
|
|
|
CommentKeyword {"@"$[Cc]$[Oo]$[Mm]$[Mm]$[Ee]$[Nn]$[Tt]}
|
|
|
|
CommentContents { ![@} \t\n] ![}@]* }
|
2023-07-04 04:10:57 -04:00
|
|
|
"{"[closedBy="}"]
|
|
|
|
"}"[openedBy="{"]
|
|
|
|
"@" "\"" "," "#" "@string"
|
2023-07-03 06:18:27 -04:00
|
|
|
}
|
|
|
|
|
2023-07-12 04:11:01 -04:00
|
|
|
@skip { whiteSpace }
|
2023-07-03 06:18:27 -04:00
|
|
|
|
|
|
|
StringDeclaration {
|
|
|
|
StringKeyword "{"
|
|
|
|
Field<StringName>*
|
|
|
|
"}"
|
|
|
|
}
|
|
|
|
|
2023-07-12 04:11:01 -04:00
|
|
|
PreambleDeclaration {
|
|
|
|
PreambleKeyword "{"
|
|
|
|
Expression
|
|
|
|
"}"
|
|
|
|
}
|
|
|
|
|
|
|
|
CommentDeclaration {
|
|
|
|
CommentKeyword "{"
|
|
|
|
CommentContents*
|
|
|
|
"}"
|
|
|
|
}
|
|
|
|
|
2023-07-03 06:18:27 -04:00
|
|
|
Declaration {
|
|
|
|
EntryName { "@" EntryTypeName } "{"
|
|
|
|
Identifier
|
|
|
|
|
|
|
|
fieldEntry {
|
|
|
|
("," Field<FieldName> )
|
|
|
|
}*
|
|
|
|
("," )?
|
|
|
|
"}"
|
|
|
|
}
|
|
|
|
|
|
|
|
Field<Name> {
|
|
|
|
Name "=" Expression
|
|
|
|
}
|
|
|
|
|
|
|
|
Expression {
|
|
|
|
BracedString |
|
|
|
|
Number |
|
|
|
|
StringConcatenation
|
|
|
|
}
|
|
|
|
|
|
|
|
@local tokens {
|
2023-07-04 04:10:57 -04:00
|
|
|
OpenBracedContents[closedBy="}", @name="{"] {"{"}
|
|
|
|
CloseBracedContents[openedBy="{", @name="}"] {"}"}
|
2023-07-03 06:18:27 -04:00
|
|
|
@else nonClosingBracedContents
|
|
|
|
}
|
|
|
|
|
|
|
|
@skip {}{
|
2023-07-07 08:01:05 -04:00
|
|
|
BracedStringContents {
|
2023-07-03 06:18:27 -04:00
|
|
|
(
|
|
|
|
nonClosingBracedContents |
|
|
|
|
nestedBracedString {
|
2023-07-04 04:10:57 -04:00
|
|
|
OpenBracedContents
|
2023-07-07 08:01:05 -04:00
|
|
|
BracedStringContents
|
2023-07-04 04:10:57 -04:00
|
|
|
CloseBracedContents
|
2023-07-03 06:18:27 -04:00
|
|
|
}
|
|
|
|
)*
|
|
|
|
}
|
|
|
|
BracedString {
|
2023-07-07 08:01:05 -04:00
|
|
|
"{" BracedStringContents CloseBracedContents
|
2023-07-03 06:18:27 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@precedence { concatenation @left }
|
|
|
|
|
|
|
|
StringConcatenation {
|
|
|
|
StringConcatenation !concatenation "#" StringConcatenation |
|
|
|
|
LiteralString |
|
|
|
|
StringName
|
|
|
|
}
|
|
|
|
|
|
|
|
@external propSource highlighting from "./highlight.mjs"
|