Ignore:
Timestamp:
Feb 18, 2009, 11:39:30 AM (16 years ago)
Author:
mies
Message:

implemented bootstrap info parser

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/misc/StringFormat.cpp

    r2444 r2452  
    44#include "boost/xpressive/xpressive.hpp"
    55
     6namespace ariba {
     7namespace utility {
     8namespace string_format {
     9
    610using namespace boost::xpressive;
    711
    812// regex: string
    9 const sregex StringFormat::rstring = '"' >> keep(*~(boost::xpressive::set = '"'))
     13const sregex rstring = '"' >> keep(*~(boost::xpressive::set = '"'))
    1014                >> '"';
    1115
    1216// regex: base64 encoding
    13 const sregex StringFormat::rbase64 = '!' >> +(range('a', 'z') | range('A', 'Z')
     17const sregex rbase64 = '!' >> +(range('a', 'z') | range('A', 'Z')
    1418                | range('0', '9') | '/' | '+') >> *(boost::xpressive::set = '=');
    1519
    1620// regex: raw alphabet
    17 const sregex StringFormat::rchars = +(range('a', 'z') | range('A', 'Z'));
     21const sregex rchars = +(range('a', 'z') | range('A', 'Z'));
    1822
    1923// regex: integer
    20 const sregex StringFormat::rint = '0' | (range('1', '9') >> !(range('0', '9')));
     24const sregex rint = '0' | (range('1', '9') >> !(range('0', '9')));
    2125
    2226// regex: binary label
    23 const sregex StringFormat::rlabel = rchars | rstring | rbase64;
     27const sregex rlabel = rchars | rstring | rbase64;
    2428
    2529// regex: dot separated identifier
    26 const sregex StringFormat::rid = rlabel >> *('.' >> rlabel) >> *('.' >> rint);
     30const sregex rid = rlabel >> *('.' >> rlabel) >> *('.' >> rint);
    2731
    2832// regex: "leaf" data
    29 const sregex StringFormat::rdata = !(boost::xpressive::set = '!') >> '{'
     33const sregex rdata = !(boost::xpressive::set = '!') >> '{'
    3034                >> *(keep(+~(boost::xpressive::set = '{', '}')) | by_ref(rdata))
    3135                >> '}';
    3236
    3337// regex: fields
    34 const sregex StringFormat::rfield_label = rlabel >> '=';
    35 const sregex StringFormat::rfield = !rfield_label >> (rid | rdata);
    36 const sregex StringFormat::rfields = '(' >> rfield >> *(',' >> rfield) >> ')';
     38const sregex rfield_label = rlabel >> '=';
     39const sregex rfield = !rfield_label >> (rid | rdata);
     40const sregex rfields = '(' >> rfield >> *(',' >> rfield) >> ')';
    3741
    38 // regex: objects
    39 const sregex StringFormat::robject_data = (rdata | rfields);
    40 const sregex StringFormat::robject = rid >> robject_data;
    41 const sregex StringFormat::robjects = robject >> *(',' >> robject);
     42// regex objects
     43const sregex robject_data = (rdata | rfields);
     44const sregex robject_id = rid;
     45const sregex robject = robject_id >> robject_data;
     46const sregex robjects = robject >> *(',' >> robject);
     47
     48}}}
Note: See TracChangeset for help on using the changeset viewer.