Main Page | Data Structures | File List | Data Fields | Globals

cmdparse.c File Reference


Detailed Description

Author:
Hal Finkel
The command line parser

#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "commands.h"
#include "common.h"

Include dependency graph for cmdparse.c:

Include dependency graph

Data Structures

union  YYSTYPE
union  yyalloc

Defines

#define YYBISON   1
#define YYSKELETON_NAME   "yacc.c"
#define YYPURE   0
#define YYLSP_NEEDED   0
#define QUIT   258
#define PLOT   259
#define PRINT   260
#define DATA   261
#define NORM   262
#define SMOOTH   263
#define LOAD   264
#define TO   265
#define RESCALE   266
#define MARKED   267
#define PEAKS   268
#define PEAK   269
#define ANNOTATE   270
#define DRIVER   271
#define ROTATED   272
#define SORTED   273
#define BY   274
#define NUMBER   275
#define HEIGHT   276
#define AREA   277
#define CALIBRATE   278
#define USING   279
#define CLEAR   280
#define CALIBRATION   281
#define CALIBRATED   282
#define CHANNEL   283
#define STRING   284
#define NUM   285
#define YYDEBUG   0
#define YYERROR_VERBOSE   0
#define yystype   YYSTYPE
#define YYSTYPE_IS_DECLARED   1
#define YYSTYPE_IS_TRIVIAL   1
#define YYFREE   free
#define YYMALLOC   malloc
#define YYSTACK_ALLOC   YYMALLOC
#define YYSTACK_FREE   YYFREE
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
#define YYSTACK_BYTES(N)
#define YYCOPY(To, From, Count)
#define YYSTACK_RELOCATE(Stack)
#define YYFINAL   23
#define YYLAST   55
#define YYNTOKENS   31
#define YYNNTS   27
#define YYNRULES   55
#define YYNSTATES   77
#define YYUNDEFTOK   2
#define YYMAXUTOK   285
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
#define YYPACT_NINF   -25
#define YYTABLE_NINF   -1
#define YYSIZE_T   unsigned int
#define yyerrok   (yyerrstatus = 0)
#define yyclearin   (yychar = YYEMPTY)
#define YYEMPTY   (-2)
#define YYEOF   0
#define YYACCEPT   goto yyacceptlab
#define YYABORT   goto yyabortlab
#define YYERROR   goto yyerrorlab
#define YYFAIL   goto yyerrlab
#define YYRECOVERING()   (!!yyerrstatus)
#define YYBACKUP(Token, Value)
#define YYTERROR   1
#define YYERRCODE   256
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YYLEX   yylex ()
#define YYDPRINTF(Args)
#define YYDSYMPRINT(Args)
#define YYDSYMPRINTF(Title, Token, Value, Location)
#define YY_STACK_PRINT(Bottom, Top)
#define YY_REDUCE_PRINT(Rule)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYPOPSTACK   (yyvsp--, yyssp--)

Typedefs

typedef YYSTYPE YYSTYPE
typedef short int yysigned_char

Enumerations

enum  yytokentype {
  QUIT = 258, PLOT = 259, PRINT = 260, DATA = 261,
  NORM = 262, SMOOTH = 263, LOAD = 264, TO = 265,
  RESCALE = 266, MARKED = 267, PEAKS = 268, PEAK = 269,
  ANNOTATE = 270, DRIVER = 271, ROTATED = 272, SORTED = 273,
  BY = 274, NUMBER = 275, HEIGHT = 276, AREA = 277,
  CALIBRATE = 278, USING = 279, CLEAR = 280, CALIBRATION = 281,
  CALIBRATED = 282, CHANNEL = 283, STRING = 284, NUM = 285
}

Functions

int yylex ()
 yylex function
void yyerror (char const *s)
 The provided yyerror function.
int yyparse ()
void pf_init_parse_data ()
 Initialize the parse context data.
void pf_free_parse_data ()
 Free any data associated with the last parse.
void pf_get_parsed_plot_params (struct pf_plot_params *p)
 Get the parsed plot parameters.
int pf_get_parsed_rescale ()
 Get the parsed rescale flag.
int pf_get_parsed_cal ()
 Get the parsed calibration flag.
int pf_get_parsed_norm ()
 Get the parsed normailzation flag.
int pf_get_parsed_marked ()
 Get the parsed mark flag.
int pf_get_parsed_annot ()
 Get the parsed annotate flag.
int pf_get_parsed_peak ()
 Get the parsed peak number.
double pf_get_parsed_rotation ()
 The the parsed rotation amount.
enum pf_command pf_get_parsed_command ()
 Get the parsed command.
