moved common grammar to separate file
This commit is contained in:
parent
c66e8fe3eb
commit
632e908f95
3 changed files with 25 additions and 35 deletions
|
|
@ -1,17 +1,6 @@
|
|||
from arpeggio.cleanpeg import ParserPEG
|
||||
|
||||
grammar = """
|
||||
job_shop2 = problem_data EOF
|
||||
problem_data = trim_ws num_jobs ' ' num_machines eol job_data+
|
||||
trim_ws = r'[ \t]*'
|
||||
eol = "\n" / "\r\n"
|
||||
nonneg_num = r'\d+'
|
||||
num_jobs = nonneg_num
|
||||
num_machines = nonneg_num
|
||||
machine = nonneg_num
|
||||
duration = nonneg_num
|
||||
job_data = ' '* machine ' '+ duration (' '+ machine ' '+ duration)* trim_ws eol
|
||||
"""
|
||||
from common import grammar
|
||||
|
||||
parser = ParserPEG(grammar, "problem_data", skipws=False,debug=True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue