Skip to content

bfbechlin/simple_compiler

Folders and files

NameName
Last commit message
Last commit date
Jun 15, 2017
Apr 22, 2017
Jun 15, 2017
Jun 4, 2017
Jun 15, 2017
Jun 15, 2017
May 11, 2017
May 11, 2017
Jun 15, 2017
May 17, 2017
Jun 5, 2017
Jun 15, 2017
Jun 15, 2017
Jun 8, 2017
Jun 8, 2017

Repository files navigation

simple_compiler

Files and their constants

astree.h

  • AST_*: the AST node type.

symtab.h

  • SYMBOL_*: the symbol type in the symbol table (identifier, integer literal, real literal, character literal, string literal)
  • ID_*: the "nature" of the identifier (variable, vector, function)
  • TP_*: the data type of the identifier (byte, short, long, float, double)

Hashmap structure

struct hashmap

  • size: how many buckets
  • used: how many items
  • load_factor: maximum used/size ratio before resizing
  • value_size: size of the value stored in items
  • buckets: array of pointers to items
+---------------+
| buckets       |             +--------+            +--------+
+---------------+   zoom      |  item  |            |  item  |
| item_address +----------->  +--------+     +--->  +--------+
| NULL          |             |  ...   |     |      |  ...   |
| item_address  |             |        |     |      |        |
| item_address  |             |        |     |      |        |
| NULL          |             |  next +------+      |  NULL  |
| ...           |             |        |            |        |
+---------------+             +--------+            +--------+

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published