MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / getToken

Function getToken

src/jrd/extds/ExtDS.cpp:1990–2090  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1988enum TokenType {ttNone, ttWhite, ttComment, ttBrokenComment, ttString, ttParamMark, ttIdent, ttOther};
1989
1990static TokenType getToken(const char** begin, const char* end)
1991{
1992 TokenType ret = ttNone;
1993 const char* p = *begin;
1994
1995 char c = *p++;
1996 switch (c)
1997 {
1998 case ':':
1999 case '?':
2000 ret = ttParamMark;
2001 break;
2002
2003 case '\'':
2004 case '"':
2005 while (p < end)
2006 {
2007 if (*p++ == c)
2008 {
2009 ret = ttString;
2010 break;
2011 }
2012 }
2013 break;
2014
2015 case '/':
2016 if (p < end && *p == '*')
2017 {
2018 ret = ttBrokenComment;
2019 p++;
2020 while (p < end)
2021 {
2022 if (*p++ == '*' && p < end && *p == '/')
2023 {
2024 p++;
2025 ret = ttComment;
2026 break;
2027 }
2028 }
2029 }
2030 else {
2031 ret = ttOther;
2032 }
2033 break;
2034
2035 case '-':
2036 if (p < end && *p == '-')
2037 {
2038 while (++p < end)
2039 {
2040 if (*p == '\r')
2041 {
2042 p++;
2043 if (p < end && *p == '\n')
2044 p++;
2045 break;
2046 }
2047 else if (*p == '\n')

Callers 12

preprocessMethod · 0.70
parseMethod · 0.50
parseInterfaceMethod · 0.50
parseStructMethod · 0.50
parseBooleanMethod · 0.50
parseTypedefMethod · 0.50
parseItemMethod · 0.50
parseConstantMethod · 0.50
parseIfThenElseActionMethod · 0.50
parseCallActionMethod · 0.50
parseMethodMethod · 0.50
parsePrimaryExprMethod · 0.50

Calls 1

classesFunction · 0.85

Tested by

no test coverage detected