Sunday, August 31, 2008

Sunday Development Log

Sunday:
  1. Neat: http://www.google.com/codesearch
  2. SymbolStorage maps Word Tokens to Identifiers.
  3. Flex maps strings to Word Tokens.
  4. Bison parses Word Tokens using a LALR engine.
  5. A way to convert "a_class.ToString().c_str()" to "a_class.ToString()" for use in sprintf()--statically allocate a fixed character buffer within ToString() and return a pointer to it. No memory management, no extra class member variables, no repeat allocation. The only catch--this technique only works for predictable string lengths. For example, sprintf()'ing an integer into a string--2^64 fits into a null-terminated string of 21 bytes.

    Unrestricted string lengths necessitate dynamic memory allocation.

    Google prohibits C++ streams (except for logging), which seems to rule out std::string--I haven't seen or thought of a way other than std::ostringstream.

No comments:

Post a Comment