NCBI C++ ToolKit
|
#include <ncbi_pch.hpp>
#include <corelib/ncbimisc.hpp>
#include <objects/seqloc/Seq_loc.hpp>
#include <objmgr/util/seq_loc_util.hpp>
#include <objects/seqloc/Seq_loc_equiv.hpp>
#include <objects/general/Dbtag.hpp>
#include <objects/general/Object_id.hpp>
#include "ftacpp.hpp"
#include "ftaerr.hpp"
#include "xgbparint.h"
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
struct | STokenInfo |
class | CGBLocException |
Macros | |
#define | THIS_FILE "xgbparint.cpp" |
#define | TAKE_FIRST 1 |
#define | TAKE_SECOND 2 |
#define | ERR_FEATURE_LocationParsing_validatr 1, 5 |
Typedefs | |
using | TTokens = list< STokenInfo > |
using | TTokenIt = TTokens::iterator |
using | TTokenConstIt = TTokens::const_iterator |
Enumerations | |
enum class | ETokenType { eToken_Undefined , eToken_App , eToken_Request , eUnknown , eJoin , eCompl , eLeft , eRight , eCaret , eDotDot , eAccession , eGt , eLt , eComma , eNumber , eOrder , eSingleDot , eGroup , eOneOf , eReplace , eSites , eString , eOneOfNum , eGap , eUnkGap } |
Functions | |
USING_SCOPE (objects) | |
static void | do_xgbparse_error (string_view msg, string_view details) |
void | xinstall_gbparse_error_handler (X_gbparse_errfunc new_func) |
void | xinstall_gbparse_range_func (void *data, X_gbparse_rangefunc new_func) |
static string | xgbparse_point (TTokenConstIt head, TTokenConstIt current) |
static void | xgbparse_error (string_view front, TTokenConstIt head, TTokenConstIt current) |
static void | xgbparse_error (string_view front, const TTokens &tokens, TTokenConstIt current) |
static void | xgbcheck_range (TSeqPos num, const CSeq_id &id, bool &keep_rawPt, int &numErrors, const TTokens &tokens, TTokenConstIt current) |
static void | xfind_one_of_num (list< STokenInfo > &tokens) |
static void | xlex_error_func (string_view msg, const string &line, unsigned int current_col) |
static unsigned | advance_to (const char c, unsigned current_pos, const string &line) |
static size_t | sParseAccessionPrefix (string_view accession) |
static int | sGetAccession (string &accession, unsigned int ¤t_col, const string &line, bool accver) |
static int | xgbparselex_ver (string_view linein, TTokens &tokens, bool accver) |
static void | xgbparse_better_be_done (int &numErrors, TTokenIt current_token, const TTokens &tokens, bool &keep_rawPt, int paren_count) |
static CRef< CSeq_loc > | XGapToSeqLocEx (Int4 range, bool unknown) |
static void | xgbgap (TTokenIt ¤t_it, TTokenConstIt end_it, CRef< CSeq_loc > &loc, bool unknown) |
static void | sConvertIntToPoint (CSeq_loc &loc) |
static void | xgbload_number (TSeqPos &numPt, CInt_fuzz &fuzz, bool &keep_rawPt, TTokenIt ¤tPt, const TTokens &tokens, int &numErrors, int take_which) |
static CRef< CSeq_loc > | xgbint_ver (bool &keep_rawPt, TTokenIt ¤tPt, const TTokens &tokens, int &numErrors, const TSeqIdList &seq_ids, bool accver) |
static CRef< CSeq_loc > | xgbloc_ver (bool &keep_rawPt, int &parenPt, TTokenIt ¤tPt, const TTokens &tokens, int &numErrors, const TSeqIdList &seq_ids, bool accver) |
static CRef< CSeq_loc > | xgbreplace_ver (bool &keep_rawPt, int &parenPt, TTokenIt ¤tPt, const TTokens &tokens, int &numErrors, const TSeqIdList &seq_ids, bool accver) |
CRef< CSeq_loc > | xgbparseint_ver (string_view raw_intervals, bool &keep_rawPt, int &numErrors, const TSeqIdList &seq_ids, bool accver) |
Variables | |
const char * | seqlitdbtag = "SeqLit" |
const char * | unkseqlitdbtag = "UnkSeqLit" |
static X_gbparse_errfunc | Err_func = do_xgbparse_error |
static X_gbparse_rangefunc | Range_func = nullptr |
static void * | xgbparse_range_data = nullptr |
#define ERR_FEATURE_LocationParsing_validatr 1, 5 |
Definition at line 95 of file xgbparint.cpp.
#define TAKE_FIRST 1 |
Definition at line 49 of file xgbparint.cpp.
#define TAKE_SECOND 2 |
Definition at line 50 of file xgbparint.cpp.
#define THIS_FILE "xgbparint.cpp" |
Definition at line 47 of file xgbparint.cpp.
using TTokenConstIt = TTokens::const_iterator |
Definition at line 90 of file xgbparint.cpp.
using TTokenIt = TTokens::iterator |
Definition at line 89 of file xgbparint.cpp.
using TTokens = list<STokenInfo> |
Definition at line 88 of file xgbparint.cpp.
|
strong |
Definition at line 58 of file xgbparint.cpp.
Definition at line 304 of file xgbparint.cpp.
Referenced by xgbparselex_ver().
|
static |
Definition at line 97 of file xgbparint.cpp.
References ERR_FEATURE_LocationParsing_validatr, msg(), Nlm_ErrPostStr(), Nlm_ErrSetContext(), SEV_ERROR, and string.
Definition at line 789 of file xgbparint.cpp.
References CSeq_interval_Base::GetFrom(), CSeq_loc_Base::GetInt(), CSeq_interval_Base::IsSetFuzz_from(), CSeq_interval_Base::IsSetId(), CSeq_point_Base::SetFuzz(), CSeq_point_Base::SetId(), CSeq_loc::SetInt(), CSeq_loc::SetPnt(), and CSeq_point_Base::SetPoint().
Referenced by xgbint_ver().
|
static |
Definition at line 367 of file xgbparint.cpp.
References sParseAccessionPrefix(), string, and xlex_error_func().
Referenced by xgbparselex_ver().
|
static |
Definition at line 317 of file xgbparint.cpp.
References isalpha(), and isdigit().
Referenced by sGetAccession().
USING_SCOPE | ( | objects | ) |
|
static |
Definition at line 246 of file xgbparint.cpp.
References eComma, eDotDot, eLeft, eOneOf, eOneOfNum, eRight, and next().
Referenced by xgbparseint_ver().
Definition at line 729 of file xgbparint.cpp.
References compile_time_bits::range(), CRef< C, Locker >::Reset(), seqlitdbtag, CSeq_interval_Base::SetFrom(), CSeq_interval_Base::SetId(), CSeq_loc::SetInt(), CSeq_loc::SetNull(), CSeq_interval_Base::SetTo(), and unkseqlitdbtag.
Referenced by xgbgap().
|
static |
Definition at line 205 of file xgbparint.cpp.
References len, Range_func, xgbparse_error(), and xgbparse_range_data.
Referenced by xgbint_ver().
|
static |
Definition at line 754 of file xgbparint.cpp.
References eLeft, eNumber, eRight, next(), CSeq_loc::SetNull(), and XGapToSeqLocEx().
Referenced by xgbloc_ver().
|
static |
Definition at line 957 of file xgbparint.cpp.
References CSeq_id::Assign(), CInt_fuzz_Base::e_not_set, eAccession, eCaret, eComma, eCompl, eDotDot, eGroup, eGt, eJoin, eLeft, CInt_fuzz_Base::eLim_lt, CInt_fuzz_Base::eLim_tl, eLt, eNumber, eOneOfNum, eOrder, eRight, eSingleDot, CSeq_point_Base::GetPoint(), NCBI_FALLTHROUGH, CRef< C, Locker >::NotEmpty(), Ref(), CRef< C, Locker >::Reset(), sConvertIntToPoint(), CSeq_point_Base::SetFuzz(), CInt_fuzz_Base::SetLim(), CSeq_point_Base::SetPoint(), TAKE_FIRST, TAKE_SECOND, xgbcheck_range(), xgbload_number(), and xgbparse_error().
Referenced by xgbloc_ver(), and xgbparseint_ver().
|
static |
Definition at line 805 of file xgbparint.cpp.
References eCaret, eComma, eGt, eLeft, CInt_fuzz_Base::eLim_gt, CInt_fuzz_Base::eLim_lt, eLt, eNumber, eOneOf, eOneOfNum, eRight, eSingleDot, CInt_fuzz_Base::C_Range::GetMax(), CInt_fuzz_Base::C_Range::GetMin(), CInt_fuzz_Base::GetRange(), CInt_fuzz_Base::SetLim(), CInt_fuzz_Base::C_Range::SetMax(), CInt_fuzz_Base::C_Range::SetMin(), CInt_fuzz_Base::SetRange(), TAKE_FIRST, TAKE_SECOND, and xgbparse_error().
Referenced by xgbint_ver().
|
static |
Definition at line 1186 of file xgbparint.cpp.
References eAccession, eCaret, eComma, eCompl, eDotDot, eGap, eGroup, eGt, eJoin, eLeft, eLt, eNumber, eOneOf, eOneOfNum, eOrder, eReplace, eRight, eSingleDot, eSites, eString, eUnkGap, eUnknown, CSeq_loc_Base::IsInt(), CSeq_loc_Base::IsMix(), CSeq_loc_Base::IsNull(), CSeq_loc_Base::IsPnt(), CRef< C, Locker >::NotEmpty(), Ref(), CSeq_loc_Base::Reset(), SeqLocRevCmpl(), CSeq_loc::SetEquiv(), CSeq_loc::SetMix(), CSeq_loc::SetNull(), CSeq_loc::SetWhole(), xgbgap(), xgbint_ver(), and xgbparse_error().
Referenced by xgbparseint_ver(), and xgbreplace_ver().
|
static |
Definition at line 685 of file xgbparint.cpp.
References eRight, and xgbparse_error().
Referenced by xgbparseint_ver().
|
static |
Definition at line 198 of file xgbparint.cpp.
References ctll::front(), and xgbparse_error().
|
static |
Definition at line 191 of file xgbparint.cpp.
References Err_func, ctll::front(), head, and xgbparse_point().
Referenced by xgbcheck_range(), xgbint_ver(), xgbload_number(), xgbloc_ver(), xgbparse_better_be_done(), xgbparse_error(), xgbparseint_ver(), and xgbreplace_ver().
|
static |
CRef<CSeq_loc> xgbparseint_ver | ( | string_view | raw_intervals, |
bool & | keep_rawPt, | ||
int & | numErrors, | ||
const TSeqIdList & | seq_ids, | ||
bool | accver | ||
) |
Definition at line 1465 of file xgbparint.cpp.
References eAccession, eCaret, eComma, eCompl, eDotDot, eGroup, eGt, eJoin, eLeft, eLt, eNumber, eOneOf, eOneOfNum, eOrder, eReplace, eRight, eSingleDot, eSites, eString, eUnknown, NCBI_FALLTHROUGH, xfind_one_of_num(), xgbint_ver(), xgbloc_ver(), xgbparse_better_be_done(), xgbparse_error(), xgbparselex_ver(), and xgbreplace_ver().
Referenced by BOOST_AUTO_TEST_CASE(), GetCdRegionCB(), GetEmblInstContig(), GetGenBankInstContig(), GetSeqLocation(), GetTrnaAnticodon(), and XMLGetInstContig().
Definition at line 407 of file xgbparint.cpp.
References advance_to(), STokenInfo::choice, STokenInfo::data, eAccession, eCaret, eComma, eCompl, eDotDot, eGap, eGroup, eGt, eJoin, eLeft, eLt, NStr::eNocase, eNumber, eOneOf, eOrder, eReplace, eRight, eSingleDot, eSites, eString, eUnkGap, CTempString::find_first_not_of(), isdigit(), isspace(), len, sGetAccession(), NStr::StartsWith(), string, NStr::TruncateSpacesInPlace(), and xlex_error_func().
Referenced by xgbparseint_ver().
|
static |
Definition at line 1428 of file xgbparint.cpp.
References eComma, eLeft, xgbloc_ver(), and xgbparse_error().
Referenced by xgbparseint_ver().
void xinstall_gbparse_error_handler | ( | X_gbparse_errfunc | new_func | ) |
Definition at line 110 of file xgbparint.cpp.
References Err_func.
Referenced by GetTrnaAnticodon().
void xinstall_gbparse_range_func | ( | void * | data, |
X_gbparse_rangefunc | new_func | ||
) |
Definition at line 117 of file xgbparint.cpp.
References data, Range_func, and xgbparse_range_data.
Referenced by LoadFeat().
|
static |
Definition at line 294 of file xgbparint.cpp.
References Err_func, and msg().
Referenced by sGetAccession(), and xgbparselex_ver().
|
static |
Definition at line 104 of file xgbparint.cpp.
Referenced by xgbparse_error(), xinstall_gbparse_error_handler(), and xlex_error_func().
|
static |
Definition at line 105 of file xgbparint.cpp.
Referenced by xgbcheck_range(), and xinstall_gbparse_range_func().
const char* seqlitdbtag = "SeqLit" |
Definition at line 55 of file xgbparint.cpp.
Referenced by XGapToSeqLocEx(), and XISAGappedSeqLoc().
const char* unkseqlitdbtag = "UnkSeqLit" |
Definition at line 56 of file xgbparint.cpp.
Referenced by XGappedSeqLocsToDeltaSeqs(), XGapToSeqLocEx(), and XISAGappedSeqLoc().
|
static |
Definition at line 106 of file xgbparint.cpp.
Referenced by xgbcheck_range(), and xinstall_gbparse_range_func().