Linuxpops  3.01.04
Spectral Anaysis Package for Single Dish Data
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
parse.c File Reference
#include "extern.h"

Go to the source code of this file.

Classes

struct  FIX_OPERATORS
 

Macros

#define INCLUDE_PARSE_FLAGS   1
 
#define DEFINE_COLORS_STRINGS   1
 
#define DVAR   1
 
#define GSVAR   2
 
#define LP_IF_TEST_FALSE   0
 
#define LP_IF_TEST_TRUE   1
 
#define LP_IF_TEST_NTRUE   2
 
#define LP_IF_STATE_IDLE   0
 
#define LP_IF_STATE_TRUE   1
 
#define LP_IF_STATE_FALSE   2
 
#define LP_IF_STATE_ELSE   3
 
#define VARIABLE_TYPE_NONE   0
 
#define VARIABLE_TYPE_DVAR   1
 
#define VARIABLE_TYPE_GSVAR   2
 
#define VARIABLE_TYPE_HEADER   3
 
#define VARIABLE_TYPE_PLANET   4
 
#define FORMAT_NORMAL   0
 
#define FORMAT_EXP   1
 
#define FORMAT_HEX   2
 
#define FIX_MATH_REPLACE   1
 
#define FIX_MATH_COMPRESS   2
 

Functions

int getSizeOfGS ()
 
int my_add_history (char *buf)
 
int setDFormat (char *buf)
 
int getNumericFlag ()
 
int getNset ()
 
int findAnyVariable (char *name, struct QUERY_VAR *qv)
 
int initParseArgs ()
 
int pushArgs ()
 
int popArgs ()
 
void subArgs (int wt, const char *fmt,...)
 
int compressReassembleTokens ()
 
int reassembleCommand (char *buf)
 
int parseFlags ()
 
int clearFlags ()
 
struct PARSE_FLAGS * findFirstFlag ()
 
int shiftFlags ()
 
int isSet (int flag)
 
int isFirst (int flag)
 
int notSet (int flag)
 
int setFlag (int flag, int state)
 
int showLetHelp ()
 
int listDynVars ()
 
int findGSVar (char *name)
 
int initDvars ()
 
int findVariable (char *var)
 
int clearVar ()
 
int clearAllVar ()
 
int makeDynVariable (char *var, int type)
 
int createInteger ()
 
int createDouble ()
 
int printVar ()
 
int isSpecial (char cp)
 
int fixMathOperators (char *buf)
 
int expandCmd (char *src, char *dst)
 
int evaluateRightSide (int k, int n, char *buf)
 
int doLetCmd (char *buf)
 
int removeAllSpaces (char *in, char *out)
 
int doCalculation (char *buf)
 
int get_tok (char *edit)
 
int get_cmd_tok (char *edit)
 
int bang (char *buf)
 
int isCommand (char *buf)
 
int recordThisCommand (char *buf)
 
int printAmbiguousCommand (char *arg, struct COMMANDS *cmds)
 
int parseCmd (char *buf)
 
void process_line (char *line)
 
int ctrl_a_list (int arg1, int arg2)
 
int ctrl_b_list (int arg1, int arg2)
 
int ctrl_t_list (int arg1, int arg2)
 
int ctrl_l_list (int arg1, int arg2)
 
int ctrl_p_list (int arg1, int arg2)
 
int ctrl_e_list (int arg1, int arg2)
 
int showShortCuts ()
 
int init_readline (void)
 
int setColor (int c)
 
int doColor ()
 
int findInArgs (char *parg)
 
int recordCmds ()
 
int showVariables ()
 
char * FilterChars (char *String, char *Filter)
 
int get_sv_tok (char *edit)
 
int substituteVariables (char *inbuf, char *outbuf)
 
int doIf ()
 
int doElse ()
 
int doEndIf ()
 
int doFor ()
 
int doEndFor ()
 
int doSexCmd ()
 

Variables

int lp_if_test_rst = LP_IF_TEST_FALSE
 
int lp_if_test_state = LP_IF_STATE_IDLE
 
char lp_if_else_buf [512]
 
int oldColor = BLACK
 
int recording = 0
 
int old_quiet = 0
 
int recursiveLevel = 0
 
int ivars_holders [MAX_DYN_VARS]
 
double dvars_holders [MAX_DYN_VARS]
 
struct DYNAMIC_VARIABLES dvars [MAX_DYN_VARS]
 
char myline [4096]
 
char recordingFname [256]
 
struct GSKEY getset []
 
char last_history [4096]
 
struct FIX_OPERATORS fixers []
 
int max_fix_operators = (sizeof(fixers) / sizeof(struct FIX_OPERATORS))
 
char sv_tok [40][40]
 

Macro Definition Documentation

