Scarlet Line home page Scarlet Line - SOFTWARE DESIGN & DEVELOPMENT

[Home]->[Documentation]->[Syntac Universal Parser]->[Other Grammars]->[Extended Backus-Naur form (EBNF)]->[Symbols]->[regexp_modifier]

Expand All
Collapse All
Contents

ebnf::regexp_modifier Locate in Contents

Declaration Locate in Contents

regexp_modifier[parser_type & tree, arc_token & current_link] ::=
        "?" {    current_link = tree.add_iterate_condition(current_link, 0, 1);/*    }*/
    |    "+" {    current_link = tree.add_iterate_condition(current_link, 1, 0);/*    }*/
    |    "*" {    current_link = tree.add_iterate_condition(current_link, 0, 0);/*    }*/
    |    "{" digit+ ("," digit*)? "}"
        {
        long _first = atol($2), _second;
        if (!$4.empty())
            _second = atol($7);
        else
            _second = _first;
        if (_second > (_first + 0x100))
            {
            std::cerr << $file << ':' << $line << ": warning: a large finite iteration range [ " << _first << " -> " << _second << " ] can use excessive stack space, consider unbounding the range" << std::endl;
            }
        current_link = tree.add_iterate_condition(current_link, _first, _second);
        }

Composition Locate in Contents

regexp_compound_first regexp_modifier Alternation Node regexp_compound '?' '+' '*' Concatenation Node '{' Concatenation Node Alternation Node '}' digit Iteration Node Concatenation Node @ digit ',' Iteration Node digit

State Machine Locate in Contents

start:927:$0 final:928:$0 digit|{930|$7|931} digit|{930|$7|931} digit|{930|$7|931} digit|{930|$12|931} digit|{930|$12|931}