[Proj] proj.4 BNF
support.mn at elisanet.fi
support.mn at elisanet.fi
Mon Oct 20 20:05:41 PDT 2008
The problem using + alone as a staement separator is obvious,
since it can be mixed with positive number sign. One way is to forbid
to use "+" as a positive number sgn. But then it would trop all
future expressions also. Maybe best is to agree, that if "+" is
used as statement separator (and continuation mark) it should
be preceded by <SEP>, which is usually the case.
So it would be more like:
<SEP> ::= (<SPACE> | <TAB> | <EOL>) {<SEP>}
<continuation> ::= <SEP> "+"
That would require some white space before + and would make it
most clear?
----
Janne.
-----------------------------------------
support.mn at elisanet.fi kirjoitti:
> Frank Warmerdam <warmerdam at pobox.com> kirjoitti:
> > support.mn at elisanet.fi wrote:
> > > Maybe should define the correct BNF (BackusNaur Form) for proj.4?
> > >
> > > http://en.wikipedia.org/wiki/Backus-Naur_form
> > >
> > > That would help people to write correct proj.4 inits. I am still wondering
> > > that if sombody enters wrong proj.4 attributes, the library takes them
> > > in, but does
> > > something else and never informs the user that something he was entering
> > > was totally ignored. Not a very nice situation.
> > >
> > > There might be some kind of a stand alone pre scanner, that could be called
> > > on demand and that checked the user entry and gave full information about
> > > typos. errors and similar matters. It could be bypassed by those who do not
> > > need it. But I don't see why anybody wanted to bypass checking of his
> > > input.
> >
> > Janne,
> >
> > While this seems like a reasonable idea, I am doubtful that it will occur
> > due to the challenges in implementing and keeping it up to date.
> >
>
> Well, I can start with it. Here is an example, maybe full of errors, but something
> to start with.
>
> ------------------
>
> <proj.4 definition> ::= <statement list>
>
> <statement list> ::= <statement> {<SEP> <statement list> }
>
> <statement> ::= <empty> | <comment line> | <assignment statement> | <identifier>
>
> <empty ::=
>
> <comment line> ::= # <anything but EOL> <EOL>
>
> <assignment statement> ::= <identifier> = <right side>
>
> <right side> ::= <identifier> | <identifier list> | <number> | <number list>
>
> ........
>
> <EOL> ::= <CR> <LF> | <CR> | <LF>
>
> <SEP> ::= <SPACE> | <TAB> | <EOL> | "+"
>
> <SPACE> :: = " "
>
> <TAB> ::= chr(09)
>
>
> etc. etc.
>
>
>
> regards: Janne.
More information about the Proj
mailing list