#define DEFINE_COLORS_STRINGS   1

Definition at line 61 of file parse.c.

#define DVAR   1

Definition at line 65 of file parse.c.

#define FIX_MATH_COMPRESS   2

Definition at line 1427 of file parse.c.

#define FIX_MATH_REPLACE   1

Definition at line 1426 of file parse.c.

#define FORMAT_EXP   1

Definition at line 1118 of file parse.c.

#define FORMAT_HEX   2

Definition at line 1119 of file parse.c.

#define FORMAT_NORMAL   0

Definition at line 1117 of file parse.c.

#define GSVAR   2

Definition at line 66 of file parse.c.

#define INCLUDE_PARSE_FLAGS   1

Definition at line 59 of file parse.c.

#define LP_IF_STATE_ELSE   3

Definition at line 75 of file parse.c.

#define LP_IF_STATE_FALSE   2

Definition at line 74 of file parse.c.

#define LP_IF_STATE_IDLE   0

Definition at line 72 of file parse.c.

#define LP_IF_STATE_TRUE   1

Definition at line 73 of file parse.c.

#define LP_IF_TEST_FALSE   0

Definition at line 68 of file parse.c.

#define LP_IF_TEST_NTRUE   2

Definition at line 70 of file parse.c.

#define LP_IF_TEST_TRUE   1

Definition at line 69 of file parse.c.

#define VARIABLE_TYPE_DVAR   1

Definition at line 99 of file parse.c.

#define VARIABLE_TYPE_GSVAR   2

Definition at line 100 of file parse.c.

#define VARIABLE_TYPE_HEADER   3

Definition at line 101 of file parse.c.

#define VARIABLE_TYPE_NONE   0

Definition at line 98 of file parse.c.

#define VARIABLE_TYPE_PLANET   4

Definition at line 102 of file parse.c.

Function Documentation

int bang ( char *  buf)

Definition at line 1943 of file parse.c.

int clearAllVar ( void  )

Definition at line 1027 of file parse.c.

int clearFlags ( void  )

Definition at line 583 of file parse.c.

int clearVar ( void  )

Definition at line 1001 of file parse.c.

int compressReassembleTokens ( void  )

Definition at line 461 of file parse.c.

int createDouble ( void  )

Definition at line 1101 of file parse.c.

int createInteger ( void  )

Definition at line 1086 of file parse.c.

int ctrl_a_list ( int  arg1,
int  arg2 
)

Definition at line 2528 of file parse.c.

int ctrl_b_list ( int  arg1,
int  arg2 
)

Definition at line 2545 of file parse.c.

int ctrl_e_list ( int  arg1,
int  arg2 
)

Definition at line 2608 of file parse.c.

int ctrl_l_list ( int  arg1,
int  arg2 
)

Definition at line 2577 of file parse.c.

int ctrl_p_list ( int  arg1,
int  arg2 
)

Definition at line 2593 of file parse.c.

int ctrl_t_list ( int  arg1,
int  arg2 
)

Definition at line 2562 of file parse.c.

int doCalculation ( char *  buf)
Bug:
lcalc exits if there is a math error;
must set in place a math_err handler
Also, the command line args are not evaluated first.
lcalc doesn't know what to do with the command and exits.

Definition at line 1802 of file parse.c.

int doColor ( void  )

Definition at line 2672 of file parse.c.

int doElse ( void  )

Definition at line 3033 of file parse.c.

int doEndFor ( void  )

Definition at line 3092 of file parse.c.

int doEndIf ( void  )

Definition at line 3066 of file parse.c.

int doFor ( void  )

Definition at line 3084 of file parse.c.

int doIf ( void  )

Definition at line 2882 of file parse.c.

int doLetCmd ( char *  buf)
in the form:

let variable = expression
now can be called with just variable = expression
Bug:
Can not modify a header variable. If called with a header variable,
then system will create a dynamic variable with the same name.
Probably not what you want.
Need to change this behaviour

Definition at line 1600 of file parse.c.

int doSexCmd ( void  )

Definition at line 3100 of file parse.c.

int evaluateRightSide ( int  k,
int  n,
char *  buf 
)

Evaluate the right side of the equation by substituting know variables into string

Definition at line 1542 of file parse.c.

int expandCmd ( char *  src,
char *  dst 
)

Definition at line 1494 of file parse.c.

char* FilterChars ( char *  String,
char *  Filter 
)

Definition at line 2786 of file parse.c.

int findAnyVariable ( char *  name,
struct QUERY_VAR *  qv 
)

Definition at line 237 of file parse.c.

struct PARSE_FLAGS* findFirstFlag ( void  )

Definition at line 602 of file parse.c.

int findGSVar ( char *  name)

Definition at line 948 of file parse.c.

int findInArgs ( char *  parg)

