boolop :: '+' | ',' extname :: Char(alphas) atom :: extname | '(' expr ')' expr :: atom [ boolop atom ]*
()
| 131 | # BNF grammar for depends expressions |
| 132 | _bnf = None |
| 133 | def dependencyBNF(): |
| 134 | """ |
| 135 | boolop :: '+' | ',' |
| 136 | extname :: Char(alphas) |
| 137 | atom :: extname | '(' expr ')' |
| 138 | expr :: atom [ boolop atom ]* |
| 139 | """ |
| 140 | global _bnf |
| 141 | if _bnf is None: |
| 142 | and_, or_ = map(Literal, '+,') |
| 143 | lpar, rpar = map(Suppress, '()') |
| 144 | boolop = and_ | or_ |
| 145 | |
| 146 | expr = Forward() |
| 147 | expr_list = DelimitedList(Group(expr)) |
| 148 | atom = ( |
| 149 | boolop[...] |
| 150 | + ( |
| 151 | (dependencyIdent).set_parse_action(push_first) |
| 152 | | Group(lpar + expr + rpar) |
| 153 | ) |
| 154 | ) |
| 155 | |
| 156 | expr <<= atom + (boolop + atom).set_parse_action(push_first)[...] |
| 157 | _bnf = expr |
| 158 | return _bnf |
| 159 | |
| 160 | |
| 161 | # Protect identifier: standard identifier optionally prefixed with '!' for negation |
no outgoing calls
no test coverage detected