grammar now matches Jobshop1 without prefix
- grammar matches, but result not yet evaluated
This commit is contained in:
parent
309664a36a
commit
0d1a38caa9
3 changed files with 2274 additions and 20 deletions
|
|
@ -1,7 +1,8 @@
|
|||
from arpeggio.cleanpeg import ParserPEG
|
||||
|
||||
grammar = """
|
||||
problem_data = trim_ws num_jobs ' ' num_machines eol job_data+ EOF
|
||||
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+'
|
||||
|
|
@ -12,7 +13,7 @@ duration = nonneg_num
|
|||
job_data = ' '* machine ' '+ duration (' '+ machine ' '+ duration)* trim_ws eol
|
||||
"""
|
||||
|
||||
parser = ParserPEG(grammar, "problem_data", skipws=False)
|
||||
parser = ParserPEG(grammar, "problem_data", skipws=False,debug=True)
|
||||
|
||||
with open('./inputdata/jobshop2/ta13') as jobdatafile:
|
||||
jobdata : str = jobdatafile.read()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue