⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.93
Server IP:
65.108.141.171
Server:
Linux server.heloix.com 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
re2c
/
examples
/
View File Name :
02_recognizing_strings.i.c
/* Generated by re2c */ #include <stdio.h> #include <string.h> #define YYMAXFILL 1 struct input_t { size_t len; char *str; input_t(const char *s) : len(strlen(s)) , str(new char[len + YYMAXFILL]) { memcpy(str, s, len); memset(str + len, 'a', YYMAXFILL); } ~input_t() { delete[]str; } }; static bool lex(const input_t & input) { const char *YYCURSOR = input.str; const char *const YYLIMIT = input.str + input.len + YYMAXFILL; { char yych; if (YYLIMIT <= YYCURSOR) return false; yych = *YYCURSOR; switch (yych) { case '"': goto yy4; case '\'': goto yy6; default: goto yy2; } yy2: ++YYCURSOR; { return false; } yy4: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) return false; yych = *YYCURSOR; switch (yych) { case '"': goto yy8; default: goto yy4; } yy6: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) return false; yych = *YYCURSOR; switch (yych) { case '\'': goto yy8; default: goto yy6; } yy8: ++YYCURSOR; { return YYLIMIT - YYCURSOR == YYMAXFILL; } } } int main(int argc, char **argv) { for (int i = 1; i < argc; ++i) { input_t arg(argv[i]); printf("%s: %s\n", lex(arg) ? "str" : "err", argv[i]); } return 0; }