FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Portage Developer

 
 
LinkBack Thread Tools
 
Old 04-13-2008, 06:04 PM
Björn Michaelsen
 
Default BNF for DEPEND in EAPI0 and EAPI1

Hi there,

I worked through the current PMS and tried to formalize the grammar for
DEPEND a little better. Maybe someone could have a look at it and check
it for correctness. It could even become part of the gentoo
development docs or be an appendix to the PMS. The other grammars
(SRC_URI etc.) should be fairly easy.

Any comments?

Have Fun,

Björn


= EAPI 0/1 package dependency specification in Backus-Naur-Form =

The terminals are described as regular expressions.
The nonterminal <dependencies> is what is allowed in the DEPENDs.

terminals:
<category name> ::= "[A-Za-z0-9+_][A-Za-z0-9+_.-]*"
<close parenthesis> ::= "[)]"
<colon> ::= ":" (not in EAPI0)
<dependency group or operator> ::= "[|][|]"
<empty> ::= ""
<equal> ::= "="
<exclamation mark> ::= "!"
<general package operator> ::= "<|<=|~|>|>="
<open parenthesis> ::= "[(]"
<package name> ::= "[A-Za-z0-9+_-]*([A-Za-z+_-]|[A-Za-z+_][0-9]+)"
<package version alpha part> ::= "[a-z]"
<package version number part> ::= "[0-9]+([.][0-9]+)*"
<package version suffix> ::= "_(alpha|beta|pre|rc|p)[0-9]*"
<question mark> ::= "?"
<slash> ::= "/"
<slot name> ::= "[A-Za-z0-9+_][A-Za-z0-9+_.-]*" (not in EAPI0)
<space> ::= " "
<star> ::= "*"
<useflag name> ::= "[A-Za-z0-9][A-Za-z0-9+_@-]*"

non-terminals:
<all-of group> ::= <open parenthesis><space><group contents><space><close parenthesis>
<any-of group> ::= <dependency group or operator><space><all-of group>
<blocked package dependency> ::= <exclamation mark><package dependency>
<dependencies> ::= <empty>|<group contents>
<dependency item> ::= <blocked package dependency>|<package dependency>|<all-of group>|<any-of group>|<use conditional group>
<group contents> ::= <dependency item>|<group contents><space><dependency item>
<limited package dependency> ::= <dependency operator><package with version>
<limited package dependency likeness> ::= <equal><package with version>|<equal><package with version><star>
<package dependency> ::= <unslotted package dependency>|<slotted package dependency>
<package version> ::= <package version number part><package version alpha part><package version suffix part>
<package version suffix part> ::= <empty>|<package version suffix part><package version suffix>
<package with version> ::= <qualified package name>-<package version>
<qualified package name> ::= <category name><slash><package name>
<slotted package dependency> ::= <unslotted package dependency><colon><slot name> (not in EAPI0)
<unslotted package dependency> ::= <qualified package name>|<limited package dependency>|<limited package dependency likeness>
<use conditional group> ::= <use conditional><space><any-of group>
<use condition> ::= <useflag name>|<exclamation mark><useflag name>
 
Old 04-14-2008, 12:22 PM
Marius Mauch
 
Default BNF for DEPEND in EAPI0 and EAPI1

On Sun, 13 Apr 2008 20:04:41 +0200
Björn Michaelsen <bjoern.michaelsen@gmail.com> wrote:

> Hi there,
>
> I worked through the current PMS and tried to formalize the grammar
> for DEPEND a little better. Maybe someone could have a look at it and
> check it for correctness. It could even become part of the gentoo
> development docs or be an appendix to the PMS. The other grammars
> (SRC_URI etc.) should be fairly easy.
>
> Any comments?

Offhand the 'package name' part is wrong/incomplete, pretty sure even
PMS says that they can't start/end with underscores or dashes (it's a
real PITA to get it right).
Haven't really read the non-terminals section as it's hard to read in
this form, using EBNF or some markup language might help with that.

Marius
--
gentoo-portage-dev@lists.gentoo.org mailing list
 
Old 04-14-2008, 07:07 PM
Björn Michaelsen
 
Default BNF for DEPEND in EAPI0 and EAPI1

Am Mon, 14 Apr 2008 14:22:12 +0200
schrieb Marius Mauch <genone@gentoo.org>:

> Offhand the 'package name' part is wrong/incomplete, pretty sure even
> PMS says that they can't start/end with underscores or dashes (it's a
> real PITA to get it right).

I havent found anything like that in the PMS at the appropriate places.
It only limits the characters and restricts a package name not to end
in a hyphen followed by number literals.
However, if there is a need to restrict the package name like that it
_should_ be in the PMS of cause. Other wierd package names allowed by
this regexp and by the PMS: "---", "___1", "1-2a"
PMS even allows "137" or "", while the regexp does not. That would be
easily fixed, but I guess that is not even intended.

> Haven't really read the non-terminals section as it's hard to read in
> this form, using EBNF or some markup language might help with that.
EBNF would be easy. What kind of markup do you have in mind? (Also I
need to get rid of the left recursion in the BNF)

Have Fun,

Björn
 

Thread Tools




All times are GMT. The time now is 08:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org