32
loading...
This website collects cookies to deliver better user experience
RE_SEQ ::= '^'? GROUP ‘$'? ('|' RE_SEQ)?
in which two non-terminals appear on the right side, RANGE_EL
and RE_SEQ
itself. In this case, the function corresponding to the non-terminals RANGE_EL
and RE_SEQ
itself can be called, hence the recursion.every node has one parent, except for the root node
nodes can have zero or more children
if a node does not have children, it is called a **leaf **node.
get_range_str
when we will parse range elements ([a-m|0-3]) to get the number/letters contained in a given range.next_tkn_initializer
is a closure returning a function that, when called, set the current token to the next one to parse. Although not fundamental, this function is very convenient, as you will notice.? * +
will be parsed inside parse_group for simplicity and the only quantifiers needing a special treatment are only that specified with the curly brace syntax {3} {2,3} {3,} {,3}
).