Revision 301 trunk/src/df1b2-separable/tpl2rem.lex

tpl2rem.lex (revision 301)
4 4
  #define   MAX_TMP_STRING 2000 
5 5
  #define   MAX_USER_CLASSES  450
6 6
  #define   MAX_USER_CLASSNAME_LENGTH  181
7
  #define   MAX_PRIOR_CHECK  1000
8
  #define   MAX_LIKE_CHECK  2000
7 9
  #include <stdlib.h>
8 10
  #include <string.h>
9 11
  #include <stdio.h>
......
80 82
  int nchar=0;
81 83
  int warn_unallocated=1;
82 84
  int have_classcode_tmp=0;
85
  
86
  int priors_defined=0;
87
  int prior_done_once=0;
88
  int likelihood_defined=0;
89
  int likelihood_done_once=0;
90
  int procedure_done=0;
91
  int likelihood_done=0;
92
  int priors_done=0;
93
  int prior_function_toggle=0;
94
  char objective_function_name_string[MAX_TMP_STRING];
95
  char prior_checker[MAX_PRIOR_CHECK][100];//container hold all parameters which being used for check the prior
96
  int prior_counter=0; //index for prior_checker
97
  int prior_found=0;
98
  char likelihood_checker[MAX_LIKE_CHECK][100];
99
  int likelihood_counter=0; //index for likelihood_checker
100
  int likelihood_found=0;
101
  
83 102
  char *  conlist_ptr;
84 103
  char conlist[6000];
85 104
  char *  classlist_ptr;
......
115 134
  void marker(void);
116 135
  void write_unallocated(const char *);
117 136
  void print_quadratic_random_effect_penalty_class(char *text);
137
  
138
  void add_prior_to_objective(void);
139
  void add_likelihood_to_objective(void);
140
  void setup_for_prior_likelihood(void);
141
  void trim(char * a); 
142
  int prior_check(char * parameter, char * prior);   
143
  
118 144
%}
119 145

  
120 146
filename \"[^\"]*\"
......
129 155

  
130 156
float_num_exp [a-z_A-Z0-9\.\+\-\*]+
131 157

  
158
prior_name [ \t(a-z_A-Z]+(->)?[ \ta-z_A-Z0-9(),.-]*
159
prior_def [ \t(a-z_A-Z0-9-]+(->)?[ \ta-z_A-Z0-9),.-]*
160

  
132 161
%s DEFINE_DATA DEFINE_PARAMETERS DEFINE_PROCS IN_DATA_DEF IN_PARAM_DEF
133 162
%s IN_NUMBER_DEF IN_SPNUMBER_DEF IN_VECTOR_DEF IN_VECTOR_VECTOR_DEF 
134 163
%s IN_SPVECTOR_DEF 
......
142 171
%s DEFINE_BETWEEN_PHASES IN_FIVE_ARRAY_DEF IN_SIX_ARRAY_DEF IN_SEVEN_ARRAY_DEF 
143 172
%s IN_NAMED_FIVE_ARRAY_DEF IN_NAMED_SIX_ARRAY_DEF IN_NAMED_SEVEN_ARRAY_DEF 
144 173
%s IN_SPBOUNDED_NUMBER_DEF INIT_SPBOUNDED_VECTOR_DEF IN_PVM_SLAVE_SECTION
174
%s DEFINE_PRIORS DEFINE_LIKELIHOOD DEFINE_PROCEDURE IN_NUMBER_DEF2
145 175
%%
146
;             /* ignore semi colons */ ;
147
[ \t]+        /* ignore blanks */  ;
176

  
148 177
\/\/.*$         /* ignore trailing comments */ ;
149

  
150
\n    { nline++; }
178
\/[\*]+.[\*]\/  /* ignore block comments */ ;
151 179
\r    { ; }
152 180

  
153 181
INITIALIZATION_SECTION  {
154 182

  
155
  /*
156 183
  if (!data_defined)
157 184
  {
158 185
    fprintf(stderr,"Error -- DATA_SECTION must be defined before"
159 186
      " INITIALIZATION_SECTION \n");
160 187
    exit(1);
161 188
  }
162
  if (initialization_defined)
189
  if (params_defined)
163 190
  {
164
    fprintf(stderr,"%s","Error -- only one INTIALIZATION SECTION allowed\n");
191
    fprintf(stderr,"Error -- INITIALIZATION_SECTION must be defined before"
192
      " PARAMETER_SECTION for random effect model\n");
165 193
    exit(1);
166 194
  }
167
  if (!params_defined)
195
  
196
  if (initialization_defined)
168 197
  {
169
    fprintf(stderr,"Error -- INITIALIZATION_SECTION must be defined before"
170
      " PARAMETER_SECTION \n");
198
    fprintf(stderr,"%s","Error -- only one INTIALIZATION SECTION allowed\n");
171 199
    exit(1);
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff