parent_start_conditions,
continued_action
):
- section.code_blocks_text.append(self[0])
+ section.code_blocks_text.append(self.children[0])
return continued_action
@method(AST.Section1Or2)
def post_process(
):
parent_start_conditions = set()
continued_action = False
- for i in self:
+ for i in self.children:
continued_action = i.post_process(
_ast,
self,
section.ecs = self.value
@method(AST.Section1.Options.ExtraType)
def post_process(self, section):
- section.extra_type = self[0][0].get_text()
+ section.extra_type = self.children[0].children[0].get_text()
@method(AST.Section1.Options.Fast)
def post_process(self, section):
section.fast = self.value
section.full = self.value
@method(AST.Section1.Options.HeaderFile)
def post_process(self, section):
- section.header_file = self[0][0].get_text()
+ section.header_file = self.children[0].children[0].get_text()
@method(AST.Section1.Options.Input)
def post_process(self, section):
section.input = self.value
section.never_interactive = self.value
@method(AST.Section1.Options.OutFile)
def post_process(self, section):
- section.outfile = self[0][0].get_text()
+ section.outfile = self.children[0].children[0].get_text()
@method(AST.Section1.Options.PerfReport)
def post_process(self, section):
section.perf_report = self.value
section.posix_compat = self.value
@method(AST.Section1.Options.Prefix)
def post_process(self, section):
- section.prefix = self[0][0].get_text()
+ section.prefix = self.children[0].children[0].get_text()
@method(AST.Section1.Options.Read)
def post_process(self, section):
section.read = self.value
section.stdout = self.value
@method(AST.Section1.Options.TablesFile)
def post_process(self, section):
- section.tables_file = self[0][0].get_text()
+ section.tables_file = self.children[0].children[0].get_text()
@method(AST.Section1.Options.TablesVerify)
def post_process(self, section):
section.tables_verify = self.value
section.yyalloc = self.value
@method(AST.Section1.Options.YYClass)
def post_process(self, section):
- section.yyclass = self[0][0].get_text()
+ section.yyclass = self.children[0].children[0].get_text()
@method(AST.Section1.Options.YYFree)
def post_process(self, section):
section.yyfree = self.value
parent_start_conditions,
continued_action
):
- for i in self:
+ for i in self.children:
i.post_process(section)
return continued_action
@method(AST.Section1.StartConditions)
parent_start_conditions,
continued_action
):
- for i in self:
+ for i in self.children:
name = i.get_text()
assert name not in name_to_start_condition
name_to_start_condition[name] = len(_ast.start_conditions)
continued_action
):
assert not continued_action
- if self[0].wildcard:
+ if self.children[0].wildcard:
start_conditions = all_start_conditions
else:
start_conditions = set(parent_start_conditions)
- for i in self[0]:
+ for i in self.children[0].children:
start_conditions.add(
name_to_start_condition[i.get_text()]
)
- for i in self[1:]:
+ for i in self.children[1:]:
continued_action = i.post_process(
_ast,
section,
len(_ast.eof_actions_text)
)
assert not action.continued
- _ast.eof_actions_text.append(action[0])
+ _ast.eof_actions_text.append(action.children[0])
return False # continued_action
@method(AST.Section2.Rule.FLexRule)
def post_process(
_ast.start_conditions[i].rules.append(self)
_ast.start_conditions[i].bol_rules.append(self)
self.groups0 = []
- self[0].post_process(
+ self.children[0].post_process(
self.groups0,
- caseless = _ast[0].caseless
+ caseless = _ast.children[0].caseless
) # regex
self.groups1 = []
- self[1].post_process(
+ self.children[1].post_process(
self.groups1,
- caseless = _ast[0].caseless
+ caseless = _ast.children[0].caseless
) # trailing context regex
self.action = len(_ast.actions_text)
if action.continued:
continued_action = True
else:
- _ast.actions_text.append(action[0])
+ _ast.actions_text.append(action.children[0])
continued_action = False
#def to_text(node):
# return ''.join(
# ] +
# [element.get_text(node, len(node))]
# )
- #text = '{0:s}/{1:s}'.format(to_text(self[0]), to_text(self[1]))
+ #text = '{0:s}/{1:s}'.format(to_text(self.children[0]), to_text(self.children[1]))
#element.set_text(
# _ast.actions_text[-1],
# 0,
parent_start_conditions,
continued_action
):
- if self[0].wildcard:
+ if self.children[0].wildcard:
start_conditions = all_start_conditions
else:
start_conditions = set(parent_start_conditions)
- for i in self[0]:
+ for i in self.children[0].children:
start_conditions.add(
name_to_start_condition[i.get_text()]
)
- return self[1].post_process(
+ return self.children[1].post_process(
_ast,
section,
name_to_start_condition,
parent_start_conditions,
continued_action,
start_conditions,
- self[2] # action
+ self.children[2] # action
)
@method(AST)
def post_process(self):
all_start_conditions = set([0])
inclusive_start_conditions = set([0])
# perform the semantic analysis pass
- self[0].post_process(
+ self.children[0].post_process(
self,
name_to_start_condition,
all_start_conditions,
inclusive_start_conditions
)
- self[1].post_process(
+ self.children[1].post_process(
self,
name_to_start_condition,
all_start_conditions,
AST.Text(
text = (
'ECHO;\n'
- if self[0].default else
+ if self.children[0].default else
'YY_FATAL_ERROR( "flex scanner jammed" );\n'
)
)
regex_group_ref_data = []
for k in j:
ng = _regex.n_groups
- ng0 = k[0].n_groups
- ng1 = k[1].n_groups
+ ng0 = k.children[0].n_groups
+ ng1 = k.children[1].n_groups
_regex = regex.RegexOr(
children = [
_regex,
regex.RegexSequence(
children = [
- k[0],
+ k.children[0],
regex.RegexGroup(
children = [
- k[1]
+ k.children[1]
],
n_groups = 1 + ng1
)
@method(Regex)
def post_process(self, groups, caseless = False):
self.n_groups = 0
- for i in self:
+ for i in self.children:
i.post_process(groups, caseless)
self.n_groups += i.n_groups
@method(RegexCharacter)
@method(RegexCharacterRange)
def post_process(self, groups, caseless = False):
RegexCharacter.post_process(self, groups, False)
- self.character_set = [self[0].character_set[0], self[1].character_set[-1]]
+ self.character_set = [self.children[0].character_set[0], self.children[1].character_set[-1]]
if caseless:
temp = bisect_set.bisect_set_and(
self.character_set,
def post_process(self, groups, caseless = False):
RegexCharacter.post_process(self, groups, caseless)
self.character_set = bisect_set.bisect_set_or(
- self[0].character_set,
- self[1].character_set
+ self.children[0].character_set,
+ self.children[1].character_set
)
@method(RegexCharacterAnd)
def post_process(self, groups, caseless = False):
RegexCharacter.post_process(self, groups, caseless)
self.character_set = bisect_set.bisect_set_and(
- self[0].character_set,
- self[1].character_set
+ self.children[0].character_set,
+ self.children[1].character_set
)
@method(RegexCharacterNot)
def post_process(self, groups, caseless = False):
RegexCharacter.post_process(self, groups, caseless)
- self.character_set = bisect_set.bisect_set_not(self[0].character_set)
+ self.character_set = bisect_set.bisect_set_not(self.children[0].character_set)
@method(RegexRepeat)
def post_process(self, groups, caseless = False):
# total hack which will be done in a Python action in future
- if len(self) >= 2:
- assert self[1].tag == 'Number'
- self.count0 = int(self[1].text)
- if len(self) >= 3:
- assert self[2].tag == 'Number'
- self.count1 = int(self[2].text)
+ if len(self.children) >= 2:
+ assert self.children[1].tag == 'Number'
+ self.count0 = int(self.children[1].text)
+ if len(self.children) >= 3:
+ assert self.children[2].tag == 'Number'
+ self.count1 = int(self.children[2].text)
else:
self.count1 = self.count0
- del self[1:]
+ del self.children[1:]
# end total hack
Regex.post_process(self, groups, caseless)
@method(RegexGroup)
def post_process(self, groups, caseless = False):
- # we use -1 here because named or action groups use self[0] for text
+ # we use -1 here because named or action groups use self.children[0] for text
groups.append(self)
- self[-1].post_process(groups, caseless)
- self.n_groups = self[-1].n_groups + 1
+ self.children[-1].post_process(groups, caseless)
+ self.n_groups = self.children[-1].n_groups + 1
del post_process
@method(Regex)
return new_state
@method(RegexOr)
def to_nfa_state(self, _nfa, group_ref_data, group_index, next_state):
- child0_state = self[0].to_nfa_state(
+ child0_state = self.children[0].to_nfa_state(
_nfa,
group_ref_data,
group_index,
next_state
)
- child1_state = self[1].to_nfa_state(
+ child1_state = self.children[1].to_nfa_state(
_nfa,
group_ref_data,
- group_index + self[0].n_groups,
+ group_index + self.children[0].n_groups,
next_state
)
if child0_state == -1:
_nfa.states.append(nfa.NFA.join0_state) # no arguments so use static one
join1_state = len(_nfa.states)
_nfa.states.append((nfa.NFA.STATE_JOIN1, next_state))
- child0_state = self[0].to_nfa_state(
+ child0_state = self.children[0].to_nfa_state(
_nfa,
group_ref_data,
group_index,
)
if child0_state == -1:
return -1
- child1_state = self[1].to_nfa_state(
+ child1_state = self.children[1].to_nfa_state(
_nfa,
group_ref_data,
- group_index + self[0].n_groups,
+ group_index + self.children[0].n_groups,
join1_state
)
if child1_state == -1:
return new_state
@method(RegexSequence)
def to_nfa_state(self, _nfa, group_ref_data, group_index, next_state):
- next_state = self[1].to_nfa_state(
+ next_state = self.children[1].to_nfa_state(
_nfa,
group_ref_data,
- group_index + self[0].n_groups,
+ group_index + self.children[0].n_groups,
next_state
)
if next_state == -1:
return -1
- return self[0].to_nfa_state(
+ return self.children[0].to_nfa_state(
_nfa,
group_ref_data,
group_index,
if count1 == -1:
new_state = len(_nfa.states)
_nfa.states.append(None)
- child_state = self[0].to_nfa_state(
+ child_state = self.children[0].to_nfa_state(
_nfa,
group_ref_data,
group_index,
else:
done_state = next_state
for i in range(count1 - count0):
- child_state = self[0].to_nfa_state(
+ child_state = self.children[0].to_nfa_state(
_nfa,
group_ref_data,
group_index,
)
next_state = new_state
for i in range(count0):
- next_state = self[0].to_nfa_state(
+ next_state = self.children[0].to_nfa_state(
_nfa,
group_ref_data,
group_index,
(nfa.NFA.STATE_MARK, group_ref_data[group_index][1], next_state)
)
next_state = new_state
- next_state = self[-1].to_nfa_state(
+ next_state = self.children[-1].to_nfa_state(
_nfa,
group_ref_data,
group_index + 1,
(?E{t_def.AST.Section1.Options.SevenBit}("no"*)7bit) {
option_sense = (len(yy_groups[2]) & 2) == 0
#csize = 128 if option_sense else 256
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.SevenBit}("no"*)8bit) {
option_sense = (len(yy_groups[2]) & 2) == 0
#csize = 256 if option_sense else 128
- yy_element_token[0].value = not option_sense
+ yy_element_token.children[0].value = not option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Align}("no"*)align) {
option_sense = (len(yy_groups[2]) & 2) == 0
#long_align = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.AlwaysInteractive}("no"*)always-interactive) {
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_ALWAYS_INTERACTIVE')
#interactive = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Array}("no"*)array) {
option_sense = (len(yy_groups[2]) & 2) == 0
#yytext_is_array = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Backup}("no"*)backup) {
option_sense = (len(yy_groups[2]) & 2) == 0
#backing_up_report = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Interactive}("no"*)batch) {
option_sense = (len(yy_groups[2]) & 2) == 0
#interactive = not option_sense
- yy_element_token[0].value = not option_sense
+ yy_element_token.children[0].value = not option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.BisonBridge}("no"*)bison-bridge) {
option_sense = (len(yy_groups[2]) & 2) == 0
#bison_bridge_lval = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.BisonLocations}("no"*)bison-locations) {
option_sense = (len(yy_groups[2]) & 2) == 0
#if bison_bridge_lloc = option_sense:
# bison_bridge_lval = True
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.CPlusPlus}("no"*)"c++") {
option_sense = (len(yy_groups[1]) & 2) == 0
#C_plus_plus = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Caseless}("no"*)caseful|case-sensitive) {
state._sf_stk[-1] |= 1
else:
state._sf_stk[-1] &= ~1
- yy_element_token[0].value = not option_sense
+ yy_element_token.children[0].value = not option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Caseless}("no"*)caseless|case-insensitive) {
state._sf_stk[-1] |= 1
else:
state._sf_stk[-1] &= ~1
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Debug}("no"*)debug) {
option_sense = (len(yy_groups[2]) & 2) == 0
#ddebug = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Default}("no"*)default) {
option_sense = (len(yy_groups[2]) & 2) == 0
#spprdflt = not option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.ECS}("no"*)ecs) {
option_sense = (len(yy_groups[2]) & 2) == 0
#useecs = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Fast}("no"*)fast) {
option_sense = (len(yy_groups[2]) & 2) == 0
#useecs = usemecs = False
#use_read = fullspd = True
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Full}("no"*)full) {
option_sense = (len(yy_groups[2]) & 2) == 0
#useecs = usemecs = False
#use_read = fulltbl = True
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Input}("no"*)input) {
option_sense = (len(yy_groups[2]) & 2) == 0
#if not option_sense:
# action_define('YY_NO_INPUT', 1)
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Interactive}("no"*)interactive) {
option_sense = (len(yy_groups[2]) & 2) == 0
#interactive = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.LexCompat}("no"*)lex-compat) {
option_sense = (len(yy_groups[2]) & 2) == 0
state.lex_compat = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.PosixCompat}("no"*)posix-compat) {
option_sense = (len(yy_groups[2]) & 2) == 0
state.posix_compat = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Line}("no"*)line) {
option_sense = (len(yy_groups[2]) & 2) == 0
#gen_line_dirs = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Main}("no"*)main) {
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_MAIN')
#if option_sense:
# do_yywrap = False
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.MetaECS}("no"*)meta-ecs) {
option_sense = (len(yy_groups[2]) & 2) == 0
#usemecs = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.NeverInteractive}("no"*)never-interactive) {
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NEVER_INTERACTIVE')
#interactive = not option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.PerfReport}("no"*)perf-report) {
option_sense = (len(yy_groups[2]) & 2) == 0
#performance_report += 1 if option_sense else -1
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Array}("no"*)pointer) {
option_sense = (len(yy_groups[2]) & 2) == 0
#yytext_is_array = not option_sense
- yy_element_token[0].value = not option_sense
+ yy_element_token.children[0].value = not option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Read}("no"*)read) {
option_sense = (len(yy_groups[2]) & 2) == 0
#use_read = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Reentrant}("no"*)reentrant) {
option_sense = (len(yy_groups[2]) & 2) == 0
#reentrant = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Reject}("no"*)reject) {
option_sense = (len(yy_groups[2]) & 2) == 0
#reject_really_used = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Stack}("no"*)stack) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_STACK_USED', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_STACK_USED')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.StdInit}("no"*)stdinit) {
option_sense = (len(yy_groups[2]) & 2) == 0
#do_stdinit = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.StdOut}("no"*)stdout) {
option_sense = (len(yy_groups[2]) & 2) == 0
#use_stdout = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.UniStd}("no"*)unistd) {
option_sense = (len(yy_groups[2]) & 2) == 0
#if not option_sense:
# action_define('YY_NO_UNISTD_H', 1)
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Unput}("no"*)unput) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_UNPUT', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_UNPUT')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Verbose}("no"*)verbose) {
option_sense = (len(yy_groups[2]) & 2) == 0
#printstats = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.Warn}("no"*)warn) {
option_sense = (len(yy_groups[2]) & 2) == 0
#nowarn = not option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYLineNo}("no"*)yylineno) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_USE_LINENO', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_USE_LINENO')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYMore}("no"*)yymore) {
option_sense = (len(yy_groups[2]) & 2) == 0
#yymore_really_used = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYWrap}("no"*)yywrap) {
option_sense = (len(yy_groups[2]) & 2) == 0
#do_yywrap = option_sense
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_PUSH_STATE', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_PUSH_STATE')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYPopState}("no"*)yy_pop_state) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_POP_STATE', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_POP_STATE')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYTopState}("no"*)yy_top_state) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_TOP_STATE', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_TOP_STATE')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_SCAN_BUFFER', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_SCAN_BUFFER')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYScanBytes}("no"*)yy_scan_bytes) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_SCAN_BYTES', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_SCAN_BYTES')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYScanString}("no"*)yy_scan_string) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_SCAN_STRING', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_SCAN_STRING')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_FLEX_ALLOC', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_FLEX_ALLOC')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYRealloc}("no"*)yyrealloc) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_FLEX_REALLOC', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_FLEX_REALLOC')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYFree}("no"*)yyfree) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_FLEX_FREE', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_FLEX_FREE')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_GET_DEBUG', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_GET_DEBUG')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYSetDebug}("no"*)yyset_debug) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_SET_DEBUG', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_SET_DEBUG')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYGetExtra}("no"*)yyget_extra) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_GET_EXTRA', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_GET_EXTRA')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYSetExtra}("no"*)yyset_extra) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_SET_EXTRA', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_SET_EXTRA')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYGetLeng}("no"*)yyget_leng) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_GET_LENG', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_GET_LENG')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYGetText}("no"*)yyget_text) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_GET_TEXT', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_GET_TEXT')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYGetLineNo}("no"*)yyget_lineno) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_GET_LINENO', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_GET_LINENO')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYSetLineNo}("no"*)yyset_lineno) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_SET_LINENO', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_SET_LINENO')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYGetIn}("no"*)yyget_in) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_GET_IN', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_GET_IN')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYSetIn}("no"*)yyset_in) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_SET_IN', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_SET_IN')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYGetOut}("no"*)yyget_out) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_GET_OUT', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_GET_OUT')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYSetOut}("no"*)yyset_out) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_SET_OUT', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_SET_OUT')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYGetLVal}("no"*)yyget_lval) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_GET_LVAL', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_GET_LVAL')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYSetLVal}("no"*)yyset_lval) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_SET_LVAL', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_SET_LVAL')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYGetLLoc}("no"*)yyget_lloc) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_GET_LLOC', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_GET_LLOC')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
(?E{t_def.AST.Section1.Options.YYSetLLoc}("no"*)yyset_lloc) {
# buf_m4_define(&m4defs_buf, 'M4' '_YY_NO_SET_LLOC', None)
#else:
# buf_m4_undefine(&m4defs_buf, 'M4' '_YY_NO_SET_LLOC')
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
#tablesverify = option_sense
#if not tablesext and option_sense:
# tablesext = True
- yy_element_token[0].value = option_sense
+ yy_element_token.children[0].value = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
# try to use more complex regular expressions to match all in one go:
def markup_flush(n):
- assert len(yy_element_space.text) == len(yy_element_space) + 1
- assert len(yy_element_token.text) == len(yy_element_token) + 1
+ assert len(yy_element_space.text) == len(yy_element_space.children) + 1
+ assert len(yy_element_token.text) == len(yy_element_token.children) + 1
yy_element_space.text[-1] += yy_element_token.text[0][:n]
yy_element_token.text[0] = yy_element_token.text[0][n:]
def markup_yyless(n):
- assert len(yy_element_space.text) == len(yy_element_space) + 1
- assert len(yy_element_token.text) == len(yy_element_token) + 1
+ assert len(yy_element_space.text) == len(yy_element_space.children) + 1
+ assert len(yy_element_token.text) == len(yy_element_token.children) + 1
yyless(n)
yy_element_token.text[0] = yy_element_token.text[0][:n]
def markup_push(factory, *args, **kwargs):
global yy_element_space
- assert len(yy_element_space.text) == len(yy_element_space) + 1
- assert len(yy_element_token.text) == len(yy_element_token) + 1
+ assert len(yy_element_space.text) == len(yy_element_space.children) + 1
+ assert len(yy_element_token.text) == len(yy_element_token.children) + 1
markup_stack.append(yy_element_space)
yy_element_space = factory(*args, **kwargs)
def markup_pop():
global yy_element_space
- assert len(yy_element_space.text) == len(yy_element_space) + 1
- assert len(yy_element_token.text) == len(yy_element_token) + 1
+ assert len(yy_element_space.text) == len(yy_element_space.children) + 1
+ assert len(yy_element_token.text) == len(yy_element_token.children) + 1
_element = yy_element_space
yy_element_space = markup_stack.pop()
- yy_element_space.append(_element)
+ yy_element_space.children.append(_element)
yy_element_space.text.append('')