⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scan-gram.c

📁 GNU的词法/语法分析器bison源码
💻 C
📖 第 1 页 / 共 5 页
字号:
	YY_BREAK/*--------------------------------------------------------------.  | Scanning a line comment.  The initial `//' is already eaten.  |  `--------------------------------------------------------------*/case 64:/* rule 64 can match eol */YY_RULE_SETUP#line 363 "scan-gram.l"STRING_GROW; BEGIN context_state;	YY_BREAKcase 65:/* rule 65 can match eol */YY_RULE_SETUP#line 364 "scan-gram.l"STRING_GROW;	YY_BREAKcase YY_STATE_EOF(SC_LINE_COMMENT):#line 365 "scan-gram.l"BEGIN context_state;	YY_BREAK/*------------------------------------------------.  | Scanning a Bison string, including its escapes. |  | The initial quote is already eaten.             |  `------------------------------------------------*/case 66:YY_RULE_SETUP#line 376 "scan-gram.l"{    STRING_FINISH;    loc->start = token_start;    val->chars = last_string;    rule_length++;    BEGIN INITIAL;    return STRING;  }	YY_BREAKcase 67:/* rule 67 can match eol */YY_RULE_SETUP#line 384 "scan-gram.l"unexpected_newline (token_start, "\"");	BEGIN INITIAL;	YY_BREAKcase YY_STATE_EOF(SC_ESCAPED_STRING):#line 385 "scan-gram.l"unexpected_eof (token_start, "\"");	BEGIN INITIAL;	YY_BREAK/*----------------------------------------------------------.  | Scanning a Bison character literal, decoding its escapes. |  | The initial quote is already eaten.			      |  `----------------------------------------------------------*/case 68:YY_RULE_SETUP#line 395 "scan-gram.l"{    unsigned char last_string_1;    STRING_GROW;    STRING_FINISH;    loc->start = token_start;    val->symbol = symbol_get (quotearg_style (escape_quoting_style,					      last_string),			      *loc);    symbol_class_set (val->symbol, token_sym, *loc);    last_string_1 = last_string[1];    symbol_user_token_number_set (val->symbol, last_string_1, *loc);    STRING_FREE;    rule_length++;    BEGIN INITIAL;    return ID;  }	YY_BREAKcase 69:/* rule 69 can match eol */YY_RULE_SETUP#line 411 "scan-gram.l"unexpected_newline (token_start, "'");	BEGIN INITIAL;	YY_BREAKcase YY_STATE_EOF(SC_ESCAPED_CHARACTER):#line 412 "scan-gram.l"unexpected_eof (token_start, "'");	BEGIN INITIAL;	YY_BREAKcase 70:YY_RULE_SETUP#line 417 "scan-gram.l"complain_at (*loc, _("invalid null character"));	YY_BREAK/*----------------------------.  | Decode escaped characters.  |  `----------------------------*/case 71:YY_RULE_SETUP#line 427 "scan-gram.l"{    unsigned long int c = strtoul (gram_text + 1, 0, 8);    if (UCHAR_MAX < c)      complain_at (*loc, _("invalid escape sequence: %s"), quote (gram_text));    else if (! c)      complain_at (*loc, _("invalid null character: %s"), quote (gram_text));    else      obstack_1grow (&obstack_for_string, c);  }	YY_BREAKcase 72:YY_RULE_SETUP#line 437 "scan-gram.l"{    unsigned long int c;    set_errno (0);    c = strtoul (gram_text + 2, 0, 16);    if (UCHAR_MAX < c || get_errno ())      complain_at (*loc, _("invalid escape sequence: %s"), quote (gram_text));    else if (! c)      complain_at (*loc, _("invalid null character: %s"), quote (gram_text));    else      obstack_1grow (&obstack_for_string, c);  }	YY_BREAKcase 73:YY_RULE_SETUP#line 449 "scan-gram.l"obstack_1grow (&obstack_for_string, '\a');	YY_BREAKcase 74:YY_RULE_SETUP#line 450 "scan-gram.l"obstack_1grow (&obstack_for_string, '\b');	YY_BREAKcase 75:YY_RULE_SETUP#line 451 "scan-gram.l"obstack_1grow (&obstack_for_string, '\f');	YY_BREAKcase 76:YY_RULE_SETUP#line 452 "scan-gram.l"obstack_1grow (&obstack_for_string, '\n');	YY_BREAKcase 77:YY_RULE_SETUP#line 453 "scan-gram.l"obstack_1grow (&obstack_for_string, '\r');	YY_BREAKcase 78:YY_RULE_SETUP#line 454 "scan-gram.l"obstack_1grow (&obstack_for_string, '\t');	YY_BREAKcase 79:YY_RULE_SETUP#line 455 "scan-gram.l"obstack_1grow (&obstack_for_string, '\v');	YY_BREAK/* \\[\"\'?\\] would be shorter, but it confuses xgettext.  */case 80:YY_RULE_SETUP#line 458 "scan-gram.l"obstack_1grow (&obstack_for_string, gram_text[1]);	YY_BREAKcase 81:YY_RULE_SETUP#line 460 "scan-gram.l"{    int c = convert_ucn_to_byte (gram_text);    if (c < 0)      complain_at (*loc, _("invalid escape sequence: %s"), quote (gram_text));    else if (! c)      complain_at (*loc, _("invalid null character: %s"), quote (gram_text));    else      obstack_1grow (&obstack_for_string, c);  }	YY_BREAKcase 82:/* rule 82 can match eol */YY_RULE_SETUP#line 469 "scan-gram.l"{    complain_at (*loc, _("unrecognized escape sequence: %s"), quote (gram_text));    STRING_GROW;  }	YY_BREAK/*--------------------------------------------.  | Scanning user-code characters and strings.  |  `--------------------------------------------*/case 83:/* rule 83 can match eol */YY_RULE_SETUP#line 481 "scan-gram.l"STRING_GROW;	YY_BREAKcase 84:YY_RULE_SETUP#line 486 "scan-gram.l"STRING_GROW; BEGIN context_state;	YY_BREAKcase 85:/* rule 85 can match eol */YY_RULE_SETUP#line 487 "scan-gram.l"unexpected_newline (token_start, "'"); BEGIN context_state;	YY_BREAKcase YY_STATE_EOF(SC_CHARACTER):#line 488 "scan-gram.l"unexpected_eof (token_start, "'"); BEGIN context_state;	YY_BREAKcase 86:YY_RULE_SETUP#line 493 "scan-gram.l"STRING_GROW; BEGIN context_state;	YY_BREAKcase 87:/* rule 87 can match eol */YY_RULE_SETUP#line 494 "scan-gram.l"unexpected_newline (token_start, "\""); BEGIN context_state;	YY_BREAKcase YY_STATE_EOF(SC_STRING):#line 495 "scan-gram.l"unexpected_eof (token_start, "\""); BEGIN context_state;	YY_BREAK/*---------------------------------------------------.  | Strings, comments etc. can be found in user code.  |  `---------------------------------------------------*/case 88:YY_RULE_SETUP#line 505 "scan-gram.l"{    STRING_GROW;    context_state = YY_START;    token_start = loc->start;    BEGIN SC_CHARACTER;  }	YY_BREAKcase 89:YY_RULE_SETUP#line 511 "scan-gram.l"{    STRING_GROW;    context_state = YY_START;    token_start = loc->start;    BEGIN SC_STRING;  }	YY_BREAKcase 90:/* rule 90 can match eol */YY_RULE_SETUP#line 517 "scan-gram.l"{    STRING_GROW;    context_state = YY_START;    token_start = loc->start;    BEGIN SC_COMMENT;  }	YY_BREAKcase 91:/* rule 91 can match eol */YY_RULE_SETUP#line 523 "scan-gram.l"{    STRING_GROW;    context_state = YY_START;    BEGIN SC_LINE_COMMENT;  }	YY_BREAK/*---------------------------------------------------------------.  | Scanning after %union etc., possibly followed by white space.  |  | For %union only, allow arbitrary C code to appear before the   |  | following brace, as an extension to POSIX.			   |  `---------------------------------------------------------------*/case 92:YY_RULE_SETUP#line 539 "scan-gram.l"{    bool valid = gram_text[0] == '{' || token_type == PERCENT_UNION;    scanner_cursor.column -= mbsnwidth (gram_text, gram_leng, 0);    yyless (0);    if (valid)      {	braces_level = -1;	code_start = loc->start;	BEGIN SC_BRACED_CODE;      }    else      {	complain_at (*loc, _("missing `{' in %s"),		     token_name (token_type));	obstack_sgrow (&obstack_for_string, "{}");	STRING_FINISH;	val->chars = last_string;	BEGIN INITIAL;	return token_type;      }  }	YY_BREAKcase YY_STATE_EOF(SC_PRE_CODE):#line 562 "scan-gram.l"unexpected_eof (scanner_cursor, "{}"); BEGIN INITIAL;	YY_BREAK/*---------------------------------------------------------------.  | Scanning some code in braces (%union and actions). The initial |  | "{" is already eaten.                                          |  `---------------------------------------------------------------*/case 93:/* rule 93 can match eol */YY_RULE_SETUP#line 573 "scan-gram.l"STRING_GROW; braces_level++;	YY_BREAKcase 94:/* rule 94 can match eol */YY_RULE_SETUP#line 574 "scan-gram.l"STRING_GROW; braces_level--;	YY_BREAKcase 95:YY_RULE_SETUP#line 575 "scan-gram.l"{    bool outer_brace = --braces_level < 0;    /* As an undocumented Bison extension, append `;' before the last       brace in braced code, so that the user code can omit trailing       `;'.  But do not append `;' if emulating Yacc, since Yacc does       not append one.       FIXME: Bison should warn if a semicolon seems to be necessary       here, and should omit the semicolon if it seems unnecessary       (e.g., after ';', '{', or '}', each followed by comments or       white space).  Such a warning shouldn't depend on --yacc; it       should depend on a new --pedantic option, which would cause       Bison to warn if it detects an extension to POSIX.  --pedantic       should also diagnose other Bison extensions like %yacc.       Perhaps there should also be a GCC-style --pedantic-errors       option, so that such warnings are diagnosed as errors.  */    if (outer_brace && token_type == BRACED_CODE && ! yacc_flag)      obstack_1grow (&obstack_for_string, ';');    obstack_1grow (&obstack_for_string, '}');    if (outer_brace)      {	STRING_FINISH;	rule_length++;	loc->start = code_start;	val->chars = last_string;	BEGIN INITIAL;	return token_type;      }  }	YY_BREAK/* Tokenize `<<%' correctly (as `<<' `%') rather than incorrrectly     (as `<' `<%').  */case 96:/* rule 96 can match eol */YY_RULE_SETUP#line 610 "scan-gram.l"STRING_GROW;	YY_BREAKcase 97:YY_RULE_SETUP#line 612 "scan-gram.l"handle_dollar (token_type, gram_text, *loc);	YY_BREAKcase 98:YY_RULE_SETUP#line 613 "scan-gram.l"handle_at (token_type, gram_text, *loc);	YY_BREAKcase YY_STATE_EOF(SC_BRACED_CODE):#line 615 "scan-gram.l"unexpected_eof (code_start, "}"); BEGIN INITIAL;	YY_BREAK/*--------------------------------------------------------------.  | Scanning some prologue: from "%{" (already scanned) to "%}".  |  `--------------------------------------------------------------*/case 99:YY_RULE_SETUP#line 625 "scan-gram.l"{    STRING_FINISH;    loc->start = code_start;    val->chars = last_string;    BEGIN INITIAL;    return PROLOGUE;  }	YY_BREAKcase YY_STATE_EOF(SC_PROLOGUE):#line 633 "scan-gram.l"unexpected_eof (code_start, "%}"); BEGIN INITIAL;	YY_BREAK/*---------------------------------------------------------------.  | Scanning the epilogue (everything after the second "%%", which |  | has already been eaten).                                       |  `---------------------------------------------------------------*/case YY_STATE_EOF(SC_EPILOGUE):#line 644 "scan-gram.l"{    STRING_FINISH;    loc->start = code_start;    val->chars = last_string;    B

⌨️ 快捷键说明

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