head	1.10;
access;
symbols
	FSL_1_0_2:1.9
	FSL_1_0_1:1.9
	FSL_1_0_0:1.9
	FSL_0_9_0:1.9
	CFG_0_9_0:1.9
	FSL_0_1_12:1.9
	FSL_0_1_11:1.9
	FSL_0_1_10:1.9
	FSL_0_1_9:1.9
	FSL_0_1_8:1.9
	FSL_0_1_7:1.9
	FSL_0_1_6:1.9
	FSL_0_1_5:1.9
	FSL_0_1_1:1.9;
locks; strict;
comment	@# @;


1.10
date	2002.08.16.09.45.06;	author rse;	state dead;
branches;
next	1.9;

1.9
date	2002.07.18.15.34.55;	author rse;	state Exp;
branches;
next	1.8;

1.8
date	2002.07.17.18.47.52;	author rse;	state Exp;
branches;
next	1.7;

1.7
date	2002.07.10.12.00.23;	author rse;	state Exp;
branches;
next	1.6;

1.6
date	2002.07.09.08.29.31;	author rse;	state Exp;
branches;
next	1.5;

1.5
date	2002.07.09.08.29.19;	author rse;	state Exp;
branches;
next	1.4;

1.4
date	2002.07.08.13.45.46;	author rse;	state Exp;
branches;
next	1.3;

1.3
date	2002.07.05.17.30.23;	author rse;	state Exp;
branches;
next	1.2;

1.2
date	2002.07.05.14.33.10;	author rse;	state Exp;
branches;
next	1.1;

1.1
date	2002.07.03.13.25.34;	author rse;	state Exp;
branches;
next	;


desc
@@


1.10
log
@we just need a single TODO file here
@
text
@
- destroy haengt in Endlosschleife
- in scanner: use an combination of dynamic buffer and atomic symbol/token sub-library 
  to allow first tokens of mostly arbitrary size and then to store the tokens
  redundancy-free.
- Problem: \x00 oder \x{00} wird zu NUL-terminator -> use ptr+len instead
- caStr/cpStr durch yyless/yymore??
- syntax verification
- command line query tool
- error checking in scanner?
- OSSP ex support
- wieso geht sample.cfg nicht als Arg bei "make check"?

