parent_start_conditions,
continued_action
):
- raise NotImplementedException
+ raise NotImplementedError
class PLex(element.Element):
# internal classes
return 'ast.PLex.Section1.Options.Option({0:s})'.format(', '.join(params))
# GENERATE END
def post_process(self, section):
- raise NotImplementedException
+ raise NotImplementedError
class BoolOption(Option):
# GENERATE ELEMENT(bool value) BEGIN
outfile = '',
perf_report = False,
posix_compat = False,
- prefix = '',
+ prefix = 'yy',
read = False,
reentrant = False,
reject = False,
sys.stderr.write('warning: ignoring %option meta-ecs\n')
if self.never_interactive:
sys.stderr.write('warning: ignoring %option never-interactive\n')
- if len(self.outfile):
- sys.stderr.write('warning: ignoring %option outfile\n')
+ #if len(self.outfile):
+ # sys.stderr.write('warning: ignoring %option outfile\n')
if self.perf_report:
sys.stderr.write('warning: ignoring %option perf-report\n')
if self.posix_compat:
sys.stderr.write('warning: ignoring %option posix-compat\n')
- if len(self.prefix):
- sys.stderr.write('warning: ignoring %option prefix\n')
+ #if self.prefix != 'yy':
+ # sys.stderr.write('warning: ignoring %option prefix\n')
if self.read:
sys.stderr.write('warning: ignoring %option read\n')
if self.reentrant:
plex[0].out_file
if len(plex[0].outfile) else
'lex.{0:s}.c'.format(plex[0].prefix)
- if len(plex[0].prefix) else
- 'lex.yy.c'
)
with open(skel_file, 'r') as fin:
with open(out_file, 'w+') as fout:
{0:s}/* GENERATE END */
'''.format(
''
- if len(plex[0].prefix) == 0 else
+ if plex[0].prefix == 'yy' else
''.join(
[
'#define yy{0:s} {1:s}{2:s}\n'.format(
'''.format(
''
if plex[0].yywrap else
- '''#define yywrap() (/*CONSTCOND*/1)
+ '''#define {0:s}wrap() (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
-'''
+'''.format(
+ plex[0].prefix
+ )
)
)
elif line == '/* GENERATE TABLES */\n':
)
)
else:
+ if plex[0].prefix != 'yy':
+ line = line.replace('yywrap', '{0:s}wrap'.format(plex[0].prefix))
fout.write(line)
line = fin.readline()
for i in self:
i.add_to_groups(groups)
def to_nfa_state(self, _nfa, next_state):
- raise NotImplementedException
+ raise NotImplementedError
def add_to_nfa(self, _nfa):
_nfa.start_state.append(self.to_nfa_state(_nfa, 0))