本文整理汇总了C++中NxsToken::IsPlusMinusToken方法的典型用法代码示例。如果您正苦于以下问题:C++ NxsToken::IsPlusMinusToken方法的具体用法?C++ NxsToken::IsPlusMinusToken怎么用?C++ NxsToken::IsPlusMinusToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NxsToken
的用法示例。
在下文中一共展示了NxsToken::IsPlusMinusToken方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleFormat
/*!
Called when FORMAT command needs to be parsed from within the DIMENSIONS block. Deals with everything after the
token FORMAT up to and including the semicolon that terminates the FORMAT command.
*/
void NxsUnalignedBlock::HandleFormat(
NxsToken & token) /* is the token used to read from `in' */
{
bool standardDataTypeAssumed = false;
bool ignoreCaseAssumed = false;
for (;;)
{
token.GetNextToken();
if (token.Equals("DATATYPE"))
{
DemandEquals(token, "after keyword DATATYPE");
// This should be one of the following: STANDARD, DNA, RNA, NUCLEOTIDE or PROTEIN
token.GetNextToken();
if (token.Equals("STANDARD"))
datatype = NxsCharactersBlock::standard;
else if (token.Equals("DNA"))
datatype = NxsCharactersBlock::dna;
else if (token.Equals("RNA"))
datatype = NxsCharactersBlock::rna;
else if (token.Equals("NUCLEOTIDE"))
datatype = NxsCharactersBlock::nucleotide;
else if (token.Equals("PROTEIN"))
datatype = NxsCharactersBlock::protein;
else
{
errormsg = token.GetToken();
errormsg += " is not a valid DATATYPE within a ";
errormsg += NCL_BLOCKTYPE_ATTR_NAME;
errormsg += " block";
throw NxsException(errormsg, token.GetFilePosition(), token.GetFileLine(), token.GetFileColumn());
}
if (standardDataTypeAssumed && datatype != NxsCharactersBlock::standard)
{
errormsg = "DATATYPE must be specified first in FORMAT command";
throw NxsException(errormsg, token.GetFilePosition(), token.GetFileLine(), token.GetFileColumn());
}
originalDatatype = datatype;
ResetSymbols();
}
else if (token.Equals("RESPECTCASE"))
{
if (ignoreCaseAssumed)
{
errormsg = "RESPECTCASE must be specified before MISSING and SYMBOLS in FORMAT command";
throw NxsException(errormsg, token.GetFilePosition(), token.GetFileLine(), token.GetFileColumn());
}
standardDataTypeAssumed = true;
respectingCase = true;
}
else if (token.Equals("MISSING"))
{
DemandEquals(token, "after keyword MISSING");
// This should be the missing data symbol (single character)
token.GetNextToken();
if (token.GetTokenLength() != 1)
{
errormsg = "MISSING symbol should be a single character, but ";
errormsg += token.GetToken();
errormsg += " was specified";
throw NxsException(errormsg, token.GetFilePosition(), token.GetFileLine(), token.GetFileColumn());
}
else if (token.IsPunctuationToken() && !token.IsPlusMinusToken())
{
errormsg = "MISSING symbol specified cannot be a punctuation token (";
errormsg += token.GetToken();
errormsg += " was specified)";
throw NxsException(errormsg, token.GetFilePosition(), token.GetFileLine(), token.GetFileColumn());
}
else if (token.IsWhitespaceToken())
{
errormsg = "MISSING symbol specified cannot be a whitespace character (";
errormsg += token.GetToken();
errormsg += " was specified)";
throw NxsException(errormsg, token.GetFilePosition(), token.GetFileLine(), token.GetFileColumn());
}
missing = token.GetToken()[0];
ignoreCaseAssumed = true;
standardDataTypeAssumed = true;
}
else if (token.Equals("SYMBOLS") || token.Equals("SYMBOL"))
{
NxsDiscreteStateCell numDefStates;
unsigned maxNewStates;
switch(datatype)
{
case NxsCharactersBlock::dna:
case NxsCharactersBlock::rna:
case NxsCharactersBlock::nucleotide:
numDefStates = 4;
maxNewStates = NCL_MAX_STATES-4;
//.........这里部分代码省略.........