晶体CIF文件语法中英对照.docx
《晶体CIF文件语法中英对照.docx》由会员分享,可在线阅读,更多相关《晶体CIF文件语法中英对照.docx(37页珍藏版)》请在冰点文库上搜索。
晶体CIF文件语法中英对照
Syntax
Version1.1Workingspecification
∙Introduction
∙Definitionofterms
∙Filesyntax
oGeneralfeatures
oCharacterset
oWhitespace
oEnd-of-lineconventions
oCasesensitivity
oImplementationrestrictions
▪Maximumlinelengthandcharacterset
▪Maximumdataname,blockcodeandframecodelengths
▪Single-levelloopconstructions
▪Non-expansionofsaveframereferences
▪Exclusionofglobal_blocks
∙Versionidentification
∙AppendixA:
AformalgrammarforCIF
oSummary
oExplanationoftheformalsyntax
oLexicaltokens
oCIFgrammar
∙References
Introduction
1.ThisdocumentdescribesthefullsyntaxoftheCrystallographicInformationFile(CIF).
Definitionofterms
2.ThefollowingtermsareusedintheCIFspecificationdocumentswiththespecificmeaningsindicatedhere.
∙2.1.ACIFisafileconformingtothespecificationhereinstated,containingeitherinformationonacrystallographicexperimentoritsresults(orsimilarscientificcontent);ordescriptionsofthedataidentifiersinsuchafile.
∙2.2.Adatafileisunderstoodtoconveyinformationrelatingtoacrystallographicexperiment.
∙2.3.Adictionaryfileisunderstoodtocontaininformationaboutthedataitemsinoneormoredatafilesasidentifiedbytheirdatanames.
∙2.4.Adatanameisacase-insensitiveidentifier(astringofcharactersbeginningwithanunderscorecharacter)ofthecontentofanassociateddatavalue.
∙2.5.Adatavalueisastringofcharactersrepresentingaparticularitemofinformation.Itmayrepresentasinglenumericalvalue;aletter,wordorphrase;extendeddiscursivetext;orinprincipleanycoherentunitofdatasuchasanimage,audiocliporvirtual-realityobject.
∙2.6.Adataitemisaspecificpieceofinformationdefinedbyadatanameandanassociateddatavalue.
∙2.7.Atagisunderstoodinthisdocumenttobeasynonymfordataname.
∙2.8.Adatablockisthehighest-levelcomponentofaCIF,containingdataitemsorsaveframes.Adatablockisidentifiedbyadatablockheader,whichisanisolatedcharacterstring(thatis,boundedbywhitespaceandnotformingpartofadatavalue)beginningwiththecase-insensitivereservedcharactersdata_.
∙2.9.Ablockcodeisthevariablepartofadatablockheader,e.g.thestringfoointheheaderdata_foo.
∙2.10.Asaveframeisapartitionedcollectionofdataitemswithinadatablock,startedbyasaveframeheader,whichisanisolatedcharacterstringbeginningwiththecase-insensitivereservedcharacterssave_,andterminatedwithanisolatedcharacterstringcontainingonlythecase-insensitivereservedcharacterssave_.
∙2.11.Aframecodeisthevariablepartofasaveframeheader,e.g.thestringfoointheheadersave_foo.
Filesyntax
3.ThesyntaxofCIFisapropersubsetofthesyntaxofSTARFilesasdescribedbyHall(1991)andHall&Spadaccini(1994).ThegeneralstructureisdescribedbelowundertheheadingGeneralfeatures,andanumberofsubsectionslistspecificrestrictionstotheSTARsyntaxthatareinforcewithinCIF.AformallanguagegrammarusingcomputersciencenotationisincludedasAppendixA.
Generalfeatures
4.ACIFconsistsofdatanames(tags)andassociatedvaluesorganizedintodatablocks.Adatablockmaycontaindataitems(associateddatanamesanddatavalues)and/oritmaycontainsaveframes.
5.Saveframesmayonlybeusedindictionaryfiles.
Implementationnote:
Atapurelysyntacticlevelthereisnowaytodistinguishbetweendictionaryanddatafiles.(Itisalsotobenotedthatnotalldictionaryfilescontainsaveframes.)Afullyvalidatingparsermustthereforebeabletodetectthestartandterminationofsaveframes,theuniquenessoftheframecodewithinadatablock,andtheuniquenessofdatanameswithinaframecode.Itishoweverlegitimateforanapplication-basedparserdesignedtohandleonlythecontentsofdatafilestoconsiderthepresenceofasaveframeasanerror.
6.Adatablockbeginswiththereservedcase-insensitivestringdata_followedimmediatelybythenameofthedatablock,formingadatablockheader.Asaveframehasasimilarstructuretoadatablock,butmaynotitselfcontainfurthersaveframes.Asaveframebeginswiththereservedcase-insensitivestringsave_followedimmediatelybythenameofthesaveframe,formingasaveframeheader.Unlikeadatablock,asaveframealsohasamarkerfortheendoftheframeintheformofarepetitionofthereservedcase-insensitivewordsave_,thistimewithoutthenameoftheframe.Saveframesmaynotnest.WithinasingleCIF,notwodatablocksmayhavethesamename;withinasingledatablocknotwosaveframesmayhavethesamename,althoughasaveframemayhavethesamenameasadatablockinthesameCIF.
7.Agivendataname(tag)(see2.4and2.7)mayappearnomorethanonceinagivendatablockorsaveframe.Atagmaybefollowedbyasinglevalue,oralistofoneormoretagsmaybemarkedbytheprecedingreservedcase-insensitivewordloop_astheheadingsofthecolumnsofatableofvalues.Whitespaceisusedtoseparateadatablockorsaveframeheaderfromthecontentsofthedatablockorsaveframe,andtoseparatetags,valuesandthereservedwordloop_.Dataitems(tagsalongwiththeirassociatedvalues)thatarenotpresentedinatableofvaluesmayberelocatedalongwiththeirvalueswithinthesamedatablockorsaveframewithoutchangingthemeaningofthedatablockorsaveframe.Completetablesofvalues(thetablecolumnheadingsalongwithallcolumnsofdata)mayberelocatedwithinthesamedatablockorsaveframewithoutchangingthemeaningofthedatablockorsaveframe.Withinatableofvalues,eachtagmayberelocatedalongwithitsassociatedcolumnofvalueswithinthesametableofvalueswithoutchangingthemeaningofthetableofvalues.Ingeneraleachrowofatableofvaluesmayalsoberelocatedwithinthesametableofvalueswithoutchangingthemeaningofthetableofvalues.Combiningtablesofvaluesorbreakinguptablesofvalueswouldchangethemeanings,andislikelytoviolatetherulesforconstructingsuchtablesofvalues.
8.Thecase-insensitivewordglobal_,usedinSTARFilestointroduceagroupofdatavalueswithascopeextendingtotheendofthefile,isanadditionalreservedwordinCIF(thatis,itmaynotbeusedastheunquotedvalueofanydataitem).
9.Ifadatavalue(see2.5)containswhitespaceorbeginswithacharacterstringreservedforaspecialpurpose,itmustbedelimitedbyoneofseveralsetsofspecialcharacterstrings(thechoiceofwhichisconstrainedifthedatavaluecontainscharactersinterpretableasmarkinganewlineoftextaccordingtothediscussioninthefollowingparagraphs).Suchadatavaluewillbeindicatedbythetermnon-simpledatavalue.
10.Asimpledatavalue(i.e.onewhichdoesnotcontainwhitespaceorbeginwithaspecialcharacterstring)mayoptionallybedelimitedbyanyofthesamesetofdelimitingcharacterstrings,exceptfordatavaluesthataretobeinterpretedasnumbers.
11.Thespecialcharacterstringsinthiscontextarelistedinthefollowingtable.Theterm"non-simpledatavalues"inthistablereferstodatavaluesbeginningwiththesespecialcharacterstrings.
characterorstring
role
_(underscore)
identifiesdataname
#
identifiescomment
$
identifiessaveframepointer
'
delimitsnon-simpledatavalues
"
delimitsnon-simpledatavalues
[
reservedopeningdelimiterfornon-simpledatavalues(seeparagraph19)
]
reservedclosingdelimiterfornon-simpledatavalues(seeparagraph19)
;atbeginningoflineoftext
delimitsnon-simpledatavalues
data_
identifiesdatablockheader(case-insensitive)
save_
identifiessaveframeheaderorterminator(case-insensitive)
Inadditionthefollowingcase-insensitivereservedwordsmaynotoccurasunquoteddatavalues.
reservedword
role
loop_
identifiesloopedlistofdata
stop_
reservedSTARwordterminatingnestedloopsorloopheaders
global_
reservedasSTARglobalblockheader
12.ThecompletesyntacticdescriptionofanumericdatavalueisincludedinAppendixA(paragraph57)undertheproduction(i.e.ruleforconstructingapartofthelanguage).
13.ThebaseCIFspecificationdistinguishesbetweencharacterandnumericvalues(seeparagraph15ofthedocumentCommonsemanticfeatures).ParticularCIFapplicationsmaymakemorefinely-graineddistinctionswithinthesetypes.Theparagraphsimmediatelyabovehavethecorollarythatadatavaluesuchas12thatappearswithinaCIFmaybequoted(e.g.'12')if,andonlyifitistobeinterpretedandstoredincomputermemoryasacharacterstringandnotanumericvalue.Forexample'12'mightlegitimatelyappearasalabelforanatomicsite,whereanotheralphabeticoralphanumericstringsuchas'C12'isalsoacceptable;butitmaynotlegitimatelybeusedtorepresentanintegerquantitytwelve.
14.Matchingsingleordoublequotecharacters('or")maybeusedtoboundastringrepresentinganon-simpledatavalueprovidedthestringdoesnotextendovermorethanoneline.
15.Becausedatavaluesareinvariablyseparatedfromothertokensinthefilebywhitespace,suchaquote-delimitedcharacterstringmaycontaininstancesofthecharacterusedtodelimitthestringprovidedtheyarenotfollowedbywhitespace.Forexample,thedataitem
_example'adog'slife'
islegal;thedatavalueisadog'slife.
16.Notethatconstructssuchas'anembedded\'quote'donotbehaveasinthecaseofmanycurrentprogramminglanguages;i.e.thebackslashcharacterinthiscontextdoesnotescapethespecialmeaningofthedelimitercharacter.Abackslashprecedingtheapostropheordouble-quote