[prev in list] [next in list] [prev in thread] [next in thread] 

List:       evms-devel
Subject:    [Evms-devel] Proposed grammar for an EVMS native command line interface
From:       "Ben Rafanello" <benr () us ! ibm ! com>
Date:       2001-05-23 19:37:56
[Download RAW message or body]

Hello everyone!

As you know, the EVMS provides a programmatic interface called the EVMS
Engine.  The user interfaces for the EVMS are thus independent programs
that are "wrapped" around the EVMS engine.  Since we obviously need at
least a command line interface and a GUI, I decided to take a stab at
the command line interface while other members of the team work on the
GUI.  My basic approach is to create a command line grammar and
implement an interpreter for it based upon a recursive descent parser
and a stack machine.  My first hack for the grammar for the command line
interface follows:

EVMS Command Line Grammar

Notes:

Regions - Regions represent blocks of logical disk space.  Regions may be
allocated or unallocated.  Allocated regions are part of volumes while
unallocated regions represent logical disk space which has not been
assigned to a volume and is therefore available for use.  When creating
storage objects, only unallocated regions may be used.  Unallocated
regions may be subdivided - the granularity of the subdivisions being up
to the Region Manager which owns the regions being subdivided.

The EVMS command line will NOT be case sensitive.  Capitalization used
within the grammar is to help make it more readable.

The EVMS command line will ignore spaces and tabs unless they appear
as part of a quoted string.

This is a first hack at generating a command line grammar capable of
accessing most of the capabilities of the EVMS.  It will continue to
be expanded as additional capabilities are added to the EVMS until
it allows access to as many EVMS capabilities as are practical.

The EVMS command line makes no distinction between the "long" and
"short" forms of a command/parameter as seen in some other Linux
programs.  The grammar allows the user to freely mix the long and
short forms of identifiers/commands/etc. at any time within a command
line.

Multiple commands may be placed on a single command line.


Notation:

Items in <> represent non-terminals - they will be defined elsewhere in
the grammar

Items in [] are optional

() are used for grouping

()+ means that the item in the () appears 1 or more times

()* means that the item in the () appears 0 or more times

'(' and ')' indicate that the parenthesis are not being used as part of
    the grammar, but are instead characters that appear on the command
    line.

'[' and ']' indicate that the brackets are not being used as part of
    the grammar, but are instead  characters that appear on the command
    line.

'<' and '>' indicate that the angle brackets are not being used as part
    of the grammar, but are instead  characters that appear on the command
    line.

