Module: dylan-user Author: Toby Weinberg Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc. All rights reserved. License: Functional Objects Library Public License Version 1.0 Dual-license: GNU Lesser General Public License Warranty: Distributed WITHOUT WARRANTY OF ANY KIND define library c-lexer use functional-dylan; use collections; use io; use system; use t-lists; use generic-arithmetic; use big-integers; export c-lexer-utilities; export c-lexer; export cpp; export c-lexer-test-interface; end library; // Test Interface module -- exports internal stuff for unit testing define module c-lexer-test-interface create test-pre-lexer; create test-lexer; create test-ansi-cpp-evaluator; // create test-cpp-unlex; create with-emulator, with-dfmc; // export them so the compiler will shut-up end module; define module c-lexer-utilities create print-separated-sequence, print-comma-separated-sequence; create source-name; // , current-token removed this // only needed for debugging I think end module; define module c-lexer-utilities-internal use functional-dylan, exclude: {, clex-digit?}; use streams; use standard-io; use print; use format; use format-out; use t-lists; // re-export stuff from 'c-lexer-utilities' module use c-lexer-utilities, export: all; end module; // Lexer interface module define module C-lexer use streams, export: {read-element, unread-element, inner-stream-setter, read-to-end}; create , , , , , , read-to-end-of-inner-stream, read-include-filename, current-line, lex-from-string, ; create // functions on tokens lexer-string, lexer-string-setter, source-line, source-line-setter, parser-tag, dylan-value, copy-token, copy-token-list, quoted-string, constant-value, precedence, associativity, internal-lexer-string-value, internal-lexer-string-value-setter; create // token classes , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , <__unaligned>, , <__cdecl>, <_cdecl>, <__stdcall>, <_inline>, <__inline>, <__fastcall>, , <__asm>, <__based>, , , <__declspec>, , , , , , , , , <__int8>, <__int16>, <__int32>, <__int64>, , , , , , , , , , , , , <__unaligned>, , , , , , , , , , , , , , , , , , , , , ; create $eoi-token; // These should move to c-lexer utilities as should all of the stuff in // characters.dylan. create $largest-identifier-char, $smallest-identifier-char, $identifier-char-range, $identifier-char-range-squared, clex-digit?, clex-alpha-not-underscore?, clex-alphanumeric-not-underscore?, clex-integer-to-string; end module; define module C-lexer-internal use functional-dylan; // exclude: {, close, clex-digit?} use streams, export: {read-element, unread-element}; use standard-io; use print; use format; use format-out; use t-lists; use generic-arithmetic, prefix: "stupid-"; use c-lexer-utilities; use C-lexer, export: all; use c-lexer-test-interface; use C-lexer; end module C-lexer-internal; // cpp interface define module cpp use streams, export: {read-element, unread-element}; create , // probably should be in c-lexer-utilities module , macro-definitions, inner-stream-stack, skip-stack, *cpp-include-path*, add-cpp-include-path!, cpp-handle-pragma, cpp-handle-include-entry, cpp-handle-include-exit, , , , , pragma-body, pragma-body-setter; end module cpp; define module cpp-internal use functional-dylan, exclude: {}; use table-extensions, exclude: { table }; use streams, export: {read-element, unread-element}; use standard-io; use locators; use file-system; use print; use format; use format-out; use t-lists; use c-lexer-utilities; use cpp, export: {}; use C-lexer; use c-lexer-test-interface; end module cpp-internal;