📄 lexer.c
字号:
#line 117 "lexer.l"{return TK_SIPSLOTDIS;} YY_BREAKcase 61:YY_RULE_SETUP#line 118 "lexer.l"{return TK_QOBJECT;} YY_BREAKcase 62:YY_RULE_SETUP#line 119 "lexer.l"{return TK_ELLIPSIS;} YY_BREAKcase 63:YY_RULE_SETUP#line 122 "lexer.l"{ /* Ignore whitespace. */ ;} YY_BREAKcase 64:/* rule 64 can match eol */YY_RULE_SETUP#line 126 "lexer.l"{ /* Maintain the line number. */ ++inputFileStack[currentFile].lineno; if (codeIdx == 0) { BEGIN code; }} YY_BREAKcase 65:YY_RULE_SETUP#line 135 "lexer.l"{ /* Ignore C++ style comments. */ ;} YY_BREAKcase 66:YY_RULE_SETUP#line 140 "lexer.l"{ /* A signed decimal number. */ yylval.number = strtol(yytext,NULL,0); return TK_NUMBER;} YY_BREAKcase 67:YY_RULE_SETUP#line 146 "lexer.l"{/* A floating point number. */ yylval.real = strtod(yytext,NULL); return TK_REAL;} YY_BREAKcase 68:YY_RULE_SETUP#line 152 "lexer.l"{ /* An unsigned hexadecimal number. */ yylval.number = strtol(yytext,NULL,16); return TK_NUMBER;} YY_BREAKcase 69:YY_RULE_SETUP#line 158 "lexer.l"{ /* An identifier name. */ yylval.text = sipStrdup(yytext); return TK_NAME;} YY_BREAKcase 70:YY_RULE_SETUP#line 164 "lexer.l"{ /* A relative pathname. */ yylval.text = sipStrdup(yytext); return TK_PATHNAME;} YY_BREAKcase 71:/* rule 71 can match eol */YY_RULE_SETUP#line 170 "lexer.l"{ /* A double-quoted string. */ char *dp, *sp; /* Copy the string without the quotes. */ yylval.text = sipMalloc(strlen(yytext) + 1); dp = yylval.text; sp = yytext; while (*sp != '\0') { if (*sp != '"') *dp++ = *sp; ++sp; } *dp = '\0'; return TK_STRING;} YY_BREAKcase 72:/* rule 72 can match eol */YY_RULE_SETUP#line 194 "lexer.l"{ /* A single-quoted character. */ if (strlen(yytext) != 3) fatallex("Exactly one character expected between single quotes"); yylval.qchar = yytext[1]; return TK_QCHAR;} YY_BREAKcase 73:YY_RULE_SETUP#line 204 "lexer.l"{ /* Ignore C-style comments. */ BEGIN ccomment;} YY_BREAKcase 74:/* rule 74 can match eol */YY_RULE_SETUP#line 207 "lexer.l"{ ++inputFileStack[currentFile].lineno;} YY_BREAKcase 75:YY_RULE_SETUP#line 210 "lexer.l"{ BEGIN INITIAL;} YY_BREAKcase 76:YY_RULE_SETUP#line 213 "lexer.l"{ ;} YY_BREAKcase 77:YY_RULE_SETUP#line 218 "lexer.l"{ /* The software license. */ codeIdx = 0; return TK_COPYING;} YY_BREAKcase 78:YY_RULE_SETUP#line 223 "lexer.l"{ /* The start of a from-type code block. */ codeIdx = 0; return TK_FROMTYPE;} YY_BREAKcase 79:YY_RULE_SETUP#line 228 "lexer.l"{ /* The start of a to-type code block. */ codeIdx = 0; return TK_TOTYPE;} YY_BREAKcase 80:YY_RULE_SETUP#line 233 "lexer.l"{ /* The start of a to-sub-class code block. */ codeIdx = 0; return TK_TOSUBCLASS;} YY_BREAKcase 81:YY_RULE_SETUP#line 238 "lexer.l"{ /* The start of a module header code block. */ codeIdx = 0; return TK_MODHEADERCODE;} YY_BREAKcase 82:YY_RULE_SETUP#line 243 "lexer.l"{ /* The start of a type header code block. */ codeIdx = 0; return TK_TYPEHEADERCODE;} YY_BREAKcase 83:YY_RULE_SETUP#line 248 "lexer.l"{ /* The start of a pre-initialisation code block. */ codeIdx = 0; return TK_PREINITCODE;} YY_BREAKcase 84:YY_RULE_SETUP#line 253 "lexer.l"{ /* The start of a post-initialisation code block. */ codeIdx = 0; return TK_POSTINITCODE;} YY_BREAKcase 85:YY_RULE_SETUP#line 258 "lexer.l"{ /* The start of a module code block. */ codeIdx = 0; return TK_MODCODE;} YY_BREAKcase 86:YY_RULE_SETUP#line 263 "lexer.l"{ /* The start of a type code block. */ codeIdx = 0; return TK_TYPECODE;} YY_BREAKcase 87:YY_RULE_SETUP#line 268 "lexer.l"{ /* The start of a C++ method code block. */ codeIdx = 0; return TK_METHODCODE;} YY_BREAKcase 88:YY_RULE_SETUP#line 273 "lexer.l"{ /* The start of a C++ virtual code block. */ codeIdx = 0; return TK_VIRTUALCATCHERCODE;} YY_BREAKcase 89:YY_RULE_SETUP#line 278 "lexer.l"{ /* The start of a traverse code block. */ codeIdx = 0; return TK_TRAVERSECODE;} YY_BREAKcase 90:YY_RULE_SETUP#line 283 "lexer.l"{ /* The start of a clear code block. */ codeIdx = 0; return TK_CLEARCODE;} YY_BREAKcase 91:YY_RULE_SETUP#line 288 "lexer.l"{ /* The start of a read buffer code block. */ codeIdx = 0; return TK_READBUFFERCODE;} YY_BREAKcase 92:YY_RULE_SETUP#line 293 "lexer.l"{ /* The start of a write buffer code block. */ codeIdx = 0; return TK_WRITEBUFFERCODE;} YY_BREAKcase 93:YY_RULE_SETUP#line 298 "lexer.l"{ /* The start of a segment count code block. */ codeIdx = 0; return TK_SEGCOUNTCODE;} YY_BREAKcase 94:YY_RULE_SETUP#line 303 "lexer.l"{ /* The start of a char buffer code block. */ codeIdx = 0; return TK_CHARBUFFERCODE;} YY_BREAKcase 95:YY_RULE_SETUP#line 308 "lexer.l"{ /* The start of a pre-Python code block. */ codeIdx = 0; return TK_PREPYCODE;} YY_BREAKcase 96:YY_RULE_SETUP#line 313 "lexer.l"{ /* The start of a raise exception code block. */ codeIdx = 0; return TK_RAISECODE;} YY_BREAKcase 97:YY_RULE_SETUP#line 318 "lexer.l"{ /* The start of a documentation block. */ codeIdx = 0; return TK_DOC;} YY_BREAKcase 98:YY_RULE_SETUP#line 323 "lexer.l"{ /* The start of an exported documentation block. */ codeIdx = 0; return TK_EXPORTEDDOC;} YY_BREAKcase 99:YY_RULE_SETUP#line 328 "lexer.l"{ /* The start of a Makefile code block. */ codeIdx = 0; return TK_MAKEFILE;} YY_BREAKcase 100:YY_RULE_SETUP#line 333 "lexer.l"{ /* The start of an access code block. */ codeIdx = 0; return TK_ACCESSCODE;} YY_BREAKcase 101:YY_RULE_SETUP#line 338 "lexer.l"{ /* The start of a get code block. */ codeIdx = 0; return TK_GETCODE;} YY_BREAKcase 102:YY_RULE_SETUP#line 343 "lexer.l"{ /* The start of a set code block. */ codeIdx = 0; return TK_SETCODE;} YY_BREAKcase 103:YY_RULE_SETUP#line 348 "lexer.l"{ /* The end of a code block. */ BEGIN INITIAL; codeIdx = -1; return TK_END;} YY_BREAKcase 104:/* rule 104 can match eol */YY_RULE_SETUP#line 354 "lexer.l"{ /* The end of a code line . */ struct inputFile *ifp; codeLine[codeIdx] = '\n'; codeLine[codeIdx + 1] = '\0'; codeIdx = 0; ifp = &inputFileStack[currentFile]; yylval.codeb = sipMalloc(sizeof (codeBlock)); yylval.codeb -> frag = sipStrdup(codeLine); yylval.codeb -> linenr = ifp -> lineno++; yylval.codeb -> filename = sipStrdup(ifp -> name); yylval.codeb -> next = NULL; return TK_CODELINE;} YY_BREAKcase 105:YY_RULE_SETUP#line 373 "lexer.l"{ /* The contents of a code line. */ if (codeIdx == MAX_CODE_LINE_LENGTH) fatallex("Line is too long"); codeLine[codeIdx++] = yytext[0];} YY_BREAKcase 106:YY_RULE_SETUP#line 380 "lexer.l"{ /* Anything else is returned as is. */ return yytext
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -