/* ---------------------------------------------------------------------- * Peggy CREC Keyword File * $Id: ac_bibtex.kwd,v 1.1 2004/07/07 07:24:26 nzawa Exp nzawa $ * * [Language] * BibTeX 文献データベース (*.bib) * * [Bibliography] * 奥村晴彦『改訂第3版 LaTeX2e美文書作成入門』(技術評論社) * * * Copyright (c) 2004 Nzawa * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * ----------------------------------------------------------------------*/ Id: "BibTeX" Title: "BibTeX 文献データベース" Extensions: "bib" TabStop: 4 BgColoring: On BaseLanguage: "TEXT" IdCharacters: "@" HeadingPattern: /^\s*@\w+/ Const Pre = SubLang1 Const PreBrace = Pre +1 Const PreParen = Pre +20 Const Bib = SubLang2 Const BibBrace = Bib +1 Const BibParen = Bib +21 Context 1: { // コメント /@comment\>/i, FgComment, "コメント", @"@comment{\c}" // コマンド /@preamble\>/i, FgKeyword, PostGoTo Pre, "bblファイルの先頭にコマンドを埋め込む", @'@preamble{"\c"}' /@string\>/i, FgKeyword, PostGoTo Pre, "置換文字列を定義する", @'@string{\c = ""}' // 文献の種類 /@article\>/i, FgKeyword, PostGoTo Bib, "雑誌記事や論文誌の論文", @"@article{\c,\n}" /@book\>/i, FgKeyword, PostGoTo Bib, "出版社(出版主)のある書籍", @"@book{\c,\n}" /@booklet\>/i, FgKeyword, PostGoTo Bib, "出版社(出版主)のない書籍", @"@booklet{\c,\n}" /@conference\>/i, FgKeyword, PostGoTo Bib, "学術会議の議事録の一部(互換用)", @"@conference{\c,\n}" /@inbook\>/i, FgKeyword, PostGoTo Bib, "書籍の一部", @"@inbook{\c,\n}" /@incollection\>/i, FgKeyword, PostGoTo Bib, "書籍の一部(表題のあるもの)", @"@incollection{\c,\n}" /@inproceedings\>/i, FgKeyword, PostGoTo Bib, "学術会議の議事録の一部", @"@inproceedings{\c,\n}" /@manual\>/i, FgKeyword, PostGoTo Bib, "マニュアル", @"@manual{\c,\n}" /@mastersthesis\>/i, FgKeyword, PostGoTo Bib, "修士論文", @"@mastersthesis{\c,\n}" /@misc\>/i, FgKeyword, PostGoTo Bib, "他のものに当てはまらないもの", @"@misc{\c,\n}" /@phdthesis\>/i, FgKeyword, PostGoTo Bib, "博士論文", @"@phdthesis{\c,\n}" /@proceedings\>/i, FgKeyword, PostGoTo Bib, "学術会議の議事録", @"@proceedings{\c,\n}" /@techreport\>/i, FgKeyword, PostGoTo Bib, "技報(テクニカルレポート)", @"@techreport{\c,\n}" /@unpublished\>/i, FgKeyword, PostGoTo Bib, "公式な出版物ではないもの", @"@unpublished{\c,\n}" // @は使えない /@\w*/i, FgHTMLIllegalCharacter // BibTeXではブロックの外側は無視される Default, FgComment } /////////////////////////////////////////////////////////////////////////// // @preamble, @string Context Pre: { '{', FgText, @off, GoTo PreBrace // 中括弧ブロックの開始 '(', FgText, @off, GoTo PreParen // 小括弧ブロックの開始 Default, FgHTMLIllegalCharacter } Context PreBrace, PreParen: { // 数値 /\<\d+\>/, FgNumber // 項目 /[a-z:_-]\w*/i, FgIdentifier // 文字列連結 '#', FgKeyword, "文字列連結" // 文字列の開始 '"', FgString, @off, GoTo +1 '{', FgString, @off, GoTo +2 // その他 /[=,]/, FgText Default, FgHTMLIllegalCharacter } // 二重引用符文字列 Context PreBrace +1, PreParen +1: { /\\./, FgString '"', FgString, @off, PostGoTo -1 Default, FgString } // 中括弧文字列 Context PreBrace +2, PreParen +2: { /\\./, FgString '{', FgString, @off, GoTo +1 // ネスト '}', FgString, @off, PostGoTo -2 Default, FgString } // 中括弧文字列(ネスト) Context PreBrace +3 .. PreBrace + 18, PreParen +3 .. PreParen +18: { /\\./, FgString '{', FgString, @off, GoTo +1 // ネスト '}', FgString, @off, PostGoTo -1 Default, FgString } // 中括弧ブロックの終了 Context PreBrace: { '}', FgText, @off, PostGoTo 1 } // 小括弧ブロックの終了 Context PreParen: { ')', FgText, @off, PostGoTo 1 } /////////////////////////////////////////////////////////////////////////// // 文献 (@hoge) Context Bib: { '{', FgText, @off, GoTo BibBrace // 中括弧ブロックの開始 '(', FgText, @off, GoTo BibParen // 小括弧ブロックの開始 Default, FgHTMLIllegalCharacter } // 参照名 Context BibBrace, BibParen: { /[^,{}()]+/, FgIdentifier, "参照名" ',', FgText, @off, GoTo +1 Default, FgHTMLIllegalCharacter } Context BibBrace +1, BibParen +1: { // 数値 /\<\d+\>/, FgNumber // 処理される項目 "address"i, FgKeyword, @'address = "\c",' "author"i, FgKeyword, @'author = "\c",' "booktitle"i, FgKeyword, @'booktitle = "\c",' "chapter"i, FgKeyword, @'chapter = "\c",' "crossref"i, FgKeyword, @'crossref = "\c",' "edition"i, FgKeyword, @'edition = "\c",' "editor"i, FgKeyword, @'editor = "\c",' "howpublished"i, FgKeyword, @'howpublished = "\c",' "institution"i, FgKeyword, @'institution = "\c",' "journal"i, FgKeyword, @'journal = "\c",' "key"i, FgKeyword, @'key = "\c",' "month"i, FgKeyword, @'month = "\c",' "note"i, FgKeyword, @'note = "\c",' "number"i, FgKeyword, @'number = "\c",' "organization"i, FgKeyword, @'organization = "\c",' "pages"i, FgKeyword, @'pages = "\c",' "publisher"i, FgKeyword, @'publisher = "\c",' "school"i, FgKeyword, @'school = "\c",' "series"i, FgKeyword, @'series = "\c",' "title"i, FgKeyword, @'title = "\c",' "type"i, FgKeyword, @'type = "\c",' "volume"i, FgKeyword, @'volume = "\c",' "year"i, FgKeyword, @'year = "\c",' "yomi"i, FgKeyword, @'yomi = "\c",' // 処理されない項目(または置換文字列) /[a-z:_-]\w*/i, FgIdentifier // 文字列連結 '#', FgKeyword, "文字列連結" // 文字列の開始 '"', FgString, @off, GoTo +1 '{', FgString, @off, GoTo +2 // その他 /[=,]/, FgText Default, FgHTMLIllegalCharacter } // 二重引用符文字列 Context BibBrace +2, BibParen +2: { /\\./, FgString '"', FgString, @off, PostGoTo -1 Default, FgString } // 中括弧文字列 Context BibBrace +3, BibParen +3: { /\\./, FgString '{', FgString, @off, GoTo +1 // ネスト '}', FgString, @off, PostGoTo -2 Default, FgString } // 中括弧文字列(ネスト) Context BibBrace +4 .. BibBrace + 19, BibParen +4 .. BibParen +19: { /\\./, FgString '{', FgString, @off, GoTo +1 // ネスト '}', FgString, @off, PostGoTo -1 Default, FgString } // 中括弧ブロックの終了 Context BibBrace, BibBrace +1: { '}', FgText, @off, PostGoTo 1 } // 小括弧ブロックの終了 Context BibParen, BibParen +1: { ')', FgText, @off, PostGoTo 1 }