fixed bugs in lda and changed awk for lda over tab.

- added ase_lda_rwalk
 - fixed crash when the keeper is not set
 - modified the awk parser to utilize lda.
This commit is contained in:
2008-10-12 08:10:25 +00:00
parent 7a05ceea75
commit 204f833d16
4 changed files with 160 additions and 63 deletions

View File

@ -19,8 +19,16 @@
******
*/
typedef struct ase_lda_t ase_lda_t;
enum ase_lda_walk_t
{
ASE_LDA_WALK_STOP = 0,
ASE_LDA_WALK_FORWARD = 1,
ASE_LDA_WALK_BACKWARD = 2
};
typedef struct ase_lda_t ase_lda_t;
typedef struct ase_lda_node_t ase_lda_node_t;
typedef enum ase_lda_walk_t ase_lda_walk_t;
#define ASE_LDA_COPIER_SIMPLE ase_lda_copysimple
#define ASE_LDA_COPIER_INLINE ase_lda_copyinline
@ -143,6 +151,11 @@ typedef ase_size_t (*ase_lda_sizer_t) (
);
/******/
typedef ase_lda_walk_t (*ase_lda_walker_t) (
ase_lda_t* lda /* a linear dynamic array */,
ase_size_t index /* the index to the visited node */,
void* arg /* user-defined data */
);
/****s* ase.cmn.lda/ase_lda_t
* NAME
@ -336,6 +349,15 @@ void ase_lda_setfreeer (
);
/******/
ase_lda_keeper_t ase_lda_getkeeper (
ase_lda_t* lda
);
void ase_lda_setkeeper (
ase_lda_t* lda,
ase_lda_keeper_t keeper
);
ase_lda_sizer_t ase_lda_getsizer (
ase_lda_t* lda
);
@ -435,6 +457,19 @@ void ase_lda_clear (
ase_lda_t* lda
);
void ase_lda_walk (
ase_lda_t* lda,
ase_lda_walker_t walker,
void* arg
);
void ase_lda_rwalk (
ase_lda_t* lda,
ase_lda_walker_t walker,
void* arg
);
void* ase_lda_copysimple (
ase_lda_t* lda /* a linear dynamic array */,
void* data /* the pointer to data */,

View File

@ -26,9 +26,9 @@ enum ase_sll_walk_t
};
/******/
typedef struct ase_sll_t ase_sll_t;
typedef struct ase_sll_t ase_sll_t;
typedef struct ase_sll_node_t ase_sll_node_t;
typedef enum ase_sll_walk_t ase_sll_walk_t;
typedef enum ase_sll_walk_t ase_sll_walk_t;
/****b* ase.cmn.sll/ase_sll_copier_t
* NAME