欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

idl.re

Boost provides free peer-reviewed portable C++ source libraries. We emphasize libraries that work
RE
第 1 页 / 共 2 页
字号:
                    int next2 = get_one_char(s);                    if (next2 == '\n')                    {                        --cnt; /* skip the backslash */                    }                    else                    {                        /* rewind one, and skip one char */                        rewind_stream(s, -1);                        --cnt;                    }                    boost::wave::cpplexer::re2clex::aq_enqueue(s->eol_offsets,                         cnt + (s->lim - s->bot));                    }                else if (next != -1) /* -1 means end of file */                {                    /* next was something else, so rewind the stream */                    rewind_stream(s, -1);                }            }            /* check \ \r EOB */            else if (last == '\r' && last2 == '\\')            {                int next = get_one_char(s);                if (next == '\n')                {                    cnt -= 2; /* skip the \ \r */                }                else                {                    /* rewind one, and skip two chars */                    rewind_stream(s, -1);                    cnt -= 2;                }                boost::wave::cpplexer::re2clex::aq_enqueue(s->eol_offsets,                     cnt + (s->lim - s->bot));                }            /* check \ \n EOB */            else if (last == '\n' && last2 == '\\')            {                cnt -= 2;                boost::wave::cpplexer::re2clex::aq_enqueue(s->eol_offsets,                     cnt + (s->lim - s->bot));                }        }                s->lim += cnt;        if (s->eof) /* eof needs adjusting if we erased backslash-newlines */        {            s->eof = s->lim;            *(s->eof)++ = '\0';        }    }    return cursor;}boost::wave::token_id  scan(boost::wave::cpplexer::re2clex::Scanner *s){    using namespace boost::wave::cpplexer::re2clex;    uchar *cursor = s->tok = s->cur;/*!re2cre2c:indent:string = "    "; any                = [\t\v\f\r\n\040-\377];anyctrl            = [\000-\377];OctalDigit         = [0-7];Digit              = [0-9];HexDigit           = [a-fA-F0-9];ExponentPart       = [Ee] [+-]? Digit+;FractionalConstant = (Digit* "." Digit+) | (Digit+ ".");FloatingSuffix     = [fF][lL]?|[lL][fF]?;IntegerSuffix      = [uU][lL]?|[lL][uU]?;FixedPointSuffix   = [dD];Backslash          = [\\]|"??/";EscapeSequence     = Backslash ([abfnrtv?'"] | Backslash | "x" HexDigit+ | OctalDigit OctalDigit? OctalDigit?);HexQuad            = HexDigit HexDigit HexDigit HexDigit;UniversalChar      = Backslash ("u" HexQuad | "U" HexQuad HexQuad);Newline            = "\r\n" | "\n" | "\r";PPSpace            = ([ \t]|("/*"(any\[*]|Newline|("*"+(any\[*/]|Newline)))*"*"+"/"))*;Pound              = "#" | "??=" | "%:";*//*!re2c    "/*"            { goto ccomment; }    "//"            { goto cppcomment; }        "TRUE"          { BOOST_WAVE_RET(T_TRUE); }    "FALSE"         { BOOST_WAVE_RET(T_FALSE); }        "{"             { BOOST_WAVE_RET(T_LEFTBRACE); }    "}"             { BOOST_WAVE_RET(T_RIGHTBRACE); }    "["             { BOOST_WAVE_RET(T_LEFTBRACKET); }    "]"             { BOOST_WAVE_RET(T_RIGHTBRACKET); }    "#"             { BOOST_WAVE_RET(T_POUND); }    "##"            { BOOST_WAVE_RET(T_POUND_POUND); }    "("             { BOOST_WAVE_RET(T_LEFTPAREN); }    ")"             { BOOST_WAVE_RET(T_RIGHTPAREN); }    ";"             { BOOST_WAVE_RET(T_SEMICOLON); }    ":"             { BOOST_WAVE_RET(T_COLON); }    "?"             { BOOST_WAVE_RET(T_QUESTION_MARK); }    "."             { BOOST_WAVE_RET(T_DOT); }    "+"             { BOOST_WAVE_RET(T_PLUS); }    "-"             { BOOST_WAVE_RET(T_MINUS); }    "*"             { BOOST_WAVE_RET(T_STAR); }    "/"             { BOOST_WAVE_RET(T_DIVIDE); }    "%"             { BOOST_WAVE_RET(T_PERCENT); }    "^"             { BOOST_WAVE_RET(T_XOR); }    "&"             { BOOST_WAVE_RET(T_AND); }    "|"             { BOOST_WAVE_RET(T_OR); }    "~"             { BOOST_WAVE_RET(T_COMPL); }    "!"             { BOOST_WAVE_RET(T_NOT); }    "="             { BOOST_WAVE_RET(T_ASSIGN); }    "<"             { BOOST_WAVE_RET(T_LESS); }    ">"             { BOOST_WAVE_RET(T_GREATER); }    "<<"            { BOOST_WAVE_RET(T_SHIFTLEFT); }    ">>"            { BOOST_WAVE_RET(T_SHIFTRIGHT); }    "=="            { BOOST_WAVE_RET(T_EQUAL); }    "!="            { BOOST_WAVE_RET(T_NOTEQUAL); }    "<="            { BOOST_WAVE_RET(T_LESSEQUAL); }    ">="            { BOOST_WAVE_RET(T_GREATEREQUAL); }    "&&"            { BOOST_WAVE_RET(T_ANDAND); }    "||"            { BOOST_WAVE_RET(T_OROR); }    "++"            { BOOST_WAVE_RET(T_PLUSPLUS); }    "--"            { BOOST_WAVE_RET(T_MINUSMINUS); }    ","             { BOOST_WAVE_RET(T_COMMA); }    ([a-zA-Z_] | UniversalChar) ([a-zA-Z_0-9] | UniversalChar)*                { BOOST_WAVE_RET(T_IDENTIFIER); }        (("0" [xX] HexDigit+) | ("0" OctalDigit*) | ([1-9] Digit*)) IntegerSuffix?        { BOOST_WAVE_RET(T_INTLIT); }    ((FractionalConstant ExponentPart?) | (Digit+ ExponentPart)) FloatingSuffix?        { BOOST_WAVE_RET(T_FLOATLIT); }    (FractionalConstant | Digit+) FixedPointSuffix        { BOOST_WAVE_RET(T_FIXEDPOINTLIT); }            "L"? (['] (EscapeSequence|any\[\n\r\\']|UniversalChar)+ ['])        { BOOST_WAVE_RET(T_CHARLIT); }        "L"? (["] (EscapeSequence|any\[\n\r\\"]|UniversalChar)* ["])        { BOOST_WAVE_RET(T_STRINGLIT); }        Pound PPSpace "include" PPSpace "<" (any\[\n\r>])+ ">"         { BOOST_WAVE_RET(T_PP_HHEADER); }    Pound PPSpace "include" PPSpace "\"" (any\[\n\r"])+ "\""         { BOOST_WAVE_RET(T_PP_QHEADER); }     Pound PPSpace "include" PPSpace        { BOOST_WAVE_RET(T_PP_INCLUDE); }     Pound PPSpace "if"        { BOOST_WAVE_RET(T_PP_IF); }    Pound PPSpace "ifdef"     { BOOST_WAVE_RET(T_PP_IFDEF); }    Pound PPSpace "ifndef"    { BOOST_WAVE_RET(T_PP_IFNDEF); }    Pound PPSpace "else"      { BOOST_WAVE_RET(T_PP_ELSE); }    Pound PPSpace "elif"      { BOOST_WAVE_RET(T_PP_ELIF); }    Pound PPSpace "endif"     { BOOST_WAVE_RET(T_PP_ENDIF); }    Pound PPSpace "define"    { BOOST_WAVE_RET(T_PP_DEFINE); }    Pound PPSpace "undef"     { BOOST_WAVE_RET(T_PP_UNDEF); }    Pound PPSpace "line"      { BOOST_WAVE_RET(T_PP_LINE); }    Pound PPSpace "error"     { BOOST_WAVE_RET(T_PP_ERROR); }    Pound PPSpace "pragma"    { BOOST_WAVE_RET(T_PP_PRAGMA); }    Pound PPSpace "warning"   { BOOST_WAVE_RET(T_PP_WARNING); }        [ \t\v\f]+        { BOOST_WAVE_RET(T_SPACE); }    Newline    {        s->line++;        BOOST_WAVE_RET(T_NEWLINE);    }    "\000"    {        if(cursor != s->eof)         {            using namespace std;      // some systems have printf in std            if (0 != s->error_proc) {                (*s->error_proc)(s,                     cpplexer::lexing_exception::generic_lexing_error,                    "'\\000' in input stream");            }            else                printf("Error: 0 in file\n");        }        BOOST_WAVE_RET(T_EOF);    }    anyctrl    {        BOOST_WAVE_RET(TOKEN_FROM_ID(*s->tok, UnknownTokenType));    }*/ccomment:/*!re2c    "*/"            { BOOST_WAVE_RET(T_CCOMMENT); }    Newline    {        /*if(cursor == s->eof) BOOST_WAVE_RET(T_EOF);*/        /*s->tok = cursor; */        s->line += count_backslash_newlines(s, cursor) +1;        goto ccomment;    }    any            { goto ccomment; }    "\000"    {        using namespace std;      // some systems have printf in std        if(cursor == s->eof)         {            if (s->error_proc)                (*s->error_proc)(s,                     cpplexer::lexing_exception::generic_lexing_warning,                    "Unterminated comment");            else                printf("Error: Unterminated comment\n");        }        else        {            if (s->error_proc)                (*s->error_proc)(s,                     cpplexer::lexing_exception::generic_lexing_error,                    "'\\000' in input stream");            else                printf("Error: 0 in file");        }        /* adjust cursor such next call returns T_EOF */        --YYCURSOR;        /* the comment is unterminated, but nevertheless its a comment */        BOOST_WAVE_RET(T_CCOMMENT);    }    anyctrl    {        if (s->error_proc)            (*s->error_proc)(s,                 cpplexer::lexing_exception::generic_lexing_error,                "invalid character in input stream");        else            printf("Error: 0 in file");    }*/cppcomment:/*!re2c    Newline    {        /*if(cursor == s->eof) BOOST_WAVE_RET(T_EOF); */        /*s->tok = cursor; */        s->line++;        BOOST_WAVE_RET(T_CPPCOMMENT);    }    any            { goto cppcomment; }    "\000"    {        using namespace std;      // some systems have printf in std        if(cursor != s->eof)         {            if (s->error_proc)                (*s->error_proc)(s,                     cpplexer::lexing_exception::generic_lexing_error,                    "'\\000' in input stream");            else                printf("Error: 0 in file");        }        /* adjust cursor such next call returns T_EOF */        --YYCURSOR;        /* the comment is unterminated, but nevertheless its a comment */        BOOST_WAVE_RET(T_CPPCOMMENT);    }*/} /* end of scan */#undef RE2C_ASSERT///////////////////////////////////////////////////////////////////////////////}   // namespace re2clex}   // namespace idllexer}   // namespace wave}   // namespace boost

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -