Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Commits on Feb 22, 2015
  1. Merge pull request #30 from ryanpcmcquen/patch-1

    authored
    Remove trailing slash from INSTALL_PREFIX
Commits on Feb 21, 2015
  1. Ryan P.C. McQuen

    Remove trailing slash from INSTALL_PREFIX

    ryanpcmcquen authored
    Otherwise '//' occurs.
Commits on Oct 15, 2014
  1. Merge pull request #29 from tekknolagi/master

    authored
    no need for gotos...
Commits on Aug 1, 2014
  1. Max Bernstein

    no need for gotos...

    tekknolagi authored
Commits on Jun 8, 2014
  1. Changed default CC to Clang

    authored
    Modified source to allow for compiling with both GCC and Clang
  2. Added item to TODO

    authored
Commits on Mar 24, 2014
Commits on Jan 19, 2014
  1. Gabriel Cormier-Affleck

    Merge pull request #28 from PaytonTurnage/master

    bl0ckeduser authored
    Modify htab to have generic function names, and find to be nonredundant.
Commits on Jan 15, 2014
  1. Payton Turnage

    Fix bug where an outdate node is returned.

    PaytonTurnage authored
    If htab_add_core added a node that happened to push the htab past its load
    factor, it would return a pointer to where the added node was *before* the
    rehash. Now it does not do this.
  2. Payton Turnage
  3. Payton Turnage

    Rename htab functions; rewrite find to be generic.

    PaytonTurnage authored
    The htab functions find_str and add_str have been renamed to include _ref in
    the places they previously noted _str. These are intended to manage an htab
    containing references to any data; string or not.
    
    The htab_find function has been divided up. htab_find_core now handles actually
    finding the correct node. htab_find and htab_find_ref are just outward facing
    functions for retrieving a specific kind of data from the node, depending on
    what the htab is used for.
Commits on Jan 14, 2014
  1. Merge pull request #27 from PaytonTurnage/master

    authored
    Implementation for Preprocessor Defines
  2. Payton Turnage

    Remove assumption that node is in the bottom of the bucket.

    PaytonTurnage authored
    This is the last remaining instance of this assumption.
Commits on Jan 13, 2014
  1. Payton Turnage

    Do not write a value for strings in htab.

    PaytonTurnage authored
    The assignment is unnecessary, and was overwriting the first element in the bucket (not the added string's value) in the case of a collision.
  2. Payton Turnage

    Add a new function to return strings from htab.

    PaytonTurnage authored
    The htab_find_str function eliminates the assumption that the string
    is in the first place in the bucket.
  3. Payton Turnage
  4. Payton Turnage

    Add preprocessor directives to the SYNTAX file.

    PaytonTurnage authored
    The preprocessor section of the SYNTAX file has been rewritten to match
    the other sections in style, and include both %include and %define
    directives. #27
  5. Payton Turnage

    Implement defines using the htab structure.

    PaytonTurnage authored
    The htab_structure has been modified in two ways, which should not break
    compatability with any of its uses.
    
    It includes a void pointer, which is in this commit used to point to a
    string for defines, and will in the future be used to point to the address
    space for words, bytes, and double words.
    
    It now includes a function htab_add_str specifically for storing strings.
    It calls htab_add so as not to be redundant, but makes the node's value
    their index for the lexer to fetch using htab_find, and assigns their
    void pointer.
    
    The lexer will now use htab_find on all tokens to see if they are a define
    string, and if so, substitute them with the appropriate token.
    
    The defines htab is destroyed after lexing, because that memory is done.
  6. Payton Turnage

    Remove all traces of the tvm_tree structure.

    PaytonTurnage authored
    It is to be replaced with a htab hash table.
  7. Payton Turnage

    Allow the preprocessor to abort.

    PaytonTurnage authored
    If the preprocessor encounters a problem, such as failing to load a source
    file or an improperly formatted define, it should be able to abort running
    the program.
  8. Payton Turnage

    Warn on redefining.

    PaytonTurnage authored
  9. Payton Turnage

    Free the defines memory earlier.

    PaytonTurnage authored
    There is no need to keep this memory for the life of the program.
  10. Payton Turnage

    Substitute defines with their strings.

    PaytonTurnage authored
    Before allocating space for a token, the lexer will first check to see
    if that token is a defined name. If it is, it will allocate space for
    the defined string instead.
    
    A test file is included in programs/tinyvm/preprocessor to demonstrate
    the behavior. When functioning, the program will print the fibonacci
    sequence.
  11. Payton Turnage

    Implement preprocessor defines.

    PaytonTurnage authored
    This commit adds behavior to the preprocessor which fills a tree with
    defines and their replacements. In future commits, the parser will
    substitute instances of the defines with their replacements in the
    source code.
  12. Payton Turnage

    Fix naming conflict.

    PaytonTurnage authored
  13. Payton Turnage

    Enable keeping track of associated values.

    PaytonTurnage authored
    The tvm_tree structure should optionally be able to keep track of values
    associated with the strings by which its nodes are sorted. In the case of
    defines, this is the replacement string. In the case of variables, this
    will be a pointer to the variable's location in memory.
    
    Searching should return the value, or NULL.
    
    To opt out of storing a value, pass NULL and 0 as the val and len arguments.
  14. Payton Turnage

    Add a structure for searching strings.

    PaytonTurnage authored
    The tvm_tree structure is a binary search tree. It will be used to hold
    preprocessor defines, and variable names for when defining bytes, words,
    and double words is implemented.
    
    Each node structure and its own string are stored contiguously (in that
    order) so the free's are easier to keep track of, and memory doesn't need to
    be a concern when adding a string to the tree.
Commits on Jan 11, 2014
  1. Modified TODO

    authored
  2. Added TODO

    authored
Commits on Aug 12, 2013
  1. Gabriel Cormier-Affleck

    Simplify a structure copy

    bl0ckeduser authored
  2. Gabriel Cormier-Affleck

    Fix incorrect truncation of floating-point data

    bl0ckeduser authored
    If the entire parenthesized division expression is cast to float, as it
    was prior to this commit, C performs truncating integer division before
    converting to float, which always leads to a result of zero.  `git-blame'
    traces the bug to commit d5ed7e7, which
    added the faulty parentheses as a matter of style. No parentheses are
    necessary, since increments have higher precedence than type-casts,
    type-casts have higher precedence than division, and division has
    higher precedence than comparison. The operations will execute in the
    desired order.
Commits on Mar 14, 2013
Commits on Mar 7, 2013
  1. Fixed filename typo

    authored
Something went wrong with that request. Please try again.