enum pf_peak_sort pf_get_parsed_sort ()
 Get the parsed sort flag.
pf_plot_rangepf_get_parsed_plot_range ()
 Get the parsed plot range.
char * pf_get_parsed_file ()
 Get the parsed file name.
char * pf_get_parsed_driver ()
 Get the parsed driver name.

Variables

pf_plot_range plot_range
 The range of the requested plot.
char * load_file
 The provided file name.
char * driver_name
 The provided plotting driver name.
int use_norm
 Flag indicating if the plot should use normalized data.
int need_rescale
 Flag indicating if the plot should be rescaled for the data displayed.
int need_cal
 Flag indicating if the plot should use a calibrated x-axis.
int should_mark
 Flag indicating if the plot should mark non-background areas.
int should_annot
 Flag indicating if the peaks should be numbered on the plot.
int peak_num
 The peak number of the peak requested.
double rot_angle
 The number of degrees to rotate the plot from the default angle.
int yychar
YYSTYPE yylval
int yynerrs

Define Documentation

#define ANNOTATE   270
 

#define AREA   277
 

#define BY   274
 

#define CALIBRATE   278
 

#define CALIBRATED   282
 

#define CALIBRATION   281
 

#define CHANNEL   283
 

#define CLEAR   280
 

#define DATA   261
 

#define DRIVER   271
 

#define HEIGHT   276
 

#define LOAD   264
 

#define MARKED   267
 

#define NORM   262
 

#define NUM   285
 

#define NUMBER   275
 

#define PEAK   269
 

#define PEAKS   268
 

#define PLOT   259
 

#define PRINT   260
 

#define QUIT   258
 

#define RESCALE   266
 

#define ROTATED   272
 

#define SMOOTH   263
 

#define SORTED   273
 

#define STRING   284
 

#define TO   265
 

#define USING   279
 

#define YY_REDUCE_PRINT Rule   ) 
 

#define YY_STACK_PRINT Bottom,
Top   ) 
 

#define YYABORT   goto yyabortlab
 

#define YYACCEPT   goto yyacceptlab
 

#define YYBACKUP Token,
Value   ) 
 

Value:

do                                                              \
  if (yychar == YYEMPTY && yylen == 1)                          \
    {                                                           \
      yychar = (Token);                                         \
      yylval = (Value);                                         \
      yytoken = YYTRANSLATE (yychar);                           \
      YYPOPSTACK;                                               \
      goto yybackup;                                            \
    }                                                           \
  else                                                          \
    {                                                           \
      yyerror ("syntax error: cannot back up");\
      YYERROR;                                                  \
    }                                                           \
while (0)

#define YYBISON   1
 

#define yyclearin   (yychar = YYEMPTY)
 

#define YYCOPY To,
From,
Count   ) 
 

Value:

do                                      \
        {                                       \
          register YYSIZE_T yyi;                \
          for (yyi = 0; yyi < (Count); yyi++)   \
            (To)[yyi] = (From)[yyi];            \
        }                                       \
      while (0)

#define YYDEBUG   0
 

#define YYDPRINTF Args   ) 
 

#define YYDSYMPRINT Args   ) 
 

#define YYDSYMPRINTF Title,
Token,
Value,
Location   ) 
 

#define YYEMPTY   (-2)
 

#define YYEOF   0
 

#define YYERRCODE   256
 

#define yyerrok   (yyerrstatus = 0)
 

#define YYERROR   goto yyerrorlab
 

#define YYERROR_VERBOSE   0
 

#define YYFAIL   goto yyerrlab
 

#define YYFINAL   23
 

#define YYFREE   free
 

#define YYINITDEPTH   200
 

#define YYLAST   55
 

#define YYLEX   yylex ()
 

#define YYLLOC_DEFAULT Current,
Rhs,
 ) 
 

Value:

((Current).first_line   = (Rhs)[1].first_line,  \
    (Current).first_column = (Rhs)[1].first_column,     \
    (Current).last_line    = (Rhs)[N].last_line,        \
    (Current).last_column  = (Rhs)[N].last_column)

#define YYLSP_NEEDED   0
 

#define YYMALLOC   malloc
 

#define YYMAXDEPTH   10000
 

#define YYMAXUTOK   285
 

#define YYNNTS   27
 

#define YYNRULES   55
 

#define YYNSTATES   77
 

#define YYNTOKENS   31
 

#define YYPACT_NINF   -25
 

#define YYPOPSTACK   (yyvsp--, yyssp--)
 

#define YYPURE   0
 

 
#define YYRECOVERING  )     (!!yyerrstatus)
 

