parser question ...

Lars Segerlund lars.segerlund@comsys.se
Tue Sep 14 13:27:00 GMT 2004


On Tue, 14 Sep 2004 03:24:28 +0200
Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> wrote:

> Lars Segerlund wrote:
> >  I have a small question about the parser, specifically :
> > 
> > parse.c:277:      match ("use% ", gfc_match_use, ST_USE);
> > 

 ... snip ....

> and then add a line in parser.c like this
>    match ("use , intrinsic", gfc_match_use_intrinsic, ST_USE_INTRINSIC)
> I don't know enough about this extension to know if the second solution would
> work, but I think it would be preferable, if possible, because this way the
> code dealing with this language extension could be kept separate from the
> stuff dealing with standard code.
> 
> - Tobi

 Now I have a new question, it seems that the gfc_match_use function flags anything it doesn't match as an error, thus adding a match ( " use , intrinsic" .... ) after the statement already there won't work as an error is flagged before control can get to it, the same statement added before the match use already there works as expected.

 The thing is I would like to know the customary procedure in cases like this, should I patch up the present code in gfc_match_use or simply add the matching of use , intrinsic before that one ?

 It's a bit confusing since the case for 'u' doesn't seem to be constructed to handle more than one option.

 I would like to patch up the current gfc_match_use to generate an unclassifiable statement message instead of working as it currently does.

 i.e. what is the proper thing to do, and am I right in considering the present code 'wrong' ?

 / Lars Segerlund.



More information about the Fortran mailing list