YACASL2
Loading...
Searching...
No Matches
label.c File Reference
#include "assemble.h"
Include dependency graph for label.c:

Go to the source code of this file.

Functions

HKEYlabel_hashkey (const char *value)
 ラベルのハッシュ値をセットしたキーを返す
unsigned labelhash (const char *prog, const char *label)
 プログラム名とラベルに対応するハッシュ値を返す
int compare_adr (const void *a, const void *b)
 ラベルを比較した結果を返す。qsort内で使われる関数
void printlabel_full (bool literal)
 定義されているラベルまたはリテラルの一覧を表示する
void addcerrlist_label ()
 ラベルのエラーをエラーリストに追加する
WORD getlabel (const char *prog, const char *label)
 プログラム名とラベルに対応するアドレスをラベル表から検索する
bool addlabel (const char *prog, const char *label, WORD adr)
 プログラム名、ラベル、アドレスをラベル表に追加する
void printlabel ()
 ラベル表を表示する
void printliteral ()
 リテラルを表示する
void freelabel ()
 ラベル表を解放する

Variables

static int labelcnt = 0
 ラベル数
static LABELTABlabels [LABELTABSIZE]
 ラベル表
static CERR cerr_label []
 ラベルのエラー

Function Documentation

◆ addcerrlist_label()

void addcerrlist_label ( )

ラベルのエラーをエラーリストに追加する

Definition at line 122 of file label.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addlabel()

bool addlabel ( const char * prog,
const char * label,
WORD adr )

プログラム名、ラベル、アドレスをラベル表に追加する

Returns
追加に成功した時はtrue、失敗した時はfalse
Parameters
*progプログラム名
*labelラベル
adrアドレス

Definition at line 144 of file label.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compare_adr()

int compare_adr ( const void * a,
const void * b )

ラベルを比較した結果を返す。qsort内で使われる関数

Returns
ラベルが同一の場合は0、異なる場合は0以外
Parameters
*aラベルa
*bラベルb

Definition at line 85 of file label.c.

Here is the caller graph for this function:

◆ freelabel()

void freelabel ( )

ラベル表を解放する

Definition at line 183 of file label.c.

Here is the caller graph for this function:

◆ getlabel()

WORD getlabel ( const char * prog,
const char * label )

プログラム名とラベルに対応するアドレスをラベル表から検索する

Returns
プログラム名とラベルに対応するアドレス
Parameters
*progプログラム名
*labelラベル

Definition at line 127 of file label.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ label_hashkey()

HKEY * label_hashkey ( const char * value)

ラベルのハッシュ値をセットしたキーを返す

Returns
ハッシュ値をセットしたキー
Parameters
value

Definition at line 58 of file label.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ labelhash()

unsigned labelhash ( const char * prog,
const char * label )

プログラム名とラベルに対応するハッシュ値を返す

Returns
ハッシュ値
Parameters
progプログラム名
labelラベル

Definition at line 67 of file label.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printlabel()

void printlabel ( )

ラベル表を表示する

Definition at line 173 of file label.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printlabel_full()

void printlabel_full ( bool literal)

定義されているラベルまたはリテラルの一覧を表示する

Parameters
literalリテラルの場合はtrue、それ以外はfalse

Definition at line 90 of file label.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printliteral()

void printliteral ( )

リテラルを表示する

Definition at line 178 of file label.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ cerr_label

CERR cerr_label[]
static
Initial value:
= {
{ 101, "label already defined" },
{ 102, "label table is full" },
{ 103, "label not found" },
}

ラベルのエラー

Definition at line 52 of file label.c.

◆ labelcnt

int labelcnt = 0
static

ラベル数

Definition at line 42 of file label.c.

◆ labels

LABELTAB* labels[LABELTABSIZE]
static

ラベル表

Definition at line 47 of file label.c.