1: #line 4 "./lpsrc/flx_lex_lib.ipk" 2: #include <flx.flxh> 3: /* ====================== REGULAR DEFINITIONS ============================ */ 4: module Flx_lex 5: { 6: /* special characters */ 7: regexp quote = '\''; 8: regexp dquote = '"'; 9: regexp slosh = '\\'; 10: regexp linefeed = '\n'; 11: regexp tab = '\t'; 12: regexp space = ' '; 13: regexp formfeed = [12]; 14: regexp vtab = [11]; 15: regexp carriage_return = [13]; 16: regexp underscore = '_'; 17: 18: /* character sets */ 19: regexp bindigit = ['0'-'1']; 20: regexp octdigit = ['0'-'7']; 21: regexp digit = ['0'-'9']; 22: regexp hexdigit = digit | ['A'-'F'] | ['a'-'f']; 23: regexp lower = ['a'-'z']; 24: regexp upper = ['A'-'Z']; 25: regexp letter = lower | upper; 26: regexp hichar = [128-255]; 27: regexp white = space | tab; 28: 29: /* nasty: form control characters */ 30: regexp form_control = linefeed | carriage_return | vtab | formfeed; 31: regexp newline_prefix = linefeed | carriage_return; 32: regexp newline = formfeed | linefeed | carriage_return linefeed; 33: /* regexp newline = newline_prefix form_control * */ 34: 35: regexp ordinary = letter | digit | hichar | 36: '!' | '#' | '$' | '%' | '&' | '(' | ')' | '*' | 37: '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' | 38: '=' | '>' | '?' | '@' | '[' | ']' | '^' | '_' | 39: '`' | '{' | '|' | '}' | '~' 40: ; 41: 42: regexp printable = ordinary | quote | dquote | slosh; 43: 44: /* identifiers */ 45: regexp ucn = 46: "\\u" hexdigit hexdigit hexdigit hexdigit 47: | "\\U" hexdigit hexdigit hexdigit hexdigit hexdigit hexdigit hexdigit hexdigit 48: ; 49: 50: regexp prime = '\''; 51: regexp idletter = letter | underscore | hichar | ucn; 52: regexp identifier = idletter (idletter | digit | prime )*; 53: 54: /* integers */ 55: regexp bin_lit = '0' ('b' | 'B') (underscore? bindigit) +; 56: regexp oct_lit = '0' ('o' | 'O') (underscore? octdigit) +; 57: regexp dec_lit = ('0' ('d' | 'D'))? digit (underscore? digit) *; 58: regexp hex_lit = '0' ('x' | 'X') (underscore? hexdigit) +; 59: regexp type_suffix = 60: 't'|'T'|'s'|'S'|'i'|'I'|'l'|'L'|'v'|'V'|"ll"|"LL" 61: | "i8" | "i16" | "i32" | "i64" 62: | "u8" | "u16" | "u32" | "u64" 63: | "I8" | "I16" | "I32" | "I64" 64: | "U8" | "U16" | "U32" | "U64" 65: ; 66: regexp signind = 'u' | 'U'; 67: regexp suffix = type_suffix? signind? | signind? type_suffix?; 68: regexp int_lit = (bin_lit | oct_lit | dec_lit | hex_lit) suffix; 69: 70: /* floats: Follows ISO C89, except that we allow underscores */ 71: regexp decimal_string = digit (underscore? digit) *; 72: regexp hexadecimal_string = hexdigit (underscore? hexdigit) *; 73: 74: regexp decimal_fractional_constant = 75: decimal_string '.' decimal_string? 76: | '.' decimal_string 77: ; 78: 79: regexp hexadecimal_fractional_constant = 80: ("0x" |"0X") 81: (hexadecimal_string '.' hexadecimal_string? 82: | '.' hexadecimal_string) 83: ; 84: 85: regexp decimal_exponent = ('E'|'e') ('+'|'-')? decimal_string; 86: regexp binary_exponent = ('P'|'p') ('+'|'-')? decimal_string; 87: 88: regexp floating_suffix = 'L' | 'l' | 'F' | 'f' | 'D' | 'd'; 89: regexp floating_literal = 90: ( 91: decimal_fractional_constant decimal_exponent? | 92: hexadecimal_fractional_constant binary_exponent? 93: ) 94: floating_suffix? 95: ; 96: 97: /* Python strings */ 98: regexp qqq = quote quote quote; 99: regexp ddd = dquote dquote dquote ; 100: 101: regexp escape = slosh _ ; 102: 103: regexp dddnormal = ordinary | quote | escape | white | newline; 104: regexp dddspecial = dddnormal | dquote dddnormal | dquote dquote dddnormal; 105: 106: regexp qqqnormal = ordinary | dquote | escape | white | newline; 107: regexp qqqspecial = qqqnormal | quote qqqnormal | quote quote qqqnormal; 108: 109: regexp raw_dddnormal = ordinary | quote | slosh | white | newline; 110: regexp raw_dddspecial = raw_dddnormal | dquote raw_dddnormal | dquote dquote raw_dddnormal; 111: 112: regexp raw_qqqnormal = ordinary | dquote | slosh | space | newline; 113: regexp raw_qqqspecial = raw_qqqnormal | quote raw_qqqnormal | quote quote raw_qqqnormal; 114: 115: regexp q_string = (ordinary | dquote | escape | white) * quote; 116: regexp d_string = (ordinary | quote | escape | white) * dquote; 117: regexp qqq_string = qqqspecial * qqq; 118: regexp ddd_string = dddspecial * ddd; 119: 120: regexp rq_string = (ordinary | dquote | escape | white) * quote; 121: regexp rd_string = (ordinary | quote | escape | white) * dquote; 122: 123: regexp rqqq_string = raw_qqqspecial * qqq; 124: regexp rddd_string = raw_dddspecial * ddd; 125: 126: regexp wq_string = q_string; 127: regexp wqqq_string = qqq_string; 128: regexp wd_string = d_string; 129: regexp wddd_string = ddd_string; 130: 131: regexp uq_string = q_string; 132: regexp uqqq_string = qqq_string; 133: regexp ud_string = d_string; 134: regexp uddd_string = ddd_string; 135: 136: regexp q_quote = quote; 137: regexp d_quote = dquote; 138: regexp qqq_quote = qqq; 139: regexp ddd_quote = ddd; 140: 141: regexp not_newline_or_slosh = ordinary | quote | dquote | white; 142: regexp not_newline = not_newline_or_slosh | slosh; 143: regexp quoted_filename = dquote (ordinary | quote | white | slosh)+ dquote; 144: 145: /* ====================== PARSERS ============================ */ 146: /* string tail lexers */ 147: 148: fun parse_q_string(s:Lexer::iterator, e:Lexer::iterator) = 149: { 150: return 151: reglex s to e with 152: | q_string => qQuote 153: | _ => Error 154: endmatch 155: ; 156: } 157: fun parse_qqq_string(s:Lexer::iterator, e:Lexer::iterator) = 158: { 159: return 160: reglex s to e with 161: | qqq_string => qqqQuote 162: | _ => Error 163: endmatch 164: ; 165: } 166: fun parse_d_string(s:Lexer::iterator, e:Lexer::iterator) = 167: { 168: return 169: reglex s to e with 170: | d_string => dQuote 171: | _ => Error 172: endmatch 173: ; 174: } 175: fun parse_ddd_string(s:Lexer::iterator, e:Lexer::iterator) = 176: { 177: return 178: reglex s to e with 179: | ddd_string => dddQuote 180: | _ => Error 181: endmatch 182: ; 183: } 184: fun parse_wq_string(s:Lexer::iterator, e:Lexer::iterator) = 185: { 186: return 187: reglex s to e with 188: | wq_string => wqQuote 189: | _ => Error 190: endmatch 191: ; 192: } 193: fun parse_wqqq_string(s:Lexer::iterator, e:Lexer::iterator) = 194: { 195: return 196: reglex s to e with 197: | wqqq_string => wqqqQuote 198: | _ => Error 199: endmatch 200: ; 201: } 202: fun parse_wd_string(s:Lexer::iterator, e:Lexer::iterator) = 203: { 204: return 205: reglex s to e with 206: | wd_string => wdQuote 207: | _ => Error 208: endmatch 209: ; 210: } 211: fun parse_wddd_string(s:Lexer::iterator, e:Lexer::iterator) = 212: { 213: return 214: reglex s to e with 215: | wddd_string => wdddQuote 216: | _ => Error 217: endmatch 218: ; 219: } 220: fun parse_uq_string(s:Lexer::iterator, e:Lexer::iterator) = 221: { 222: return 223: reglex s to e with 224: | uq_string => uqQuote 225: | _ => Error 226: endmatch 227: ; 228: } 229: fun parse_uqqq_string(s:Lexer::iterator, e:Lexer::iterator) = 230: { 231: return 232: reglex s to e with 233: | uqqq_string => uqqqQuote 234: | _ => Error 235: endmatch 236: ; 237: } 238: fun parse_ud_string(s:Lexer::iterator, e:Lexer::iterator) = 239: { 240: return 241: reglex s to e with 242: | ud_string => udQuote 243: | _ => Error 244: endmatch 245: ; 246: } 247: fun parse_uddd_string(s:Lexer::iterator, e:Lexer::iterator) = 248: { 249: return 250: reglex s to e with 251: | uddd_string => udddQuote 252: | _ => Error 253: endmatch 254: ; 255: } 256: fun parse_rq_string(s:Lexer::iterator, e:Lexer::iterator) = 257: { 258: return 259: reglex s to e with 260: | rq_string => rqQuote 261: | _ => Error 262: endmatch 263: ; 264: } 265: fun parse_rqqq_string(s:Lexer::iterator, e:Lexer::iterator) = 266: { 267: return 268: reglex s to e with 269: | rqqq_string => rqqqQuote 270: | _ => Error 271: endmatch 272: ; 273: } 274: fun parse_rd_string(s:Lexer::iterator, e:Lexer::iterator) = 275: { 276: return 277: reglex s to e with 278: | rd_string => rdQuote 279: | _ => Error 280: endmatch 281: ; 282: } 283: fun parse_rddd_string(s:Lexer::iterator, e:Lexer::iterator) = 284: { 285: return 286: reglex s to e with 287: | rddd_string => rdddQuote 288: | _ => Error 289: endmatch 290: ; 291: } 292: #line 181 "./lpsrc/flx_lex_lib.ipk" 293: 294: fun to_eol(s:Lexer::iterator, e:Lexer::iterator) = 295: { 296: return 297: match 298: reglex s to e with 299: | .* "\n" => () 300: endmatch 301: with 302: | ?p,_ => p 303: endmatch 304: ; 305: } 306: 307: fun to_end_c_comment(s:Lexer::iterator, e:Lexer::iterator) = 308: { 309: var j = s; 310: var again = true; 311: while { again } 312: { 313: match 314: reglex j to e with 315: | "*" "/" => "end" 316: | "*" => "chars" 317: | "/" "*" => "recurse" 318: | "/" => "chars" 319: | [^"/" "*"]* => "chars" 320: endmatch 321: with 322: | ?p,"end" => { j = p; again = false; } 323: | ?p,"recurse" => { j = to_end_c_comment(p,e); } 324: | ?p,"chars" => { j = p; } 325: endmatch 326: ; 327: } 328: ; 329: return j; 330: } 331: 332: union pretoken_k = // k for "kind" 333: | Ident 334: | Int 335: | Float 336: | C_comment 337: | Cpp_comment 338: | Preprocessor 339: | White 340: | Eol 341: | Error 342: 343: | qQuote 344: | qqqQuote 345: | dQuote 346: | dddQuote 347: 348: | wqQuote 349: | wqqqQuote 350: | wdQuote 351: | wdddQuote 352: 353: | uqQuote 354: | uqqqQuote 355: | udQuote 356: | udddQuote 357: 358: | rqQuote 359: | rqqqQuote 360: | rdQuote 361: | rdddQuote 362: 363: | DOLLAR 364: | QUEST 365: | EXCLAMATION 366: | LPAR 367: | RPAR 368: | LSQB 369: | RSQB 370: | LBRACE 371: | RBRACE 372: | COLON 373: | COMMA 374: | SEMI 375: | PLUS 376: | MINUS 377: | STAR 378: | SLASH 379: | VBAR 380: | AMPER 381: | LESS 382: | GREATER 383: | EQUAL 384: | DOT 385: | PERCENT 386: | BACKQUOTE 387: | TILDE 388: | CIRCUMFLEX 389: | HASH 390: | ANDLESS 391: | ANDGREATER 392: | EQEQUAL 393: | NOTEQUAL 394: | LESSEQUAL 395: | GREATEREQUAL 396: | LEFTSHIFT 397: | RIGHTSHIFT 398: | STARSTAR 399: | LESSCOLON 400: | COLONGREATER 401: | DOTDOT 402: | COLONCOLON 403: | PLUSPLUS 404: | MINUSMINUS 405: | PLUSEQUAL 406: | MINUSEQUAL 407: | STAREQUAL 408: | SLASHEQUAL 409: | PERCENTEQUAL 410: | CARETEQUAL 411: | VBAREQUAL 412: | AMPEREQUAL 413: | TILDEEQUAL 414: | COLONEQUAL 415: | RIGHTARROW 416: | EQRIGHTARROW 417: | LEFTARROW 418: | LSQANGLE 419: | RSQANGLE 420: | LSQBAR 421: | RSQBAR 422: | AMPERAMPER 423: | VBARVBAR 424: | SLOSHAMPER 425: | SLOSHVBAR 426: | SLOSHCIRCUMFLEX 427: | HASHBANG 428: | LEFTSHIFTEQUAL 429: | RIGHTSHIFTEQUAL 430: | LEFTRIGHTARROW 431: | ANDEQEQUAL 432: | ANDNOTEQUAL 433: | ANDLESSEQUAL 434: | ANDGREATEREQUAL 435: | DOTDOTDOT 436: | DOTRIGHTARROW 437: | LONGRIGHTARROW 438: | PARSE_ACTION 439: | HASHBANGSLASH 440: #line 254 "./lpsrc/flx_lex_lib.ipk" 441: 442: ; 443: 444: fun pre_flx_lex(s:Lexer::iterator, e:Lexer::iterator) = 445: { 446: return reglex s to e with 447: | "//" => Cpp_comment 448: | "/*" => C_comment 449: | identifier => Ident 450: | int_lit => Int 451: | floating_literal => Float 452: 453: /* Python strings */ 454: | q_quote => qQuote 455: | qqq_quote => qqqQuote 456: | d_quote => dQuote 457: | ddd_quote => dddQuote 458: 459: /* wide strings */ 460: | ('w' | 'W') q_quote => wqQuote 461: | ('w' | 'W') qqq_quote => wqqqQuote 462: | ('w' | 'W') d_quote => wdQuote 463: | ('w' | 'W') ddd_quote => wdddQuote 464: 465: /* UTF32 strings */ 466: | ('u' | 'U') q_quote => uqQuote 467: | ('u' | 'U') qqq_quote => uqqqQuote 468: | ('u' | 'U') d_quote => udQuote 469: | ('u' | 'U') ddd_quote => udddQuote 470: 471: /* Python raw strings */ 472: | ('r'|'R') q_quote => rqQuote 473: | ('r'|'R') qqq_quote => rqqqQuote 474: | ('r'|'R') d_quote => rdQuote 475: | ('r'|'R') ddd_quote => rdddQuote 476: 477: | "$" => DOLLAR 478: | "?" => QUEST 479: | "!" => EXCLAMATION 480: | "(" => LPAR 481: | ")" => RPAR 482: | "[" => LSQB 483: | "]" => RSQB 484: | "{" => LBRACE 485: | "}" => RBRACE 486: | ":" => COLON 487: | "," => COMMA 488: | ";" => SEMI 489: | "+" => PLUS 490: | "-" => MINUS 491: | "*" => STAR 492: | "/" => SLASH 493: | "|" => VBAR 494: | "&" => AMPER 495: | "<" => LESS 496: | ">" => GREATER 497: | "=" => EQUAL 498: | "." => DOT 499: | "%" => PERCENT 500: | "`" => BACKQUOTE 501: | "~" => TILDE 502: | "^" => CIRCUMFLEX 503: | "#" => HASH 504: | "&<" => ANDLESS 505: | "&>" => ANDGREATER 506: | "==" => EQEQUAL 507: | "!=" => NOTEQUAL 508: | "<=" => LESSEQUAL 509: | ">=" => GREATEREQUAL 510: | "<<" => LEFTSHIFT 511: | ">>" => RIGHTSHIFT 512: | "**" => STARSTAR 513: | "<:" => LESSCOLON 514: | ":>" => COLONGREATER 515: | ".." => DOTDOT 516: | "::" => COLONCOLON 517: | "++" => PLUSPLUS 518: | "--" => MINUSMINUS 519: | "+=" => PLUSEQUAL 520: | "-=" => MINUSEQUAL 521: | "*=" => STAREQUAL 522: | "/=" => SLASHEQUAL 523: | "%=" => PERCENTEQUAL 524: | "^=" => CARETEQUAL 525: | "|=" => VBAREQUAL 526: | "&=" => AMPEREQUAL 527: | "~=" => TILDEEQUAL 528: | ":=" => COLONEQUAL 529: | "->" => RIGHTARROW 530: | "=>" => EQRIGHTARROW 531: | "<-" => LEFTARROW 532: | "[<" => LSQANGLE 533: | ">]" => RSQANGLE 534: | "[|" => LSQBAR 535: | "|]" => RSQBAR 536: | "&&" => AMPERAMPER 537: | "||" => VBARVBAR 538: | "\\&" => SLOSHAMPER 539: | "\\|" => SLOSHVBAR 540: | "\\^" => SLOSHCIRCUMFLEX 541: | "#!" => HASHBANG 542: | "<<=" => LEFTSHIFTEQUAL 543: | ">>=" => RIGHTSHIFTEQUAL 544: | "<->" => LEFTRIGHTARROW 545: | "&==" => ANDEQEQUAL 546: | "&!=" => ANDNOTEQUAL 547: | "&<=" => ANDLESSEQUAL 548: | "&>=" => ANDGREATEREQUAL 549: | "..." => DOTDOTDOT 550: | ".->" => DOTRIGHTARROW 551: | "-->" => LONGRIGHTARROW 552: | "=>#" => PARSE_ACTION 553: | "#!/" => HASHBANGSLASH 554: #line 293 "./lpsrc/flx_lex_lib.ipk" 555: 556: /* whitespace */ 557: | white + => White 558: 559: /* Preprocessor Directive */ 560: | "#" => Preprocessor 561: 562: | newline => Eol 563: 564: /* Anything else is an error */ 565: | _ => Error 566: endmatch 567: ; 568: } 569: }
1: #line 424 "./lpsrc/flx_rtl.pak" 2: 3: pkg_requires = ['flx_compiler','flx_drivers','flx_rtl','flx_gc','flx_pthread','demux','faio'] 4:
1: #line 429 "./lpsrc/flx_rtl.pak" 2: cpp_cpps = ['rtl/flx_async'] 3: provides_lib = "libflx_async" 4: pkg_requires = ['faio','demux','flx_pthread','flx_rtl','flx_gc'] 5: lib_requires = ['libfaio','libdemux','libflx_pthread','libflx','libflx_gc'] 6: iscr_source = ['lpsrc/flx_rtl.pak'] 7: build_macro = "ASYNC" 8:
1: #line 438 "./lpsrc/flx_rtl.pak" 2: RTL_CPPS = [ 3: "rtl/flx_rtl", 4: "rtl/flx_dynlink", 5: "rtl/flx_sync", 6: "rtl/flx_eh", 7: "rtl/flx_i18n", 8: "rtl/flx_ioutil", 9: "rtl/flx_strutil", 10: "rtl/flx_main", 11: ] 12: 13: cpp_cpps = RTL_CPPS 14: provides_lib = "libflx" 15: lib_requires = ['libflx_gc'] 16: pkg_requires = ['flx_gc'] 17: iscr_source = ['lpsrc/flx_rtl.pak'] 18: build_macro = "RTL" 19: weaver_directory = 'doc/rtl/flx_rtl/' 20:
1: #line 459 "./lpsrc/flx_rtl.pak" 2: 3: DRIVERS = [ 4: ('static','rtl/flx_run','',[]), 5: ('dynamic','rtl/flx_run','bin/flx_run',[]), 6: ('static','test/flx_perf_drv1','',[]), 7: ('dynamic','test/flx_perf_drv1','test/flx_perf_drv1',[]), 8: ('static','test/micky_mouse','',[]), 9: ('dynamic','test/micky_mouse','bin/micky_mouse',[]), 10: ] 11: 12: DRLIBS = [ 13: 'libflx_pthread', 14: 'libflx', 15: 'libflx_gc', 16: ] 17: 18: drivers = DRIVERS 19: drivers_require_libs = DRLIBS 20: pkg_requires = ['flx_rtl','flx_pthread','flx_gc'] 21: lib_requires = ['libdemux','libflx_pthread','libflx'] 22: iscr_source = ['lpsrc/flx_rtl.pak'] 23:
1: #line 483 "./lpsrc/flx_rtl.pak" 2: 3: DRIVERS = [ 4: ('static','rtl/flx_arun','',[]), 5: ('dynamic','rtl/flx_arun','bin/flx_arun',[]), 6: ] 7: 8: DRLIBS = [ 9: 'libflx_async', 10: 'libfaio', 11: 'libdemux', 12: 'libflx_pthread', 13: 'libflx', 14: 'libflx_gc', 15: ] 16: 17: drivers = DRIVERS 18: drivers_require_libs = DRLIBS 19: pkg_requires = ['flx_gc','flx_rtl','flx_pthread','flx_async','demux','faio'] 20: iscr_source = ['lpsrc/flx_rtl.pak'] 21:
1: Name: flx 2: Description: Felix core runtime support 3: Version: $Id: flx_rtl.pak,v 1.60 2006/08/04 07:07:08 skaller Exp $ 4: provides_dlib: -lflx_dynamic 5: provides_slib: -lflx_static 6: Requires: flx_gc 7:
1: Name: flx_arun 2: Description: Felix standard driver, async support 3: Version: $Id: flx_rtl.pak,v 1.60 2006/08/04 07:07:08 skaller Exp $ 4: Requires: flx_async faio demux flx_pthread flx flx_gc 5:
1: Name: flx_run 2: Description: Felix standard driver, no async support 3: Version: $Id: flx_rtl.pak,v 1.60 2006/08/04 07:07:08 skaller Exp $ 4: Requires: flx_pthread flx flx_gc 5:
1: Name: flx_async 2: Description: Async hook 3: Version: $Id: flx_rtl.pak,v 1.60 2006/08/04 07:07:08 skaller Exp $ 4: provides_dlib: -lflx_async_dynamic 5: provides_slib: -lflx_async_static 6: Requires: faio demux flx_pthread flx flx_gc 7:
1: #line 546 "./lpsrc/flx_rtl.pak" 2: #ifndef FLX_META 3: #define FLX_META 4: // taken from BOOST 5: #line 551 "./lpsrc/flx_rtl.pak" 6: #define FLX_HAVE_INCLASS_MEMBER_INITIALIZATION 7: #line 551 "./lpsrc/flx_rtl.pak" 8: #ifdef FLX_HAVE_INCLASS_MEMBER_INITIALIZATION 9: # define FLX_STATIC_CONSTANT(type, assignment) static const type assignment 10: #else 11: # define FLX_STATIC_CONSTANT(type, assignment) enum { assignment } 12: #endif 13: 14: #include <cstddef> 15: 16: template <std::size_t> struct type_with_alignment; 17: #line 564 "./lpsrc/flx_rtl.pak" 18: template <> struct type_with_alignment<8>{ typedef void* type; }; 19: #line 564 "./lpsrc/flx_rtl.pak" 20: template <> struct type_with_alignment<1>{ typedef char type; }; 21: #line 564 "./lpsrc/flx_rtl.pak" 22: template <> struct type_with_alignment<2>{ typedef short type; }; 23: #line 564 "./lpsrc/flx_rtl.pak" 24: template <> struct type_with_alignment<4>{ typedef wchar_t type; }; 25: #line 564 "./lpsrc/flx_rtl.pak" 26: template <> struct type_with_alignment<16>{ typedef long double type; }; 27: #line 564 "./lpsrc/flx_rtl.pak" 28: template <typename T> struct alignment_of; 29: 30: template <typename T> 31: struct alignment_of_hack 32: { 33: char c; 34: T t; 35: alignment_of_hack(); 36: }; 37: 38: template <unsigned A, unsigned S> 39: struct alignment_logic 40: { 41: FLX_STATIC_CONSTANT(std::size_t, value = A < S ? A : S); 42: }; 43: 44: template< typename T > 45: struct alignment_of 46: { 47: FLX_STATIC_CONSTANT(std::size_t, value = 48: (alignment_logic< 49: sizeof(alignment_of_hack<T>) - sizeof(T), 50: sizeof(T) 51: >::value)); 52: }; 53: 54: template<std::size_t L, std::size_t A> 55: struct aligned_storage 56: { 57: union type 58: { 59: unsigned char data_[ L ]; 60: typename type_with_alignment<A>::type align_; 61: }; 62: }; 63: 64: template<typename T> 65: struct store_of 66: { 67: typedef typename aligned_storage<sizeof(T), alignment_of<T>::value>::type type; 68: }; 69: 70: // convert an rvalue to an lvalue 71: template<typename T> 72: T const &lvalue(T const &x) 73: { 74: return x; 75: } 76: 77: // this reinterpret cast works with rvalues too 78: template<typename T, typename U> 79: T &reinterpret(U const &x) { 80: return reinterpret_cast<T&>(const_cast<U&>(x)); 81: } 82: #endif 83:
1: #line 622 "./lpsrc/flx_rtl.pak" 2: #ifndef FLX_HOST_CONFIG 3: #define FLX_RTL_CONFIG 4: 5: #ifdef _WIN32 6: #define _WIN32_WINNT 0x500 7: #endif 8: 9: #line 632 "./lpsrc/flx_rtl.pak" 10: #define HAVE_LONGLONG 11: #line 635 "./lpsrc/flx_rtl.pak" 12: #define HAVE_LONGDOUBLE 13: #line 635 "./lpsrc/flx_rtl.pak" 14: #if !defined(FLX_STATIC_LINK) && (defined(_WIN32)) 15: #define FLX_EXPORT __declspec(dllexport) 16: #define FLX_IMPORT __declspec(dllimport) 17: #else 18: #define FLX_EXPORT 19: #define FLX_IMPORT 20: #endif 21: 22: 23: #line 650 "./lpsrc/flx_rtl.pak" 24: #define FLX_RAWADDRESS unsigned long 25: #define FLX_MAX_ALIGN 16 26: 27: 28: #endif 29:
1: #line 658 "./lpsrc/flx_rtl.pak" 2: #ifndef FLX_RTL_CONFIG 3: #define FLX_RTL_CONFIG 4: 5: #ifdef _WIN32 6: #define _WIN32_WINNT 0x500 7: // vs windows.h just LOVES to include winsock version 1 headers by default. 8: // that's bad for everyone, so quit it. 9: #define _WINSOCKAPI_ 10: #endif 11: 12: #line 671 "./lpsrc/flx_rtl.pak" 13: #define HAVE_VSNPRINTF 14: #line 674 "./lpsrc/flx_rtl.pak" 15: #define HAVE_LONGLONG 16: #line 677 "./lpsrc/flx_rtl.pak" 17: #define HAVE_LONGDOUBLE 18: #line 677 "./lpsrc/flx_rtl.pak" 19: #ifndef FLX_RTL_GNU 20: #line 684 "./lpsrc/flx_rtl.pak" 21: #define HAVE_GNU 22: #line 690 "./lpsrc/flx_rtl.pak" 23: #define HAVE_GNU_X86_64 24: #line 693 "./lpsrc/flx_rtl.pak" 25: #define FLX_HAVE_CGOTO 26: #line 699 "./lpsrc/flx_rtl.pak" 27: #define FLX_HAVE_ASM_LABELS 28: #line 702 "./lpsrc/flx_rtl.pak" 29: #define HAVE_DLOPEN 30: #line 708 "./lpsrc/flx_rtl.pak" 31: #define FLX_LINUX 32: #line 711 "./lpsrc/flx_rtl.pak" 33: #define POSIX 34: #line 723 "./lpsrc/flx_rtl.pak" 35: #define HAVE_POLL 36: #line 726 "./lpsrc/flx_rtl.pak" 37: #define HAVE_EPOLL 38: #line 729 "./lpsrc/flx_rtl.pak" 39: // 40: #if defined(FLX_HAVE_CGOTO) && defined(FLX_HAVE_ASM_LABELS) 41: #define FLX_CGOTO 42: #endif 43: 44: #if !defined(FLX_STATIC_LINK) && (defined(_WIN32)) 45: #define FLX_EXPORT __declspec(dllexport) 46: #define FLX_IMPORT __declspec(dllimport) 47: #else 48: #define FLX_EXPORT 49: #define FLX_IMPORT 50: #endif 51: 52: 53: #ifdef BUILD_RTL 54: #define RTL_EXTERN FLX_EXPORT 55: #else 56: #define RTL_EXTERN FLX_IMPORT 57: #endif 58: 59: #if defined(MACOSX) && !defined(HAVE_DLOPEN) 60: #define MACOSX_NODLCOMPAT 61: #endif 62: 63: #ifdef HAVE_GNU 64: #define FLX_ALWAYS_INLINE __attribute__ ((always_inline)) 65: #define FLX_NOINLINE __attribute__ ((noinline)) 66: #define FLX_CONST __attribute__ ((const)) 67: #define FLX_PURE __attribute__ ((pure)) 68: #define GXX_PARSER_HACK (void)0, 69: #define FLX_UNUSED __attribute__((unused)) 70: #else 71: #define FLX_ALWAYS_INLINE 72: #define FLX_NOINLINE 73: #define FLX_CONST 74: #define FLX_PURE 75: #define GXX_PARSER_HACK 76: #define FLX_UNUSED 77: #endif 78: #endif 79: 80: #line 776 "./lpsrc/flx_rtl.pak" 81: #define FLX_RAWADDRESS unsigned long 82: #define FLX_MAX_ALIGN 16 83: 84: 85: #endif 86:
4.1. Procedure Continuation Abstraction
4.2. Unix Dynamic linker
4.3. Universal Program Driver