omi-eikyo/src/m_tokbuf.h

40 lines
919 B
C

// Copyright © 2017 Project Golan, all rights reserved.
#ifndef m_tokbuf_h
#define m_tokbuf_h
#include "m_token.h"
// Extern Functions ----------------------------------------------------------|
M_token *M_TokBuf_Get(struct M_tkbuf *tb);
M_token *M_TokBuf_UnGet(struct M_tkbuf *tb);
M_token *M_TokBuf_ReGet(struct M_tkbuf *tb);
bool M_TokBuf_Drop(struct M_tkbuf *tb, M_tokty t);
// Types ---------------------------------------------------------------------|
enum M_tkprc
{
tokproc_next,
tokproc_done,
tokproc_skip
};
typedef struct M_tkbuf
{
__prop get {call: M_TokBuf_Get (this)}
__prop unget {call: M_TokBuf_UnGet(this)}
__prop reget {call: M_TokBuf_ReGet(this)}
__prop drop {call: M_TokBuf_Drop (this)}
FILE *fp;
M_token *toks;
int tpos, tend;
int bbeg, bend;
void *udata;
enum M_tkprc (*tokProcess)(M_token *tok, void *udata);
} M_tkbuf;
#endif