#define YYSIZE_T   unsigned int
 

#define YYSKELETON_NAME   "yacc.c"
 

#define YYSTACK_ALLOC   YYMALLOC
 

#define YYSTACK_BYTES  ) 
 

Value:

((N) * (sizeof (short int) + sizeof (YYSTYPE))                  \
      + YYSTACK_GAP_MAXIMUM)

#define YYSTACK_FREE   YYFREE
 

#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
 

#define YYSTACK_RELOCATE Stack   ) 
 

Value:

do                                                                      \
      {                                                                 \
        YYSIZE_T yynewbytes;                                            \
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
        Stack = &yyptr->Stack;                                          \
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / sizeof (*yyptr);                          \
      }                                                                 \
    while (0)

#define yystype   YYSTYPE
 

#define YYSTYPE_IS_DECLARED   1
 

#define YYSTYPE_IS_TRIVIAL   1
 

#define YYTABLE_NINF   -1
 

#define YYTERROR   1
 

#define YYTRANSLATE YYX   )     ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 

#define YYUNDEFTOK   2
 


Typedef Documentation

typedef short int yysigned_char
 

typedef union YYSTYPE YYSTYPE
 


Enumeration Type Documentation

enum yytokentype
 

Enumeration values:
QUIT 
PLOT 
PRINT 
DATA 
NORM 
SMOOTH 
LOAD 
TO 
RESCALE 
MARKED 
PEAKS 
PEAK 
ANNOTATE 
DRIVER 
ROTATED 
SORTED 
BY 
NUMBER 
HEIGHT 
AREA 
CALIBRATE 
USING 
CLEAR 
CALIBRATION 
CALIBRATED 
CHANNEL 
STRING 
NUM 


Function Documentation

void pf_free_parse_data  ) 
 

Free any data associated with the last parse.

int pf_get_parsed_annot  ) 
 

Get the parsed annotate flag.

Returns:
The parsed annotate flag

int pf_get_parsed_cal  ) 
 

Get the parsed calibration flag.

Returns:
The parsed calibration flag

enum pf_command pf_get_parsed_command  ) 
 

Get the parsed command.

Returns:
The parsed command

char* pf_get_parsed_driver  ) 
 

Get the parsed driver name.

Returns:
The parsed driver name

char* pf_get_parsed_file  ) 
 

Get the parsed file name.

Returns:
The parsed file name

int pf_get_parsed_marked  ) 
 

Get the parsed mark flag.

Returns:
The parsed mark flag

int pf_get_parsed_norm  ) 
 

Get the parsed normailzation flag.

Returns:
The parsed normailzation flag

int pf_get_parsed_peak  ) 
 

Get the parsed peak number.

Returns:
The parsed peak number

void pf_get_parsed_plot_params struct pf_plot_params p  ) 
 

Get the parsed plot parameters.

Parameters:
[out] p The plot parameters

struct pf_plot_range* pf_get_parsed_plot_range  ) 
 

Get the parsed plot range.

Returns:
The parsed plot range

int pf_get_parsed_rescale  ) 
 

Get the parsed rescale flag.

Returns:
The parsed rescale flag

double pf_get_parsed_rotation  ) 
 

The the parsed rotation amount.

Returns:
The parsed rotation amount

enum pf_peak_sort pf_get_parsed_sort  ) 
 

Get the parsed sort flag.

Returns:
The parsed sort flag

void pf_init_parse_data  ) 
 

Initialize the parse context data.

void yyerror char const *  s  ) 
 

The provided yyerror function.

Parameters:
[in] s The parser-provided error string

int yylex  ) 
 

yylex function

Returns:
The token type

int yyparse  ) 
 

Here is the call graph for this function:


Variable Documentation

char* driver_name
 

The provided plotting driver name.

char* load_file
 

The provided file name.

int need_cal
 

Flag indicating if the plot should use a calibrated x-axis.

int need_rescale
 

Flag indicating if the plot should be rescaled for the data displayed.

int peak_num
 

The peak number of the peak requested.

struct pf_plot_range plot_range
 

The range of the requested plot.

double rot_angle
 

The number of degrees to rotate the plot from the default angle.

int should_annot
 

Flag indicating if the peaks should be numbered on the plot.

int should_mark
 

Flag indicating if the plot should mark non-background areas.

int use_norm
 

Flag indicating if the plot should use normalized data.

int yychar
 

YYSTYPE yylval
 

int yynerrs
 


Generated on Sun Feb 20 17:46:19 2005 for peakfinder-0.1 by  doxygen 1.3.9.1