''' means that the quote is not being used as part of the grammar, but
    is instead a character which must appear on the command line.

| means "or"

::= defines the meaning of a non-terminal.

::== defines the meaning of a non-terminal in terms of something
    external to the grammar.

\ indicates that an entry in the grammar did not fit completely on the
    current line and continues on the following line

Grammar:


EVMS [ <Command Line Parameters> ] [:]


<Command Line Parameters> ::= [ ( -F[ile] : <File Name> ) |                  \
                                ( <Command> (: <Command>)* ) ]


<Command> ::=
    --C[reate]: <Creation Parameters>

    | --D[elete]: <Specify Object>

    | --E[xpand]: <Specify Object> ( , A[uto] , <Auto Expand Parameters> ) | \
                  ( , M[anual] ( , <Feature Expand Parameters> )+ )

    | --S[hrink]: <Specify Object>  [ ( , S[ize] = <Cardinal> ) |            \
                                      ( , R[emove] <Cardinal> ) ]

    | --Ren[ame]: <Specify Object> , N[ame] = ''' <EVMS Name> '''

    | --Rev[ert]: <Specify Object>

    | --Q[uery]:  <Query Type>

    | --H[elp] [: Create | Delete | Expand | Shrink | Rename | Revert |      \
                  Query ]


<Creation Parameters> ::=
    V[olume] , <Specify Object> , N[ame] = ''' <EVMS Name> '''

    | O[bject] , <Feature Identifier> = { <EVMS Feature Parameters> }        \
             ( ,  ( <Specify Object> | <Specify Region> ) )+                 \
             [ ,  N[ame] = ''' <EVMS Name> ''' ]

    | C[ontainer] , <Plugin Identifier> = { <EVMS Plugin Parameters> }       \
                ( ,  ( <Specify Object> | <Specify Region> ) )+              \
                [ ,  N[ame] = ''' <EVMS Name> ''' ]

<Query Type> ::=
    P[lugins] [ , ( T[ype] = <Plugin Types> ) |                              \
                  ( V[olume] = <Specify Object> ) |                          \
                  ( O[bject] = <Specify Object> ) |                          \
                  ( C[ontainer] = <Specify Object> ) ]

    | V[olumes] ( [ , <Size Parameters> ]                                    \
                  [ , P[lugin] = <Plugin Identifier> ]                       \
                  [ , C[ontainer] = <Specify Object> ]                       \
                  [ , ( E[xpandable] | S[hrinkable] ) ] ) |                  \
                ( R[egion] = <Specify Object> ) |                            \
                ( O[bject] = <Specify Object> )

    | R[egions] [ , <Size Parameters> ]                                      \
                [ , ( V[olume] = <Specify Object> ) |                        \
                    ( O[bject] = <Specify Object> ) |                        \
                    ( C[ontainer] = <Specify Object> ) |                     \
              U[nclaimed] ]

    | O[bjects] ( [ , <Size Parameters> ]                                    \
                  [ , P[lugin] = <Plugin Identifier> ]                       \
                  [ , C[ontainer] = <Specify Object> ]                       \
                  [ , ( E[xpandable] | S[hrinkable] ) ] ) |                  \
                ( R[egion] = <Specify Object> )

    | C[ontainers] ( [ , <Size Parameters> ]                                 \
                     [ , P[lugin] = <Plugin Identifier> ] ) |                \
                   ( F[reespace] [ , <Size Parameters> ] ) |                 \
                   ( R[egion] = <Specify Object> )

    | D[isks] [ , <Size Parameters> ]                                        \
              [ , P[lugin] = <Plugin Identifier> ]                           \
              [ , U[nclaimed] ]

    | S[egments] [ , <Size Parameters> ]                                     \
                 [  ( , P[lugin] = <Plugin Identifier> ) |                   \
                    ( , C[ontainer] = <Specify Object> ) |                   \
                    ( [ , D[isk] = <Specify Object> ]                        \
                      [ , U[nclaimed] ] ) ]

    | A[cceptable] ,  ( C[reate]  |                                          \
                      ( E[xpand] , ( V[olume] = <Specify Object> ) |         \
                                   ( O[bject] = <Specify Object> ) ) )       \
                   , <Feature Identifier>

    | Chi[ldren] , ( V[olume] = <Specify Object> ) |                         \
                   ( O[bject] = <Specify Object> )

    | Par[ent] , ( R[egion] = <Specify Object> ) |                           \
                 ( O[bject] = <Specify Object> )

<Plugin Types> ::=
    F[eature]
    | R[egion Manager]
    | S[egment Manager]
    | D[evice Manager]
    | F[ilesystem ]I[nterface ]M[odule]
    | D[istributed ]L[ock ]M[anagement]
    | C[luster ]M[anagement]

<Feature Identifier> ::=
    '''  <EVMS Feature Name> '''
    | <EVMS Feature ID>

<Plugin Identifier> ::=
    ''' <EVMS Plugin Name> '''
    | <EVMS Plugin ID Number>

<Size Parameters> ::=
    LT <Size>
    | GT <Size>
    | EQ <Size>
    | LT <Size> , GT <Size>
    | GT <Size> , LT <Size>

<Specify Object> ::=
    ''' <EVMS Name> '''
    | <EVMS Serial Number>

<Auto Expand Parameters> ::=
    S[ize] = <Cardinal>
    |  A[dd] <Cardinal>

<Feature Expand Parameters> ::=
''' <EVMS Feature Name> ''' = { <EVMS Feature Parameters> }                  \
        ( ( , <Specify Region> )+ |  , A[dd] <Cardinal> )


<Specify Region> ::= <Specify Object> , ( A[LL] | ( <Size> , <Offset> ) )


<Size> ::= <Cardinal>


<Offset> ::= S[tart] | E[nd] | <Cardinal>


<EVMS Feature Name> ::== This is provided to the EVMS by the feature
                         plugin and must be in the format specified
                         by the EVMS.


<EVMS Feature ID> ::== This is provided to the EVMS by the feature
                       plugin and must be in the format specified
                       by the EVMS.


<EVMS Feature Parameters> ::=
    ''' < Parameter Name > ''' = <Value>


<Parameter Name> ::== Any parameter name provided to the EVMS by a
                      plugin that is in the format specified by the EVMS.


<Value> ::== Any value for a parameter which is of a type acceptable to
             the EVMS.  All string values must be within quotes.


<EVMS Plugin Name> ::== This is provided to the EVMS by the plugin and
                        must be in the format specified by the EVMS.


<EVMS Plugin ID Number> ::== This is provided to the EVMS by the plugin
                             and must be in the format specified by the
                             EVMS.


<EVMS Plugin  Parameters> ::== any grammar defined by a plug-in module
                               describing its command line parameters


<Cardinal> ::== A cardinal number according to the mathematical
                definition of such.


<File Name> ::== A Linux acceptable filename


Well, I hope the mail system didn't alter the formatting of the grammar
too much, and I hope it was understandable.  If there are any questions
or comments, please post them!

Ben Rafanello
IBM Linux Technology Center
(512) 838-4762
benr@us.ibm.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic