NCBI C++ ToolKit
Classes | Macros | Typedefs | Enumerations | Functions | Variables
xgbparint.cpp File Reference
#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"
+ Include dependency graph for xgbparint.cpp:

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 &current_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_locXGapToSeqLocEx (Int4 range, bool unknown)
 
static void xgbgap (TTokenIt &current_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 &currentPt, const TTokens &tokens, int &numErrors, int take_which)
 
static CRef< CSeq_locxgbint_ver (bool &keep_rawPt, TTokenIt &currentPt, const TTokens &tokens, int &numErrors, const TSeqIdList &seq_ids, bool accver)
 
static CRef< CSeq_locxgbloc_ver (bool &keep_rawPt, int &parenPt, TTokenIt &currentPt, const TTokens &tokens, int &numErrors, const TSeqIdList &seq_ids, bool accver)
 
static CRef< CSeq_locxgbreplace_ver (bool &keep_rawPt, int &parenPt, TTokenIt &currentPt, const TTokens &tokens, int &numErrors, const TSeqIdList &seq_ids, bool accver)
 
CRef< CSeq_locxgbparseint_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
 

Macro Definition Documentation

◆ ERR_FEATURE_LocationParsing_validatr

#define ERR_FEATURE_LocationParsing_validatr   1, 5

Definition at line 95 of file xgbparint.cpp.

◆ TAKE_FIRST

#define TAKE_FIRST   1

Definition at line 49 of file xgbparint.cpp.

◆ TAKE_SECOND

#define TAKE_SECOND   2

Definition at line 50 of file xgbparint.cpp.

◆ THIS_FILE

#define THIS_FILE   "xgbparint.cpp"

Definition at line 47 of file xgbparint.cpp.

Typedef Documentation

◆ TTokenConstIt

using TTokenConstIt = TTokens::const_iterator

Definition at line 90 of file xgbparint.cpp.

◆ TTokenIt

using TTokenIt = TTokens::iterator

Definition at line 89 of file xgbparint.cpp.

◆ TTokens

using TTokens = list<STokenInfo>

Definition at line 88 of file xgbparint.cpp.

Enumeration Type Documentation

◆ ETokenType

enum ETokenType
strong
Enumerator
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 

Definition at line 58 of file xgbparint.cpp.

Function Documentation

◆ advance_to()

static unsigned advance_to ( const char  c,
unsigned  current_pos,
const string line 
)
static

Definition at line 304 of file xgbparint.cpp.

Referenced by xgbparselex_ver().

◆ do_xgbparse_error()

static void do_xgbparse_error ( string_view  msg,
string_view  details 
)
static

◆ sConvertIntToPoint()

static void sConvertIntToPoint ( CSeq_loc loc)
static

◆ sGetAccession()

static int sGetAccession ( string accession,
unsigned int current_col,
const string line,
bool  accver 
)
static

Definition at line 367 of file xgbparint.cpp.

References sParseAccessionPrefix(), string, and xlex_error_func().

Referenced by xgbparselex_ver().

◆ sParseAccessionPrefix()

static size_t sParseAccessionPrefix ( string_view  accession)
static

Definition at line 317 of file xgbparint.cpp.

References isalpha(), and isdigit().

Referenced by sGetAccession().

◆ USING_SCOPE()

USING_SCOPE ( objects  )

◆ xfind_one_of_num()

static void xfind_one_of_num ( list< STokenInfo > &  tokens)
static

Definition at line 246 of file xgbparint.cpp.

References eComma, eDotDot, eLeft, eOneOf, eOneOfNum, eRight, and next().

Referenced by xgbparseint_ver().

◆ XGapToSeqLocEx()

static CRef<CSeq_loc> XGapToSeqLocEx ( Int4  range,
bool  unknown 
)
static

◆ xgbcheck_range()

static void xgbcheck_range ( TSeqPos  num,
const CSeq_id id,
bool keep_rawPt,
int numErrors,
const TTokens tokens,
TTokenConstIt  current 
)
static

Definition at line 205 of file xgbparint.cpp.

References len, Range_func, xgbparse_error(), and xgbparse_range_data.

Referenced by xgbint_ver().

◆ xgbgap()

static void xgbgap ( TTokenIt current_it,
TTokenConstIt  end_it,
CRef< CSeq_loc > &  loc,
bool  unknown 
)
static

Definition at line 754 of file xgbparint.cpp.