- newline in error message
$ ./cfg_test sample2.cfg 
ERROR: <line 7, column 1: `1b;
<}> quu'>

- cfg_t

rewrite-uri <regex> <subst> { <rewrite-cond> }
rewrite-uri ^/(.*) /path/$1 --redirect=permanent q{
    %{SOURCE} != "x" 
};


Directory [--foo=A]

Argument:
  - type:
    - keyword ("foo") via name
    - option ("--foo=BAR") via name & regex
    - argument ("foo") via regex
  - amount:
    - 1    
    - 0/1  ?
    - 0..n *
    - 1..n +
  - location:
    - by position
    - by name
  - lookup via:
    - name
    - position
    - regex match

foo   * bar
foo   = bar|quux|...
foo   (bar baz quux)

foo  ::= bar*         ;   kleene closure
foo  ::= bar|baz|quux ;   union
foo  ::= bar baz quux ;   concatenation

foo  ::= {foo;...}    ;   sequence of ...
foo  ::= (...)        ;   grouping
foo  ::= "bar"        ;   fixed terminal
foo  ::= /bar/        ;   regex terminal
foo  ::= <A>          ;   arbitrary argument
foo  ::= <O>          ;   arbitrary option

SEQ ::= "{" DIR DIR* "}"
DIR ::= TOK (" " TOK)* ";"
TOK ::= ...

SEQ ::= DIR*     SEQ(dir,dir,...)
DIR ::= TOK+     DIR(tok,tok,...)
TOK ::= string   "..."

config        ::= SEQ(directory|user|rewrite|access)
directory     ::= DIR("directory",<O>*,<A>) 
dir_options   ::= 
user          ::= DIR("user",/^[a-z]$/)
rewrite       ::= 
access        ::= "access" ("allow"|"deny"):action SEQ(access_list):acl
access_list   ::= m/^!?%{ID}$/

acl           ::= "acl" TOK:name acl_list
acl_list      ::= SEQ(acl_entry)
acl_entry     ::= acl_action "from" net-addr:src "to" net-addr:dst 
acl_action    ::= "allow"|"deny"
net_addr      ::= net_hostname | net_ipv4addr | net_ipv6addr

sequence all {
    directive --class 1;
};
directive --class 1 "foo" {
    option "bar" --occur=1
};

---------------------------------------------------------------------------

foo on;
bar /bla {
    foo off;
    baz --fuck {
        b1; b2 --nase=baer; b3; b4; b5;
    } --fuck2;
};
quux a1 a2 a3 a4;
quux;

---------------------------------------------------------------------------

sequence ROOT {
    directive foo; 
    directive bar;
    directive quux --count=1:oo;
};
sequence bar-seq {
    directive foo --count=0:1; 
    directive baz --count=1:oo;
};
directive foo { 
    token - on|off|yes|no;
};
directive bar {
    token path /.*; 
    sequence bar-seq;
};
directive baz { 
    option fuck; 
    option fuck2; 
    sequence {
        directive foo { 
            option nase (baer|hugo);
            option foo [0-9]; 
            token ip-address;
        };
    };
};
directive quux {
    token --count=0:oo a.*;
};
token ip-address b1|b2|b3|b4|b5;

-------------------------------------------------------------------------------

<config>     ::= "sequence" <count>? <name>;
               | "sequence" <count>? <name>? "{" <directive>* "}";
<directive>  ::= "directive" <token-count>? <name>;
               | "directive" <token-count>? <name>? "{" <option>* <token>+ };
<option>     ::= "option" <name> <regex>?;
<token>      ::= "token" <name>? <regex>;
<count>      ::= /^(\+|\*|\?|[0-9]+,[0-9]*|[0-9]*,[0-9]+|[0-9]+)$/
<name>       ::= /^[a-zA-Z][a-zA-Z0-9_.-]*$/
<regex>      ::= ...

-------------------------------------------------------------------------------

sequence ROOT {
    directive * "directive" {

    directive * token-1 {
        token token "token";
        token name  /^[a-zA-Z][a-zA-Z0-9_.-]*$/;
        token regex /^.+$/;
    }
};

-------------------------------------------------------------------------------

directive token {
    opt1      { /.../ opt2=/.../ } { 
    directive { /^token$/ }; 
    name      { m/.../; m/^[a-zA-Z][a-zA-Z0-9_.-]*$/ } ?;
    name      { m/(...|[a-zA-Z][a-zA-Z0-9_.-]*$)/ } ?;
    regex     { m/^.+$/ };
};
directive acl   { directive=/^acl$/ addr=/^...|...$/+ };

-------------------------------------------------------------------------------

a?b((c|d)+e)?f

A m/a/ ?
B m/b/ 
{
    {
        C m/c/ ;
        D m/d/ 
    } +
    E m/e/
} ? 
F f

<directive-match> ::= <token-match>+
<token-match> ::= <name>? <regex> <quant>?

-------------------------------------------------------------------------------

<config>     ::= "sequence" <count>? <name>;
               | "sequence" <count>? <name>? "{" <directive>* "}";
<directive>  ::= "directive" <name>;
               | "directive" <name>? "{" <options> "}" "{" <tokens> "}";

<options>     ::= <tok-match>+
<tokens>      ::= <dir-match>+

<dir-match>   ::= <tok-match>+
<tok-match>   ::= <name>? <node-match> <quant>?
<node-match>  ::= "{" <dir-match> "}" | <regex>

<option>     ::= "option" <name> <regex>?;
<token>      ::= "token" <name>? <regex>;

<count>      ::= /^(\+|\*|\?|[0-9]+,[0-9]*|[0-9]*,[0-9]+|[0-9]+)$/
<name>       ::= /^[a-zA-Z][a-zA-Z0-9_.-]*$/
<regex>      ::= ...

@


1.9
log
@flush work of today: first cut for real cfg_node_select()
@
text
@@


1.8
log
@remember issue
@
text
@d2 1
@


1.7
log
@Mega-change: full API overhauling.
@
text
@d2 3
@


1.6
log
@done
@
text
@d87 120
@


1.5
log
@add standard OSSP autoconf/libtool/shtool environment
@
text
@a3 1
- autoconf environment
@


1.4
log
@flush my brain
@
text
@d8 2
@


1.3
log
@update
@
text
@d2 2
d7 1
d17 1
a17 1
rewrite-uri ^/(.*) /path/$1 --redirect=permanent "{
d19 66
a84 1
}";
@


1.2
log
@Add support for Perl-like q(.)[^\1]\1 style quotations which allow one
to place arbitrary stuff into a single syntax token. This is especially
useful if you think about complex OSSP l2 or OSSP pcbe expressions which
else had to be escaped into double- or single-quoted strings in order to
be placed into a OSSP cfg syntax.
@
text
@d1 5
a10 3

cfg_test in free(): warning: modified (chunk-) pointer

a11 1
- cfg_node_destroy() for whole tree
a13 1

@


1.1
log
@Add this first cut for the forthcoming OSSP cfg library to CVS.
This is work in progress and still not ready for use anywhere.
@
text
@d1 8
a9 2
- cfg_data.c
- cfg_node_dump()
d11 7
@

