| 3148 | // |
| 3149 | |
| 3150 | static act* par_variable() |
| 3151 | { |
| 3152 | // Since fortran is fussy about continuations and the like, |
| 3153 | // see if this variable token is the first thing in a statement. |
| 3154 | |
| 3155 | const bool first = gpreGlob.token_global.tok_first; |
| 3156 | gpre_ctx* context; |
| 3157 | gpre_fld* field = EXP_field(&context); |
| 3158 | |
| 3159 | gpre_fld* cast; |
| 3160 | bool dot = MSC_match(KW_DOT); |
| 3161 | if (dot && (cast = EXP_cast(field))) |
| 3162 | { |
| 3163 | field = cast; |
| 3164 | dot = MSC_match(KW_DOT); |
| 3165 | } |
| 3166 | |
| 3167 | bool is_null = false; |
| 3168 | if (dot && MSC_match(KW_NULL)) |
| 3169 | { |
| 3170 | is_null = true; |
| 3171 | dot = false; |
| 3172 | } |
| 3173 | |
| 3174 | gpre_req* request = context->ctx_request; |
| 3175 | ref* reference = EXP_post_field(field, context, is_null); |
| 3176 | |
| 3177 | if (field->fld_array) |
| 3178 | EXP_post_array(reference); |
| 3179 | |
| 3180 | act* action = MSC_action(request, ACT_variable); |
| 3181 | |
| 3182 | if (first) |
| 3183 | action->act_flags |= ACT_first; |
| 3184 | if (dot) |
| 3185 | action->act_flags |= ACT_back_token; |
| 3186 | |
| 3187 | action->act_object = reference; |
| 3188 | |
| 3189 | if (!is_null) |
| 3190 | return action; |
| 3191 | |
| 3192 | // We've got a explicit null flag reference rather than a field |
| 3193 | // reference. If there's already a null reference for the field, |
| 3194 | // use it; otherwise make one up. |
| 3195 | |
| 3196 | if (reference->ref_null) |
| 3197 | { |
| 3198 | action->act_object = reference->ref_null; |
| 3199 | return action; |
| 3200 | } |
| 3201 | |
| 3202 | // Check to see if the flag field has been allocated. If not, sigh, allocate it |
| 3203 | |
| 3204 | ref* flag = MSC_reference(&request->req_references); |
| 3205 | flag->ref_context = reference->ref_context; |
| 3206 | flag->ref_field = PAR_null_field(); |
| 3207 | flag->ref_level = request->req_level; |
no test coverage detected