ARPDAS_QNX6 1.0
|
#include <malloc.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "nortlib.h"
#include "tma.h"
#include "cmdalgo.h"
Go to the source code of this file.
Classes | |
struct | command_st |
Defines | |
#define | TK_NUMBER 256 |
#define | TK_TMCCMD 257 |
#define | TK_QSTR 258 |
#define | KW_VALIDATE 259 |
#define | TK_NAME 260 |
#define | TK_EOF 261 |
#define | TK_ERR 262 |
#define | KW_AND 263 |
#define | KW_OR 264 |
#define | KW_HOLD 265 |
#define | KW_ELSE 266 |
#define | KW_RESUME 267 |
#define | BEGIN_BUFFER lexbufpos = 0 |
#define | BUFFER_CHAR(c) if ( buffer_char( c ) ) return TK_ERR |
#define | END_BUFFER BUFFER_CHAR(0) |
Typedefs | |
typedef struct command_st | command_t |
Functions | |
static void | synt_err (char *txt) |
static int | buffer_char (char c) |
static void | yyunlex (int token) |
static int | yylex (FILE *fp) |
static int | tma_strdup (command_t **ptr, const char *str, command_t *next) |
static slurp_val * | find_slurp (const char *statename) |
static int | read_a_cmd (FILE *fp, command_t **cmdl, const char *mycase) |
static int | read_a_tcmd (FILE *fp, const char *mycase, long int *dtp, command_t **cmdl) |
static void | free_tmacmds (tma_ifile *spec) |
static int | read_tmafile (tma_ifile *spec, FILE *fp) |
void | tma_read_file (tma_ifile *ifilespec) |
Variables | |
char | rcsid_tma_file_c [] = "$Header: /cvsroot/arp-das/QNX6/tmlib/src/tma_file.c,v 1.2 2009/11/18 20:46:18 ntallen Exp $" |
static const char * | yy_filename |
static int | yy_lineno |
static char * | yy_text |
static long int | yy_val |
static int | lexbufsize |
static int | lexbufpos |
static int | yyunlexed = 0 |
static long int | last_time |
#define BEGIN_BUFFER lexbufpos = 0 |
Definition at line 53 of file tma_file.c.
Referenced by yylex().
#define BUFFER_CHAR | ( | c | ) | if ( buffer_char( c ) ) return TK_ERR |
Definition at line 54 of file tma_file.c.
Referenced by yylex().
#define END_BUFFER BUFFER_CHAR(0) |
Definition at line 55 of file tma_file.c.
Referenced by yylex().
#define KW_AND 263 |
Definition at line 30 of file tma_file.c.
Referenced by read_a_cmd(), and yylex().
#define KW_ELSE 266 |
Definition at line 33 of file tma_file.c.
Referenced by read_a_cmd(), and yylex().
#define KW_HOLD 265 |
Definition at line 32 of file tma_file.c.
Referenced by read_a_cmd(), and yylex().
#define KW_OR 264 |
Definition at line 31 of file tma_file.c.
Referenced by read_a_cmd(), and yylex().
#define KW_RESUME 267 |
Definition at line 34 of file tma_file.c.
Referenced by read_a_cmd(), and yylex().
#define KW_VALIDATE 259 |
Definition at line 26 of file tma_file.c.
Referenced by read_a_cmd(), and yylex().
#define TK_EOF 261 |
Definition at line 28 of file tma_file.c.
Referenced by read_a_tcmd(), and yylex().
#define TK_ERR 262 |
Definition at line 29 of file tma_file.c.
Referenced by yylex().
#define TK_NAME 260 |
Definition at line 27 of file tma_file.c.
Referenced by read_a_cmd(), and yylex().
#define TK_NUMBER 256 |
Definition at line 23 of file tma_file.c.
Referenced by read_a_cmd(), read_a_tcmd(), and yylex().
#define TK_QSTR 258 |
Definition at line 25 of file tma_file.c.
Referenced by read_a_cmd(), and yylex().
#define TK_TMCCMD 257 |
Definition at line 24 of file tma_file.c.
Referenced by read_a_cmd(), and yylex().
typedef struct command_st command_t |
static int buffer_char | ( | char | c | ) | [static] |
Definition at line 39 of file tma_file.c.
References lexbufpos, lexbufsize, synt_err(), and yy_text.
static slurp_val* find_slurp | ( | const char * | statename | ) | [static] |
Definition at line 197 of file tma_file.c.
References slurp_vals, and slurp_val::state.
Referenced by read_a_cmd(), and read_tmafile().
static void free_tmacmds | ( | tma_ifile * | spec | ) | [static] |
Definition at line 391 of file tma_file.c.
References assert, tma_state::cmd, command_st::cmd, and tma_ifile::cmds.
Referenced by read_tmafile(), and tma_read_file().
static int read_a_cmd | ( | FILE * | fp, |
command_t ** | cmdl, | ||
const char * | mycase | ||
) | [static] |
Definition at line 230 of file tma_file.c.
References ci_sendcmd(), CMDREP_SYNERR, slurp_val::cmdstr, find_slurp(), KW_AND, KW_ELSE, KW_HOLD, KW_OR, KW_RESUME, KW_VALIDATE, command_st::next, set_response(), synt_err(), TK_NAME, TK_NUMBER, TK_QSTR, TK_TMCCMD, tma_strdup(), yy_text, yy_val, and yylex().
Referenced by read_a_tcmd().
static int read_a_tcmd | ( | FILE * | fp, |
const char * | mycase, | ||
long int * | dtp, | ||
command_t ** | cmdl | ||
) | [static] |
Definition at line 347 of file tma_file.c.
References last_time, read_a_cmd(), synt_err(), TK_EOF, TK_NUMBER, yy_val, yylex(), and yyunlex().
Referenced by read_tmafile().
static int read_tmafile | ( | tma_ifile * | spec, |
FILE * | fp | ||
) | [static] |
Definition at line 406 of file tma_file.c.
References command_st::cmd, tma_state::cmd, tma_ifile::cmds, slurp_val::cmdstr, tma_state::dt, tma_ifile::filename, find_slurp(), free_tmacmds(), last_time, command_st::next, nl_error, read_a_tcmd(), tma_ifile::statename, yy_filename, and yy_lineno.
Referenced by tma_read_file().
static void synt_err | ( | char * | txt | ) | [static] |
Definition at line 19 of file tma_file.c.
References nl_error, yy_filename, and yy_lineno.
Referenced by buffer_char(), read_a_cmd(), read_a_tcmd(), tma_strdup(), and yylex().
void tma_read_file | ( | tma_ifile * | ifilespec | ) |
Definition at line 464 of file tma_file.c.
References assert, tma_ifile::cmds, tma_ifile::def_cmds, tma_ifile::filename, free_tmacmds(), tma_ifile::modtime, nl_error, tma_ifile::partno, read_tmafile(), tma_ifile::statename, and tma_init_state().
Definition at line 175 of file tma_file.c.
References command_st::cmd, command_st::next, and synt_err().
Referenced by read_a_cmd().
static int yylex | ( | FILE * | fp | ) | [static] |
Definition at line 78 of file tma_file.c.
References BEGIN_BUFFER, BUFFER_CHAR, END_BUFFER, KW_AND, KW_ELSE, KW_HOLD, KW_OR, KW_RESUME, KW_VALIDATE, synt_err(), TK_EOF, TK_ERR, TK_NAME, TK_NUMBER, TK_QSTR, TK_TMCCMD, yy_lineno, yy_text, yy_val, and yyunlexed.
static void yyunlex | ( | int | token | ) | [static] |
Definition at line 72 of file tma_file.c.
References nl_error, and yyunlexed.
Referenced by read_a_tcmd().
long int last_time [static] |
Definition at line 208 of file tma_file.c.
Referenced by read_a_tcmd(), and read_tmafile().
int lexbufpos [static] |
Definition at line 37 of file tma_file.c.
Referenced by buffer_char().
int lexbufsize [static] |
Definition at line 36 of file tma_file.c.
Referenced by buffer_char().
char rcsid_tma_file_c[] = "$Header: /cvsroot/arp-das/QNX6/tmlib/src/tma_file.c,v 1.2 2009/11/18 20:46:18 ntallen Exp $" |
Definition at line 11 of file tma_file.c.
const char* yy_filename [static] |
Definition at line 14 of file tma_file.c.
Referenced by read_tmafile(), and synt_err().
int yy_lineno [static] |
Definition at line 15 of file tma_file.c.
Referenced by read_tmafile(), synt_err(), and yylex().
char* yy_text [static] |
Definition at line 16 of file tma_file.c.
Referenced by buffer_char(), read_a_cmd(), and yylex().
long int yy_val [static] |
Definition at line 17 of file tma_file.c.
Referenced by read_a_cmd(), read_a_tcmd(), and yylex().
int yyunlexed = 0 [static] |
Definition at line 71 of file tma_file.c.