References eLeft, eNumber, eRight, next(), CSeq_loc::SetNull(), and XGapToSeqLocEx().

Referenced by xgbloc_ver().

◆ xgbint_ver()

static CRef<CSeq_loc> xgbint_ver ( bool keep_rawPt,
TTokenIt currentPt,
const TTokens tokens,
int numErrors,
const TSeqIdList seq_ids,
bool  accver 
)
static

◆ xgbload_number()

static void xgbload_number ( TSeqPos numPt,
CInt_fuzz fuzz,
bool keep_rawPt,
TTokenIt currentPt,
const TTokens tokens,
int numErrors,
int  take_which 
)
static

◆ xgbloc_ver()

static CRef<CSeq_loc> xgbloc_ver ( bool keep_rawPt,
int parenPt,
TTokenIt currentPt,
const TTokens tokens,
int numErrors,
const TSeqIdList seq_ids,
bool  accver 
)
static

◆ xgbparse_better_be_done()

static void xgbparse_better_be_done ( int numErrors,
TTokenIt  current_token,
const TTokens tokens,
bool keep_rawPt,
int  paren_count 
)
static

Definition at line 685 of file xgbparint.cpp.

References eRight, and xgbparse_error().

Referenced by xgbparseint_ver().

◆ xgbparse_error() [1/2]

static void xgbparse_error ( string_view  front,
const TTokens tokens,
TTokenConstIt  current 
)
static

Definition at line 198 of file xgbparint.cpp.

References ctll::front(), and xgbparse_error().

◆ xgbparse_error() [2/2]

static void xgbparse_error ( string_view  front,
TTokenConstIt  head,
TTokenConstIt  current 
)
static

◆ xgbparse_point()

static string xgbparse_point ( TTokenConstIt  head,
TTokenConstIt  current 
)
static

◆ xgbparseint_ver()

CRef<CSeq_loc> xgbparseint_ver ( string_view  raw_intervals,
bool keep_rawPt,
int numErrors,
const TSeqIdList seq_ids,
bool  accver 
)

◆ xgbparselex_ver()

static int xgbparselex_ver ( string_view  linein,
TTokens tokens,
bool  accver 
)
static

◆ xgbreplace_ver()

static CRef<CSeq_loc> xgbreplace_ver ( bool keep_rawPt,
int parenPt,
TTokenIt currentPt,
const TTokens tokens,
int numErrors,
const TSeqIdList seq_ids,
bool  accver 
)
static

Definition at line 1428 of file xgbparint.cpp.

References eComma, eLeft, xgbloc_ver(), and xgbparse_error().

Referenced by xgbparseint_ver().

◆ xinstall_gbparse_error_handler()

void xinstall_gbparse_error_handler ( X_gbparse_errfunc  new_func)

Definition at line 110 of file xgbparint.cpp.

References Err_func.

Referenced by GetTrnaAnticodon().

◆ xinstall_gbparse_range_func()

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().

◆ xlex_error_func()

static void xlex_error_func ( string_view  msg,
const string line,
unsigned int  current_col 
)
static

Definition at line 294 of file xgbparint.cpp.

References Err_func, and msg().

Referenced by sGetAccession(), and xgbparselex_ver().

Variable Documentation

◆ Err_func

Definition at line 104 of file xgbparint.cpp.

Referenced by xgbparse_error(), xinstall_gbparse_error_handler(), and xlex_error_func().

◆ Range_func

X_gbparse_rangefunc Range_func = nullptr
static

Definition at line 105 of file xgbparint.cpp.

Referenced by xgbcheck_range(), and xinstall_gbparse_range_func().

◆ seqlitdbtag

const char* seqlitdbtag = "SeqLit"

Definition at line 55 of file xgbparint.cpp.

Referenced by XGapToSeqLocEx(), and XISAGappedSeqLoc().

◆ unkseqlitdbtag

const char* unkseqlitdbtag = "UnkSeqLit"

Definition at line 56 of file xgbparint.cpp.

Referenced by XGappedSeqLocsToDeltaSeqs(), XGapToSeqLocEx(), and XISAGappedSeqLoc().

◆ xgbparse_range_data

void* xgbparse_range_data = nullptr
static

Definition at line 106 of file xgbparint.cpp.

Referenced by xgbcheck_range(), and xinstall_gbparse_range_func().

Modified on Fri Sep 20 14:57:42 2024 by modify_doxy.py rev. 669887