s502 assembler
A very simple assembler for the 6502 line of processors written in C
Data Structures | Enumerations
map.h File Reference

Map class. More...

Go to the source code of this file.

Data Structures

struct  MapEntry
 One entry in a map. More...
 
class  Map
 Simple key->value map (str->int) More...
 

Enumerations

enum  {
  OPC_INVALID = 0xff, MAP_MAX_KEY_LEN = 32, NUMBER_ERROR = -1, NUMBER_LABEL_NODEF = -2,
  STATE_MAX_STRING_LEN = 32, TOKEN_BUFFER_SIZE = 100, TOKEN_SOURCE_FILE_SIZE = 32
}
 

Detailed Description

Map class.

Map class to store key-value pairs
Used for constants and labels

Definition in file map.h.


Data Structure Documentation

◆ MapEntry

struct MapEntry

One entry in a map.

Definition at line 18 of file map.h.

Data Fields
char name[MAP_MAX_KEY_LEN] key of the entry
struct MapEntry * next pointer to the next entry or NULL
int value the value the entry holds

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
OPC_INVALID 

An invalid opcode to signal invalid / non-existent variations.

MAP_MAX_KEY_LEN 

Key buffer size for Map.

NUMBER_ERROR 

Could not parse a number or constant is undefined.

NUMBER_LABEL_NODEF 

Undefined label.

STATE_MAX_STRING_LEN 

max string length for input/output files

TOKEN_BUFFER_SIZE 

Token max length.

TOKEN_SOURCE_FILE_SIZE 

source filename max length. Longer strings will get truncated.

Definition at line 12 of file map.h.

12  {
14  MAP_MAX_KEY_LEN = 32
15 };
MAP_MAX_KEY_LEN
@ MAP_MAX_KEY_LEN
Key buffer size for Map.
Definition: map.h:14