[Proj] proj.4 BNF

support.mn at elisanet.fi support.mn at elisanet.fi
Mon Oct 20 22:45:50 EDT 2008


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