Definition at line 2704 of file parse.c.

int findVariable ( char *  var)

Definition at line 984 of file parse.c.

int fixMathOperators ( char *  buf)

Definition at line 1447 of file parse.c.

int get_cmd_tok ( char *  edit)

Split multiple commands up in to seperate commands

Definition at line 1924 of file parse.c.

int get_sv_tok ( char *  edit)

Split single command up into tokens

Definition at line 2811 of file parse.c.

int get_tok ( char *  edit)

Split single command up into tokens

Definition at line 1902 of file parse.c.

int getNset ( void  )

Definition at line 214 of file parse.c.

int getNumericFlag ( void  )

Definition at line 196 of file parse.c.

int getSizeOfGS ( )
int init_readline ( void  )

Definition at line 2631 of file parse.c.

int initDvars ( void  )

Definition at line 967 of file parse.c.

int initParseArgs ( void  )

Definition at line 352 of file parse.c.

int isCommand ( char *  buf)

determine of passed token is a previously defined command

Definition at line 1981 of file parse.c.

int isFirst ( int  flag)

Definition at line 662 of file parse.c.

int isSet ( int  flag)

Definition at line 646 of file parse.c.

int isSpecial ( char  cp)

Definition at line 1414 of file parse.c.

int listDynVars ( void  )

Definition at line 728 of file parse.c.

int makeDynVariable ( char *  var,
int  type 
)

Definition at line 1049 of file parse.c.

int my_add_history ( char *  buf)

Definition at line 109 of file parse.c.

int notSet ( int  flag)

Definition at line 669 of file parse.c.

int parseCmd ( char *  buf)

Main parser

Definition at line 2090 of file parse.c.

int parseFlags ( void  )

Definition at line 497 of file parse.c.

int popArgs ( void  )

Definition at line 405 of file parse.c.

int printAmbiguousCommand ( char *  arg,
struct COMMANDS *  cmds 
)

Definition at line 2032 of file parse.c.

int printVar ( void  )

Definition at line 1121 of file parse.c.

void process_line ( char *  line)

Definition at line 2452 of file parse.c.

int pushArgs ( void  )

Definition at line 383 of file parse.c.

int reassembleCommand ( char *  buf)

Definition at line 480 of file parse.c.

int recordCmds ( void  )

Definition at line 2724 of file parse.c.

int recordThisCommand ( char *  buf)

Definition at line 2000 of file parse.c.

int removeAllSpaces ( char *  in,
char *  out 
)

Definition at line 1771 of file parse.c.

int setColor ( int  c)

Definition at line 2644 of file parse.c.

int setDFormat ( char *  buf)

Definition at line 135 of file parse.c.

int setFlag ( int  flag,
int  state 
)

Definition at line 685 of file parse.c.

int shiftFlags ( void  )

Definition at line 622 of file parse.c.

int showLetHelp ( void  )

Definition at line 701 of file parse.c.

int showShortCuts ( void  )

Definition at line 2623 of file parse.c.

int showVariables ( void  )

Definition at line 2777 of file parse.c.

void subArgs ( int  wt,
const char *  fmt,
  ... 
)

Definition at line 430 of file parse.c.

int substituteVariables ( char *  inbuf,
char *  outbuf 
)

Definition at line 2831 of file parse.c.

Variable Documentation

Definition at line 89 of file parse.c.

double dvars_holders[MAX_DYN_VARS]

Definition at line 88 of file parse.c.

struct FIX_OPERATORS fixers[]
Initial value:
= {
{ "< =", "<= " },
{ "> =", ">= " },
{ "! =", "!= " },
{ "= =", "== " },
}

Definition at line 1434 of file parse.c.

struct GSKEY getset[]
int ivars_holders[MAX_DYN_VARS]

Definition at line 87 of file parse.c.

char last_history[4096]

Definition at line 105 of file parse.c.

char lp_if_else_buf[512]

Definition at line 80 of file parse.c.

int lp_if_test_rst = LP_IF_TEST_FALSE

Definition at line 77 of file parse.c.

int lp_if_test_state = LP_IF_STATE_IDLE

Definition at line 78 of file parse.c.

int max_fix_operators = (sizeof(fixers) / sizeof(struct FIX_OPERATORS))

Definition at line 1441 of file parse.c.

char myline[4096]

Definition at line 91 of file parse.c.

int old_quiet = 0

Definition at line 84 of file parse.c.

int oldColor = BLACK

Definition at line 82 of file parse.c.

int recording = 0

Definition at line 83 of file parse.c.

char recordingFname[256]

Definition at line 92 of file parse.c.

int recursiveLevel = 0

Definition at line 85 of file parse.c.

char sv_tok[40][40]

Definition at line 2805 of file parse.c.