Motr  M0
lex.c File Reference
#include <string.h>
#include <stdbool.h>
#include <stdio.h>
#include <errno.h>
#include <assert.h>
#include <err.h>
#include "xcode/ff2c/lex.h"
Include dependency graph for lex.c:

Go to the source code of this file.

Data Structures

struct  keyword
 

Macros

#define SAFE(ctx, cond)   ((ctx)->fc_remain > 0 && (cond))
 

Functions

static void ctx_move (struct ff2c_context *ctx, size_t nob)
 
static void ctx_step (struct ff2c_context *ctx)
 
static bool at (struct ff2c_context *ctx, char c)
 
static bool at_string (struct ff2c_context *ctx, const char *s, size_t n)
 
static bool is_start (char c)
 
static bool is_middle (char c)
 
static void tok_end (struct ff2c_context *ctx, struct ff2c_token *tok)
 
static void skip_space (struct ff2c_context *ctx)
 
static bool get_literal (struct ff2c_context *ctx, struct ff2c_token *tok)
 
int ff2c_token_get (struct ff2c_context *ctx, struct ff2c_token *tok)
 
void ff2c_token_put (struct ff2c_context *ctx, struct ff2c_token *tok)
 
void ff2c_context_init (struct ff2c_context *ctx, const char *buf, size_t size)
 
void ff2c_context_fini (struct ff2c_context *ctx)
 
int ff2c_context_loc (struct ff2c_context *ctx, int nr, char *buf)
 

Variables

static const struct keyword keywords []
 
const char * ff2c_token_type_name []