From 1b29f313db0b6b4cb877adc1d732d5c8d78af458 Mon Sep 17 00:00:00 2001 From: Scott Frazer Date: Mon, 25 Jan 2016 15:43:10 -0500 Subject: [PATCH] fixing parser, bump version --- grammar.hgr | 4 +- setup.py | 2 +- wdl/parser.py | 3516 ++++++++++++++++++++++++++++----------------------------- 3 files changed, 1761 insertions(+), 1761 deletions(-) diff --git a/grammar.hgr b/grammar.hgr index fd51c9c..752ab8e 100644 --- a/grammar.hgr +++ b/grammar.hgr @@ -217,11 +217,11 @@ grammar { for regex, c in ctx.user_context['replacements'].items(): source_string = regex.sub(chr(c), source_string) - source_string = source_string.replace("\u005C\u005C", "\u005C") + source_string = source_string.replace("\\\\", "\\") for regex, base in ctx.user_context['escapes'].items(): for escape_sequence, number in regex.findall(source_string): - source_string = source_string.replace(escape_sequence, chr(int(number, base))) + source_string = source_string.replace(escape_sequence, unichr(int(number, base))) default_action(ctx, terminal, source_string[1:-1], line, col) PYTHON diff --git a/setup.py b/setup.py index 3c9aef1..2bfe536 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -version = '1.0.21' +version = '1.0.22' long_description = 'Parse and Process WDL Files' setup( diff --git a/wdl/parser.py b/wdl/parser.py index ec7f5f2..444ebb5 100644 --- a/wdl/parser.py +++ b/wdl/parser.py @@ -1,5 +1,5 @@ -# This file was generated by Hermes Parser Generator on Fri Jan 22 15:49:36 2016 +# This file was generated by Hermes Parser Generator on Mon Jan 25 15:41:22 2016 # # Hermes command: hermes generate grammar.hgr --name=wdl --directory=wdl --header # Run from: .. (relative to this file) @@ -254,714 +254,709 @@ def __init__(self, tokens, errors): self.rule_string = None # Parser Code # terminals = { - 0: 'double_pipe', - 1: 'runtime', - 2: 'dot', - 3: 'integer', - 4: 'raw_cmd_start', - 5: 'input', - 6: 'cmd_param_start', - 7: 'double_equal', - 8: 'percent', - 9: 'plus', - 10: 'lparen', - 11: 'double_ampersand', - 12: 'while', - 13: 'slash', - 14: 'lbrace', - 15: 'comma', - 16: 'cmd_attr_hint', - 17: 'identifier', - 18: 'not', - 19: 'lsquare', - 20: 'cmd_param_end', - 21: 'e', - 22: 'colon', - 23: 'raw_command', - 24: 'lt', - 25: 'rsquare', - 26: 'type', - 27: 'fqn', - 28: 'float', - 29: 'if', - 30: 'meta', - 31: 'workflow', - 32: 'dash', - 33: 'qmark', - 34: 'as', - 35: 'rparen', - 36: 'rbrace', - 37: 'asterisk', - 38: 'type_e', + 0: 'type', + 1: 'object', + 2: 'cmd_attr_hint', + 3: 'raw_cmd_start', + 4: 'type_e', + 5: 'raw_command', + 6: 'cmd_param_end', + 7: 'import', + 8: 'task', + 9: 'workflow', + 10: 'in', + 11: 'double_pipe', + 12: 'runtime', + 13: 'if', + 14: 'double_ampersand', + 15: 'equal', + 16: 'not_equal', + 17: 'lt', + 18: 'call', + 19: 'meta', + 20: 'scatter', + 21: 'as', + 22: 'lteq', + 23: 'dash', + 24: 'cmd_part', + 25: 'lsquare', + 26: 'float', + 27: 'integer', + 28: 'raw_cmd_end', + 29: 'asterisk', + 30: 'percent', + 31: 'colon', + 32: 'input', + 33: 'rbrace', + 34: 'while', + 35: 'cmd_param_start', + 36: 'slash', + 37: 'dot', + 38: 'qmark', 39: 'parameter_meta', - 40: 'not_equal', - 41: 'string', - 42: 'raw_cmd_end', - 43: 'lteq', - 44: 'scatter', - 45: 'gt', - 46: 'output', - 47: 'task', - 48: 'call', - 49: 'object', - 50: 'in', - 51: 'boolean', - 52: 'gteq', - 53: 'equal', - 54: 'cmd_part', - 55: 'import', - 'double_pipe': 0, - 'runtime': 1, - 'dot': 2, - 'integer': 3, - 'raw_cmd_start': 4, - 'input': 5, - 'cmd_param_start': 6, - 'double_equal': 7, - 'percent': 8, - 'plus': 9, - 'lparen': 10, - 'double_ampersand': 11, - 'while': 12, - 'slash': 13, - 'lbrace': 14, - 'comma': 15, - 'cmd_attr_hint': 16, - 'identifier': 17, - 'not': 18, - 'lsquare': 19, - 'cmd_param_end': 20, - 'e': 21, - 'colon': 22, - 'raw_command': 23, - 'lt': 24, - 'rsquare': 25, - 'type': 26, - 'fqn': 27, - 'float': 28, - 'if': 29, - 'meta': 30, - 'workflow': 31, - 'dash': 32, - 'qmark': 33, - 'as': 34, - 'rparen': 35, - 'rbrace': 36, - 'asterisk': 37, - 'type_e': 38, + 40: 'output', + 41: 'boolean', + 42: 'lbrace', + 43: 'comma', + 44: 'fqn', + 45: 'rparen', + 46: 'gteq', + 47: 'identifier', + 48: 'lparen', + 49: 'string', + 50: 'rsquare', + 51: 'plus', + 52: 'double_equal', + 53: 'gt', + 54: 'not', + 55: 'e', + 'type': 0, + 'object': 1, + 'cmd_attr_hint': 2, + 'raw_cmd_start': 3, + 'type_e': 4, + 'raw_command': 5, + 'cmd_param_end': 6, + 'import': 7, + 'task': 8, + 'workflow': 9, + 'in': 10, + 'double_pipe': 11, + 'runtime': 12, + 'if': 13, + 'double_ampersand': 14, + 'equal': 15, + 'not_equal': 16, + 'lt': 17, + 'call': 18, + 'meta': 19, + 'scatter': 20, + 'as': 21, + 'lteq': 22, + 'dash': 23, + 'cmd_part': 24, + 'lsquare': 25, + 'float': 26, + 'integer': 27, + 'raw_cmd_end': 28, + 'asterisk': 29, + 'percent': 30, + 'colon': 31, + 'input': 32, + 'rbrace': 33, + 'while': 34, + 'cmd_param_start': 35, + 'slash': 36, + 'dot': 37, + 'qmark': 38, 'parameter_meta': 39, - 'not_equal': 40, - 'string': 41, - 'raw_cmd_end': 42, - 'lteq': 43, - 'scatter': 44, - 'gt': 45, - 'output': 46, - 'task': 47, - 'call': 48, - 'object': 49, - 'in': 50, - 'boolean': 51, - 'gteq': 52, - 'equal': 53, - 'cmd_part': 54, - 'import': 55, + 'output': 40, + 'boolean': 41, + 'lbrace': 42, + 'comma': 43, + 'fqn': 44, + 'rparen': 45, + 'gteq': 46, + 'identifier': 47, + 'lparen': 48, + 'string': 49, + 'rsquare': 50, + 'plus': 51, + 'double_equal': 52, + 'gt': 53, + 'not': 54, + 'e': 55, } # table[nonterminal][terminal] = rule table = [ - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 98, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, 102, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, 26, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, -1, -1, 28, -1, -1, -1, -1, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 101, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, 39, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, -1, 39, 39, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, 39, -1, -1, -1, -1, 39, 39, 39, -1, 39, -1, -1, 39, 39], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 100, -1, -1, -1, 99, -1, -1, -1, -1, -1, -1, 100, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 54, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 144, -1, -1, -1, -1, -1, -1, -1, -1, -1, 143, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, 1, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [60, -1, -1, -1, 60, 60, -1, -1, -1, -1, -1, -1, 60, 60, -1, 59, -1, -1, 60, 60, 60, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 60, 60, -1, -1, -1, -1, 60, 60, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, -1, -1, -1, 31, -1, -1, -1, -1, -1, -1, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 64, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [66, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, 66, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, 66, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 21, -1, -1, -1, -1, -1, 20, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [47, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, -1, -1, 67, -1, -1, -1, -1, -1, -1, 68, -1, 67, -1, -1, -1, -1, -1, 67, -1, 67, -1, 67, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1, -1, -1, 1], + [-1, -1, -1, -1, -1, 19, -1, -1, -1, -1, -1, -1, 19, -1, -1, -1, -1, -1, -1, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, 19, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 98, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [16, -1, -1, -1, 16, 17, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, 17, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [80, -1, -1, -1, 80, -1, -1, -1, -1, -1, -1, -1, -1, 80, -1, -1, -1, -1, 80, -1, 80, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 80, 80, -1, -1, -1, -1, -1, 80, -1, 79, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, 58, -1, -1, -1, 57, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 130, -1, 131, -1, -1, -1, -1, 131, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, 85, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, 5, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 138, -1, -1, -1, -1, -1, -1, -1, -1, -1, 137, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, 4, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, 89, -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 89, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, 21, -1, -1, 20, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, -1, -1, -1, -1, -1, -1, -1, -1, -1, 109, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 29, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 106, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 54, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, 57, -1, -1, -1, -1, -1, -1, -1, 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1], - [-1, -1, -1, 65, -1, -1, -1, -1, -1, 65, 65, -1, -1, -1, 65, -1, -1, 65, 65, 65, -1, 65, -1, -1, -1, -1, -1, -1, 65, -1, -1, -1, 65, -1, -1, -1, -1, -1, -1, -1, -1, 65, -1, -1, -1, -1, -1, -1, -1, 65, -1, 65, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 85, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, 38, 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 38, -1, 38, 38, 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 38, 38, -1, -1, -1, -1, 38, 38, 38, -1, 38, -1, -1, 38, 38], + [67, -1, -1, -1, 67, -1, -1, -1, -1, -1, -1, -1, -1, 67, -1, -1, -1, -1, 67, -1, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 68, 67, -1, -1, -1, -1, -1, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 90, 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 87, -1, -1, -1, -1, -1, -1, -1, -1], + [107, -1, -1, -1, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 110, -1, -1, -1, -1, -1], + [-1, 142, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 142, -1, 142, 142, 142, -1, -1, -1, -1, -1, 145, -1, -1, -1, -1, -1, -1, -1, 142, 142, -1, -1, -1, -1, 142, 142, 142, -1, 142, -1, -1, 142, 142], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 89, 89, -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [61, -1, -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 95, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [78, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, 78, -1, 78, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, 78, -1, -1, -1, -1, -1, 78, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [72, -1, -1, -1, 72, -1, -1, -1, -1, -1, -1, -1, -1, 74, -1, -1, -1, -1, 71, -1, 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, -1, -1, 76, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, 12, 12, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 106, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 139, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 136, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, 65, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, -1, 65, 65, 65, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, 65, -1, -1, -1, -1, 65, 65, 65, -1, 65, -1, -1, 65, 65], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, 8], - [-1, -1, -1, 38, -1, -1, -1, -1, -1, 38, 38, -1, -1, -1, 38, -1, 37, 38, 38, 38, -1, 38, -1, -1, -1, -1, -1, -1, 38, -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, 38, -1, 38, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, -1, 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 80, -1, 79, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 80, -1, -1, 80, -1, -1, -1, -1, -1, -1, 80, -1, 80, -1, -1, -1, -1, -1, 80, -1, 80, -1, 80, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 137, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 138, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, 142, -1, -1, -1, -1, -1, 142, 142, -1, -1, -1, 142, -1, -1, 142, 142, 142, -1, 142, -1, -1, -1, -1, -1, -1, 142, -1, -1, -1, 142, -1, -1, -1, 145, -1, -1, -1, -1, 142, -1, -1, -1, -1, -1, -1, -1, 142, -1, 142, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 23, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, -1, -1, -1, -1, -1, -1, 19, -1, -1, -1, -1, -1, 22, -1, -1, 19, -1, -1, -1, -1, -1, -1, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 95, -1, -1, -1, -1, -1, -1, -1, -1, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 136, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 139, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, -1, -1, 66, -1, -1, -1, -1, -1, -1, 69, -1, 66, -1, -1, -1, -1, -1, 66, -1, 66, -1, 66, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, -1, 74, -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, -1, 75, -1, 76, -1, 71, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 0], - [-1, 17, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, 16, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, 16, 17, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, 18, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, 15, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, 15, 18, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 130, -1, -1, -1, -1, -1, -1, -1, -1, -1, 131, -1, -1, -1, -1, -1, -1, -1, -1, -1, 131, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 143, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 144, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13], - [-1, -1, -1, 129, -1, -1, -1, -1, -1, 129, 129, -1, -1, -1, 129, -1, -1, 129, 129, 129, -1, 129, -1, -1, -1, 132, -1, -1, 129, -1, -1, -1, 129, -1, -1, 132, -1, -1, -1, -1, -1, 129, -1, -1, -1, -1, -1, -1, -1, 129, -1, 129, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, -1], - [-1, -1, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 100, -1, -1, -1, -1, -1, -1, -1, -1, 100, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, 39, -1, -1, -1, -1, -1, 39, 39, -1, -1, -1, 39, -1, 36, 39, 39, 39, -1, 39, -1, -1, -1, -1, -1, -1, 39, -1, -1, -1, 39, -1, -1, -1, -1, -1, -1, -1, -1, 39, -1, -1, -1, -1, -1, -1, -1, 39, -1, 39, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 110, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, 83, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, -1, -1, -1, -1, -1, -1, -1, 12], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, 78, -1, -1, -1, -1, 77, -1, 78, -1, 78, -1, -1, -1, -1, -1, 78, -1, 78, -1, 78, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 86, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 87, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 101, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], - [-1, 60, -1, -1, -1, 60, -1, -1, -1, -1, -1, -1, 60, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, -1, -1, 60, -1, -1, 60, 60, -1, -1, -1, -1, -1, 60, -1, 60, 60, -1, -1, -1, -1, 60, -1, 60, -1, 60, -1, -1, -1, -1, 59, -1, -1], + [15, -1, -1, -1, 15, 18, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, 18, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, 129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 129, -1, 129, 129, 129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 129, 129, -1, -1, 132, -1, 129, 129, 129, 132, 129, -1, -1, 129, 129], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [43, -1, -1, -1, 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 102, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 86, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, -1, -1, -1, -1, -1, -1, 109, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, 8, 8, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, 24, -1, -1, -1, -1, -1, -1, 26, -1, -1, -1, -1, -1, -1, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [42, -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, 0, 3, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [-1, -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], ] nonterminal_first = { - 56: [46], - 57: [2], - 58: [1, 39, 46, 23, 30], - 59: [44], - 60: [39], - 61: [6], - 62: [17, -1], - 63: [12, 38, 26, 29, 44, 48, 46, -1], - 64: [16], - 65: [34], - 66: [30], - 67: [17], - 68: [-1, 55], - 69: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 70: [15, -1], - 71: [46, 1, 30, 39, 23, -1], - 72: [15, -1], - 73: [1], - 74: [6, 54, -1], - 75: [47, 31], - 76: [17], - 77: [47, -1, 31], - 78: [17, -1], - 79: [5], - 80: [33, 9, -1], - 81: [34], - 82: [53], - 83: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 84: [-1, 5], - 85: [26, 38], - 86: [47, -1, 55, 31], - 87: [-1, 16], - 88: [26, -1, 38], - 89: [26, 38], - 90: [14, -1], - 91: [15, -1], - 92: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9, -1], - 93: [47], - 94: [46, 1, 30, 39, 23, -1], - 95: [47, -1, 31], - 96: [6, 54, -1], - 97: [17], - 98: [33, 9], - 99: [48], - 100: [27, -1], - 101: [17, -1], - 102: [12, 38, 26, 29, 44, 48, 46, -1], - 103: [12], - 104: [14], - 105: [29], - 106: [12, 44, 48, 46, 38, 26, 29], - 107: [-1, 55], - 108: [26, -1, 38], - 109: [26, -1, 38], - 110: [15, -1], - 111: [46], - 112: [15, -1], - 113: [55], - 114: [3, 28, 32, 10, -1, 14, 17, 18, 19, 41, 49, 21, 51, 9], - 115: [6, 54], - 116: [2, -1], - 117: [-1, 16], - 118: [26, -1, 38], - 119: [-1, 5], - 120: [23], - 121: [34, -1], - 122: [34, -1], - 123: [27, -1], - 124: [31], - 125: [14], - 126: [17, -1], - 127: [27], - 128: [26, 38], - 129: [26, -1, 38], - 130: [53, -1], + 56: [44], + 57: [-1, 2], + 58: [-1, 37], + 59: [-1, 47], + 60: [13], + 61: [-1, 32], + 62: [-1, 43], + 63: [-1, 7], + 64: [-1, 15], + 65: [8, 9], + 66: [-1, 24, 35], + 67: [38, 51], + 68: [47], + 69: [8], + 70: [20], + 71: [40, 0, 13, 34, 4, 18, -1, 20], + 72: [40, 5, 12, -1, 39, 19], + 73: [4, 0], + 74: [39], + 75: [40, 5, 12, -1, 39, 19], + 76: [40], + 77: [-1, 4, 0], + 78: [-1, 42], + 79: [-1, 38, 51], + 80: [21], + 81: [-1, 43], + 82: [-1, 32], + 83: [40], + 84: [-1, 8, 9], + 85: [-1, 43], + 86: [12], + 87: [34], + 88: [7], + 89: [9], + 90: [-1, 8, 9], + 91: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 92: [-1, 2], + 93: [40, 0, 13, 34, 4, 18, -1, 20], + 94: [-1, 47], + 95: [-1, 4, 0], + 96: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, -1, 23, 55], + 97: [42], + 98: [-1, 43], + 99: [4, 0], + 100: [-1, 47], + 101: [-1, 44], + 102: [21], + 103: [-1, 21], + 104: [40, 34, 4, 0, 13, 18, 20], + 105: [-1, 21], + 106: [47], + 107: [-1, 47], + 108: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 109: [-1, 24, 35], + 110: [4, 0], + 111: [-1, 4, 0], + 112: [15], + 113: [-1, 44], + 114: [25, 26, 27, 1, -1, 41, 42, 47, 54, 48, 49, 51, 23, 55], + 115: [47], + 116: [19], + 117: [24, 35], + 118: [-1, 4, 0], + 119: [37], + 120: [42], + 121: [-1, 43], + 122: [-1, 7, 9, 8], + 123: [40, 39, 19, 5, 12], + 124: [-1, 4, 0], + 125: [32], + 126: [35], + 127: [2], + 128: [-1, 7], + 129: [18], + 130: [5], } nonterminal_follow = { - 56: [12, 38, 36, 26, 29, 44, 48, 46], - 57: [27, 36], - 58: [46, 1, 36, 30, 39, 23], - 59: [12, 38, 36, 26, 29, 44, 48, 46], - 60: [1, 36, 39, 46, 30, 23], - 61: [6, 54, 42], - 62: [36], - 63: [36], - 64: [14, 3, 16, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 65: [12, 14, 38, 36, 26, 29, 44, 48, 46], - 66: [1, 36, 39, 46, 30, 23], - 67: [15, 36, 5], - 68: [47, -1, 31], - 69: [0, 1, 3, 5, 7, 8, 10, 11, 13, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 23, 25, 26, 28, 29, 32, 30, 35, 38, 37, 40, 36, 39, 41, 43, 44, 45, 49, 48, 46, 51, 52, 9], - 70: [36, 5], - 71: [36], - 72: [25], - 73: [1, 36, 39, 46, 30, 23], - 74: [42], - 75: [47, -1, 31], - 76: [15, 36], - 77: [-1], - 78: [36], - 79: [36, 5], - 80: [17], - 81: [47, -1, 55, 31], - 82: [1, 5, 26, 29, 30, 12, 38, 36, 39, 44, 48, 46, 23], - 83: [15, 36], - 84: [36], - 85: [17, 33, 9, 15, 25], - 86: [-1], - 87: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 88: [36], - 89: [12, 1, 38, 5, 26, 39, 36, 29, 44, 48, 46, 30, 23], - 90: [12, 38, 36, 26, 29, 44, 48, 46], - 91: [36], - 92: [36], - 93: [47, -1, 31], - 94: [36], - 95: [-1], - 96: [42], - 97: [17, 36], - 98: [17], - 99: [12, 38, 36, 26, 29, 44, 48, 46], - 100: [36], - 101: [36], - 102: [36], - 103: [12, 38, 36, 26, 29, 44, 48, 46], - 104: [1, 36, 39, 46, 30, 23], - 105: [12, 38, 36, 26, 29, 44, 48, 46], - 106: [12, 44, 48, 46, 38, 36, 26, 29], - 107: [47, -1, 31], - 108: [46, 1, 30, 5, 39, 23], - 109: [46, 1, 30, 5, 39, 23], - 110: [35, 25], - 111: [1, 36, 39, 46, 30, 23], - 112: [36], - 113: [47, -1, 55, 31], - 114: [35, 25], - 115: [6, 54, 42], - 116: [27, 36], - 117: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 118: [25], - 119: [36], - 120: [1, 36, 39, 46, 30, 23], - 121: [47, -1, 55, 31], - 122: [12, 14, 38, 36, 26, 29, 44, 48, 46], - 123: [36], - 124: [47, -1, 31], - 125: [12, 38, 36, 26, 29, 44, 48, 46], - 126: [36, 5], - 127: [27, 36], - 128: [26, 36, 38], - 129: [36], - 130: [1, 5, 26, 29, 30, 12, 38, 36, 39, 44, 48, 46, 23], + 56: [33, 44], + 57: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 58: [33, 44], + 59: [33], + 60: [40, 0, 13, 34, 4, 33, 18, 20], + 61: [33], + 62: [33], + 63: [8, -1, 9], + 64: [0, 32, 34, 4, 33, 5, 39, 40, 13, 12, 18, 19, 20], + 65: [8, -1, 9], + 66: [28], + 67: [47], + 68: [32, 43, 33], + 69: [8, -1, 9], + 70: [40, 0, 13, 34, 4, 33, 18, 20], + 71: [33], + 72: [33], + 73: [33, 4, 0], + 74: [40, 12, 33, 5, 19, 39], + 75: [33], + 76: [40, 0, 13, 34, 4, 33, 18, 20], + 77: [40, 32, 5, 12, 19, 39], + 78: [40, 0, 13, 34, 4, 33, 18, 20], + 79: [47], + 80: [40, 0, 42, 13, 34, 4, 33, 18, 20], + 81: [45, 50], + 82: [33], + 83: [40, 12, 33, 5, 19, 39], + 84: [-1], + 85: [33], + 86: [40, 12, 33, 5, 19, 39], + 87: [40, 0, 13, 34, 4, 33, 18, 20], + 88: [7, -1, 9, 8], + 89: [8, -1, 9], + 90: [-1], + 91: [0, 1, 2, 4, 5, 6, 11, 13, 12, 14, 16, 17, 18, 19, 22, 23, 20, 25, 26, 27, 29, 30, 31, 32, 36, 33, 34, 39, 40, 41, 42, 43, 45, 46, 47, 53, 52, 50, 51, 54, 48, 49, 55], + 92: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 93: [33], + 94: [32, 33], + 95: [50], + 96: [33], + 97: [40, 12, 33, 5, 19, 39], + 98: [32, 33], + 99: [40, 0, 13, 12, 32, 34, 4, 33, 5, 18, 19, 20, 39], + 100: [33], + 101: [33], + 102: [7, -1, 9, 8], + 103: [40, 0, 42, 13, 34, 4, 33, 18, 20], + 104: [40, 34, 4, 0, 33, 13, 18, 20], + 105: [7, -1, 9, 8], + 106: [43, 33], + 107: [33], + 108: [43, 33], + 109: [28], + 110: [38, 50, 43, 47, 51], + 111: [40, 32, 5, 12, 19, 39], + 112: [0, 32, 34, 4, 33, 5, 39, 40, 13, 12, 18, 19, 20], + 113: [33], + 114: [45, 50], + 115: [33, 47], + 116: [40, 12, 33, 5, 19, 39], + 117: [28, 24, 35], + 118: [33], + 119: [33, 44], + 120: [40, 0, 13, 34, 4, 33, 18, 20], + 121: [50], + 122: [-1], + 123: [40, 33, 5, 12, 19, 39], + 124: [33], + 125: [32, 33], + 126: [28, 24, 35], + 127: [41, 25, 42, 26, 27, 1, 2, 47, 54, 48, 49, 51, 23, 55], + 128: [8, -1, 9], + 129: [40, 0, 13, 34, 4, 33, 18, 20], + 130: [40, 12, 33, 5, 19, 39], } rule_first = { - 0: [55], - 1: [55], + 0: [7], + 1: [7], 2: [-1], 3: [-1], - 4: [47, 31], - 5: [47, 31], + 4: [8, 9], + 5: [8, 9], 6: [-1], 7: [-1], - 8: [47, -1, 55, 31], - 9: [31], - 10: [47], - 11: [34], + 8: [-1, 7, 9, 8], + 9: [9], + 10: [8], + 11: [21], 12: [-1], - 13: [55], - 14: [34], - 15: [26, 38], - 16: [26, 38], + 13: [7], + 14: [21], + 15: [4, 0], + 16: [4, 0], 17: [-1], 18: [-1], - 19: [39, 46, 1, 23, 30], - 20: [39, 46, 1, 23, 30], + 19: [40, 19, 12, 5, 39], + 20: [40, 19, 12, 5, 39], 21: [-1], 22: [-1], - 23: [47], - 24: [23], - 25: [46], - 26: [1], + 23: [8], + 24: [5], + 25: [40], + 26: [12], 27: [39], - 28: [30], - 29: [6, 54], - 30: [6, 54], + 28: [19], + 29: [24, 35], + 30: [24, 35], 31: [-1], 32: [-1], - 33: [23], - 34: [54], - 35: [6], - 36: [16], - 37: [16], + 33: [5], + 34: [24], + 35: [35], + 36: [2], + 37: [2], 38: [-1], 39: [-1], - 40: [6], - 41: [16], - 42: [26, 38], - 43: [26, 38], + 40: [35], + 41: [2], + 42: [4, 0], + 43: [4, 0], 44: [-1], 45: [-1], - 46: [46], - 47: [26, 38], - 48: [1], + 46: [40], + 47: [4, 0], + 48: [12], 49: [39], - 50: [30], - 51: [17], - 52: [17], + 50: [19], + 51: [47], + 52: [47], 53: [-1], 54: [-1], - 55: [14], - 56: [17], - 57: [33, 9], + 55: [42], + 56: [47], + 57: [38, 51], 58: [-1], - 59: [53], + 59: [15], 60: [-1], - 61: [26, 38], - 62: [53], - 63: [33], - 64: [9], - 65: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 66: [12, 44, 48, 46, 38, 26, 29], - 67: [12, 44, 48, 46, 38, 26, 29], + 61: [4, 0], + 62: [15], + 63: [38], + 64: [51], + 65: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 66: [40, 34, 4, 0, 13, 18, 20], + 67: [40, 34, 4, 0, 13, 18, 20], 68: [-1], 69: [-1], - 70: [31], - 71: [48], - 72: [26, 38], - 73: [12], - 74: [29], - 75: [44], - 76: [46], - 77: [34], + 70: [9], + 71: [18], + 72: [4, 0], + 73: [34], + 74: [13], + 75: [20], + 76: [40], + 77: [21], 78: [-1], - 79: [14], + 79: [42], 80: [-1], - 81: [48], - 82: [5], - 83: [5], + 81: [18], + 82: [32], + 83: [32], 84: [-1], 85: [-1], - 86: [14], - 87: [17], - 88: [15], + 86: [42], + 87: [47], + 88: [43], 89: [-1], 90: [-1], - 91: [5], - 92: [17], - 93: [34], - 94: [27], - 95: [27], + 91: [32], + 92: [47], + 93: [21], + 94: [44], + 95: [44], 96: [-1], 97: [-1], - 98: [46], - 99: [2], + 98: [40], + 99: [37], 100: [-1], - 101: [27], - 102: [2], - 103: [12], - 104: [29], - 105: [44], - 106: [17], - 107: [26, 38], - 108: [15], + 101: [44], + 102: [37], + 103: [34], + 104: [13], + 105: [20], + 106: [47], + 107: [4, 0], + 108: [43], 109: [-1], 110: [-1], - 111: [26], - 112: [26], - 113: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 114: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 115: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 116: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 117: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 118: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 119: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 120: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 121: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 122: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 123: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 124: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 125: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 126: [18], - 127: [9], - 128: [32], - 129: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 130: [15], + 111: [0], + 112: [0], + 113: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 114: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 115: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 116: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 117: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 118: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 119: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 120: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 121: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 122: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 123: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 124: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 125: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 126: [54], + 127: [51], + 128: [23], + 129: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 130: [43], 131: [-1], 132: [-1], - 133: [17], - 134: [17], - 135: [17], - 136: [17], - 137: [15], + 133: [47], + 134: [47], + 135: [47], + 136: [47], + 137: [43], 138: [-1], 139: [-1], - 140: [49], - 141: [19], - 142: [14, 3, 17, 28, 18, 19, 41, 49, 21, 32, 51, 10, 9], - 143: [15], + 140: [1], + 141: [25], + 142: [41, 25, 42, 26, 27, 1, 47, 54, 48, 49, 51, 23, 55], + 143: [43], 144: [-1], 145: [-1], - 146: [14], - 147: [10], - 148: [41], - 149: [17], - 150: [51], - 151: [3], - 152: [28], + 146: [42], + 147: [48], + 148: [49], + 149: [47], + 150: [41], + 151: [27], + 152: [26], } nonterminal_rules = { 56: [ - "$wf_outputs = :output :lbrace $_gen27 :rbrace -> WorkflowOutputs( outputs=$2 )", + "$wf_output = :fqn $_gen29 -> WorkflowOutput( fqn=$0, wildcard=$1 )", ], 57: [ - "$wf_output_wildcard = :dot :asterisk -> $1", + "$_gen11 = $cmd_param_kv $_gen12", + "$_gen11 = :_empty", ], 58: [ - "$sections = $command", - "$sections = $outputs", - "$sections = $runtime", - "$sections = $parameter_meta", - "$sections = $meta", + "$_gen29 = $wf_output_wildcard", + "$_gen29 = :_empty", ], 59: [ - "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen19 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )", + "$_gen15 = $kv $_gen16", + "$_gen15 = :_empty", ], 60: [ - "$parameter_meta = :parameter_meta $map -> ParameterMeta( map=$1 )", + "$if_stmt = :if :lparen $e :rparen :lbrace $_gen19 :rbrace -> If( expression=$2, body=$5 )", ], 61: [ - "$cmd_param = :cmd_param_start $_gen11 $e :cmd_param_end -> CommandParameter( attributes=$1, expr=$2 )", + "$_gen24 = $call_input $_gen24", + "$_gen24 = :_empty", ], 62: [ - "$_gen16 = $kv $_gen16", - "$_gen16 = :_empty", + "$_gen37 = :comma $map_kv $_gen37", + "$_gen37 = :_empty", ], 63: [ - "$_gen20 = $wf_body_element $_gen20", - "$_gen20 = :_empty", + "$_gen1 = $import $_gen1", + "$_gen1 = :_empty", ], 64: [ - "$cmd_param_kv = :cmd_attr_hint :identifier :equal $e -> CommandParameterAttr( key=$1, value=$3 )", + "$_gen18 = $setter", + "$_gen18 = :_empty", ], 65: [ - "$alias = :as :identifier -> $1", + "$workflow_or_task = $workflow", + "$workflow_or_task = $task", ], 66: [ - "$meta = :meta $map -> Meta( map=$1 )", + "$_gen10 = $command_part $_gen10", + "$_gen10 = :_empty", ], 67: [ - "$mapping = :identifier :equal $e -> IOMapping( key=$0, value=$2 )", + "$postfix_quantifier = :qmark", + "$postfix_quantifier = :plus", ], 68: [ - "$_gen1 = $import $_gen1", - "$_gen1 = :_empty", + "$mapping = :identifier :equal $e -> IOMapping( key=$0, value=$2 )", ], 69: [ - "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )", - "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )", - "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )", - "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )", - "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )", - "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )", - "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )", - "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )", - "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )", - "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )", - "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )", - "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )", - "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )", - "$e = :not $e -> LogicalNot( expression=$1 )", - "$e = :plus $e -> UnaryPlus( expression=$1 )", - "$e = :dash $e -> UnaryNegation( expression=$1 )", - "$e = :identifier <=> :lparen $_gen32 :rparen -> FunctionCall( name=$0, params=$2 )", - "$e = :identifier <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )", - "$e = :identifier <=> :dot :identifier -> MemberAccess( lhs=$0, rhs=$2 )", - "$e = :object :lbrace $_gen34 :rbrace -> ObjectLiteral( map=$2 )", - "$e = :lsquare $_gen32 :rsquare -> ArrayLiteral( values=$1 )", - "$e = :lbrace $_gen36 :rbrace -> MapLiteral( map=$1 )", - "$e = :lparen $e :rparen -> $1", - "$e = :string", - "$e = :identifier", - "$e = :boolean", - "$e = :integer", - "$e = :float", + "$task = :task :identifier :lbrace $_gen5 $_gen7 :rbrace -> Task( name=$1, declarations=$3, sections=$4 )", ], 70: [ - "$_gen26 = :comma $mapping $_gen26", - "$_gen26 = :_empty", + "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen19 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )", ], 71: [ - "$_gen8 = $sections $_gen8", - "$_gen8 = :_empty", + "$_gen19 = $wf_body_element $_gen20", + "$_gen19 = :_empty", ], 72: [ - "$_gen31 = :comma $type_e $_gen31", - "$_gen31 = :_empty", + "$_gen8 = $sections $_gen8", + "$_gen8 = :_empty", ], 73: [ - "$runtime = :runtime $map -> Runtime( map=$1 )", + "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, var=$1, expression=$3 )", ], 74: [ - "$_gen9 = $command_part $_gen10", - "$_gen9 = :_empty", + "$parameter_meta = :parameter_meta $map -> ParameterMeta( map=$1 )", ], 75: [ - "$workflow_or_task = $workflow", - "$workflow_or_task = $task", + "$_gen7 = $sections $_gen8", + "$_gen7 = :_empty", ], 76: [ - "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )", + "$wf_outputs = :output :lbrace $_gen27 :rbrace -> WorkflowOutputs( outputs=$2 )", ], 77: [ - "$_gen2 = $workflow_or_task $_gen3", - "$_gen2 = :_empty", + "$_gen6 = $declaration $_gen6", + "$_gen6 = :_empty", ], 78: [ - "$_gen15 = $kv $_gen16", - "$_gen15 = :_empty", + "$_gen22 = $call_body", + "$_gen22 = :_empty", ], 79: [ - "$call_input = :input :colon $_gen25 -> Inputs( map=$2 )", - ], - 80: [ "$_gen17 = $postfix_quantifier", "$_gen17 = :_empty", ], + 80: [ + "$alias = :as :identifier -> $1", + ], 81: [ - "$import_namespace = :as :identifier -> $1", + "$_gen33 = :comma $e $_gen33", + "$_gen33 = :_empty", ], 82: [ - "$setter = :equal $e -> $1", + "$_gen23 = $call_input $_gen24", + "$_gen23 = :_empty", ], 83: [ - "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )", + "$outputs = :output :lbrace $_gen13 :rbrace -> Outputs( attributes=$2 )", ], 84: [ - "$_gen23 = $call_input $_gen24", - "$_gen23 = :_empty", + "$_gen3 = $workflow_or_task $_gen3", + "$_gen3 = :_empty", ], 85: [ - "$type_e = :type <=> :lsquare $_gen30 :rsquare -> Type( name=$0, subtype=$2 )", - "$type_e = :type", + "$_gen35 = :comma $object_kv $_gen35", + "$_gen35 = :_empty", ], 86: [ - "$document = $_gen0 $_gen2 -> Document( imports=$0, definitions=$1 )", + "$runtime = :runtime $map -> Runtime( map=$1 )", ], 87: [ - "$_gen12 = $cmd_param_kv $_gen12", - "$_gen12 = :_empty", + "$while_loop = :while :lparen $e :rparen :lbrace $_gen19 :rbrace -> WhileLoop( expression=$2, body=$5 )", ], 88: [ - "$_gen14 = $output_kv $_gen14", - "$_gen14 = :_empty", + "$import = :import :string $_gen4 -> Import( uri=$1, namespace=$2 )", ], 89: [ - "$declaration = $type_e $_gen17 :identifier $_gen18 -> Declaration( type=$0, postfix=$1, name=$2, expression=$3 )", + "$workflow = :workflow :identifier :lbrace $_gen19 :rbrace -> Workflow( name=$1, body=$3 )", ], 90: [ - "$_gen22 = $call_body", - "$_gen22 = :_empty", + "$_gen2 = $workflow_or_task $_gen3", + "$_gen2 = :_empty", ], 91: [ - "$_gen35 = :comma $object_kv $_gen35", - "$_gen35 = :_empty", + "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )", + "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )", + "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )", + "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )", + "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )", + "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )", + "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )", + "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )", + "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )", + "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )", + "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )", + "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )", + "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )", + "$e = :not $e -> LogicalNot( expression=$1 )", + "$e = :plus $e -> UnaryPlus( expression=$1 )", + "$e = :dash $e -> UnaryNegation( expression=$1 )", + "$e = :identifier <=> :lparen $_gen32 :rparen -> FunctionCall( name=$0, params=$2 )", + "$e = :identifier <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )", + "$e = :identifier <=> :dot :identifier -> MemberAccess( lhs=$0, rhs=$2 )", + "$e = :object :lbrace $_gen34 :rbrace -> ObjectLiteral( map=$2 )", + "$e = :lsquare $_gen32 :rsquare -> ArrayLiteral( values=$1 )", + "$e = :lbrace $_gen36 :rbrace -> MapLiteral( map=$1 )", + "$e = :lparen $e :rparen -> $1", + "$e = :string", + "$e = :identifier", + "$e = :boolean", + "$e = :integer", + "$e = :float", ], 92: [ - "$_gen36 = $map_kv $_gen37", - "$_gen36 = :_empty", + "$_gen12 = $cmd_param_kv $_gen12", + "$_gen12 = :_empty", ], 93: [ - "$task = :task :identifier :lbrace $_gen5 $_gen7 :rbrace -> Task( name=$1, declarations=$3, sections=$4 )", + "$_gen20 = $wf_body_element $_gen20", + "$_gen20 = :_empty", ], 94: [ - "$_gen7 = $sections $_gen8", - "$_gen7 = :_empty", + "$_gen25 = $mapping $_gen26", + "$_gen25 = :_empty", ], 95: [ - "$_gen3 = $workflow_or_task $_gen3", - "$_gen3 = :_empty", + "$_gen30 = $type_e $_gen31", + "$_gen30 = :_empty", ], 96: [ - "$_gen10 = $command_part $_gen10", - "$_gen10 = :_empty", + "$_gen36 = $map_kv $_gen37", + "$_gen36 = :_empty", ], 97: [ - "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )", + "$map = :lbrace $_gen15 :rbrace -> $1", ], 98: [ - "$postfix_quantifier = :qmark", - "$postfix_quantifier = :plus", + "$_gen26 = :comma $mapping $_gen26", + "$_gen26 = :_empty", ], 99: [ - "$call = :call :fqn $_gen21 $_gen22 -> Call( task=$1, alias=$2, body=$3 )", + "$declaration = $type_e $_gen17 :identifier $_gen18 -> Declaration( type=$0, postfix=$1, name=$2, expression=$3 )", ], 100: [ - "$_gen28 = $wf_output $_gen28", - "$_gen28 = :_empty", + "$_gen16 = $kv $_gen16", + "$_gen16 = :_empty", ], 101: [ - "$_gen34 = $object_kv $_gen35", - "$_gen34 = :_empty", + "$_gen28 = $wf_output $_gen28", + "$_gen28 = :_empty", ], 102: [ - "$_gen19 = $wf_body_element $_gen20", - "$_gen19 = :_empty", + "$import_namespace = :as :identifier -> $1", ], 103: [ - "$while_loop = :while :lparen $e :rparen :lbrace $_gen19 :rbrace -> WhileLoop( expression=$2, body=$5 )", + "$_gen21 = $alias", + "$_gen21 = :_empty", ], 104: [ - "$map = :lbrace $_gen15 :rbrace -> $1", - ], - 105: [ - "$if_stmt = :if :lparen $e :rparen :lbrace $_gen19 :rbrace -> If( expression=$2, body=$5 )", - ], - 106: [ "$wf_body_element = $call", "$wf_body_element = $declaration", "$wf_body_element = $while_loop", @@ -969,94 +964,99 @@ def __init__(self, tokens, errors): "$wf_body_element = $scatter", "$wf_body_element = $wf_outputs", ], + 105: [ + "$_gen4 = $import_namespace", + "$_gen4 = :_empty", + ], + 106: [ + "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )", + ], 107: [ - "$_gen0 = $import $_gen1", - "$_gen0 = :_empty", + "$_gen34 = $object_kv $_gen35", + "$_gen34 = :_empty", ], 108: [ - "$_gen6 = $declaration $_gen6", - "$_gen6 = :_empty", + "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )", ], 109: [ - "$_gen5 = $declaration $_gen6", - "$_gen5 = :_empty", + "$_gen9 = $command_part $_gen10", + "$_gen9 = :_empty", ], 110: [ - "$_gen33 = :comma $e $_gen33", - "$_gen33 = :_empty", + "$type_e = :type <=> :lsquare $_gen30 :rsquare -> Type( name=$0, subtype=$2 )", + "$type_e = :type", ], 111: [ - "$outputs = :output :lbrace $_gen13 :rbrace -> Outputs( attributes=$2 )", + "$_gen5 = $declaration $_gen6", + "$_gen5 = :_empty", ], 112: [ - "$_gen37 = :comma $map_kv $_gen37", - "$_gen37 = :_empty", + "$setter = :equal $e -> $1", ], 113: [ - "$import = :import :string $_gen4 -> Import( uri=$1, namespace=$2 )", + "$_gen27 = $wf_output $_gen28", + "$_gen27 = :_empty", ], 114: [ "$_gen32 = $e $_gen33", "$_gen32 = :_empty", ], 115: [ - "$command_part = :cmd_part", - "$command_part = $cmd_param", + "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )", ], 116: [ - "$_gen29 = $wf_output_wildcard", - "$_gen29 = :_empty", + "$meta = :meta $map -> Meta( map=$1 )", ], 117: [ - "$_gen11 = $cmd_param_kv $_gen12", - "$_gen11 = :_empty", + "$command_part = :cmd_part", + "$command_part = $cmd_param", ], 118: [ - "$_gen30 = $type_e $_gen31", - "$_gen30 = :_empty", + "$_gen14 = $output_kv $_gen14", + "$_gen14 = :_empty", ], 119: [ - "$_gen24 = $call_input $_gen24", - "$_gen24 = :_empty", + "$wf_output_wildcard = :dot :asterisk -> $1", ], 120: [ - "$command = :raw_command :raw_cmd_start $_gen9 :raw_cmd_end -> RawCommand( parts=$2 )", + "$call_body = :lbrace $_gen5 $_gen23 :rbrace -> CallBody( declarations=$1, io=$2 )", ], 121: [ - "$_gen4 = $import_namespace", - "$_gen4 = :_empty", + "$_gen31 = :comma $type_e $_gen31", + "$_gen31 = :_empty", ], 122: [ - "$_gen21 = $alias", - "$_gen21 = :_empty", + "$document = $_gen0 $_gen2 -> Document( imports=$0, definitions=$1 )", ], 123: [ - "$_gen27 = $wf_output $_gen28", - "$_gen27 = :_empty", + "$sections = $command", + "$sections = $outputs", + "$sections = $runtime", + "$sections = $parameter_meta", + "$sections = $meta", ], 124: [ - "$workflow = :workflow :identifier :lbrace $_gen19 :rbrace -> Workflow( name=$1, body=$3 )", + "$_gen13 = $output_kv $_gen14", + "$_gen13 = :_empty", ], 125: [ - "$call_body = :lbrace $_gen5 $_gen23 :rbrace -> CallBody( declarations=$1, io=$2 )", + "$call_input = :input :colon $_gen25 -> Inputs( map=$2 )", ], 126: [ - "$_gen25 = $mapping $_gen26", - "$_gen25 = :_empty", + "$cmd_param = :cmd_param_start $_gen11 $e :cmd_param_end -> CommandParameter( attributes=$1, expr=$2 )", ], 127: [ - "$wf_output = :fqn $_gen29 -> WorkflowOutput( fqn=$0, wildcard=$1 )", + "$cmd_param_kv = :cmd_attr_hint :identifier :equal $e -> CommandParameterAttr( key=$1, value=$3 )", ], 128: [ - "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, var=$1, expression=$3 )", + "$_gen0 = $import $_gen1", + "$_gen0 = :_empty", ], 129: [ - "$_gen13 = $output_kv $_gen14", - "$_gen13 = :_empty", + "$call = :call :fqn $_gen21 $_gen22 -> Call( task=$1, alias=$2, body=$3 )", ], 130: [ - "$_gen18 = $setter", - "$_gen18 = :_empty", + "$command = :raw_command :raw_cmd_start $_gen9 :raw_cmd_end -> RawCommand( parts=$2 )", ], } rules = { @@ -1235,29 +1235,94 @@ def expect(ctx, terminal_id): if next and not is_terminal(next.id): raise ctx.errors.invalid_terminal(ctx.nonterminal, next) return current +# START definitions for expression parser: type_e +infix_binding_power_type_e = { + 25: 1000, # $type_e = :type <=> :lsquare list(nt=$type_e, sep=:comma, min=0, sep_terminates=False) :rsquare -> Type( name=$0, subtype=$2 ) +} +prefix_binding_power_type_e = { +} +def get_infix_binding_power_type_e(terminal_id): + try: + return infix_binding_power_type_e[terminal_id] + except: + return 0 +def get_prefix_binding_power_type_e(terminal_id): + try: + return prefix_binding_power_type_e[terminal_id] + except: + return 0 +def parse_type_e(ctx): + return parse_type_e_internal(ctx, rbp=0) +def parse_type_e_internal(ctx, rbp=0): + left = nud_type_e(ctx) + if isinstance(left, ParseTree): + left.isExpr = True + left.isNud = True + while ctx.tokens.current() and rbp < get_infix_binding_power_type_e(ctx.tokens.current().id): + left = led_type_e(left, ctx) + if left: + left.isExpr = True + return left +def nud_type_e(ctx): + tree = ParseTree(NonTerminal(110, 'type_e')) + current = ctx.tokens.current() + ctx.nonterminal = "type_e" + if not current: + return tree + if current.id in rule_first[111]: + # $type_e = :type <=> :lsquare $_gen30 :rsquare -> Type( name=$0, subtype=$2 ) + ctx.rule = rules[111] + tree.astTransform = AstTransformSubstitution(0) + tree.nudMorphemeCount = 1 + tree.add(expect(ctx, 0)) + elif current.id in rule_first[112]: + # $type_e = :type + ctx.rule = rules[112] + tree.astTransform = AstTransformSubstitution(0) + tree.nudMorphemeCount = 1 + tree.add(expect(ctx, 0)) + return tree +def led_type_e(left, ctx): + tree = ParseTree(NonTerminal(110, 'type_e')) + current = ctx.tokens.current() + ctx.nonterminal = "type_e" + if current.id == 25: # :lsquare + # $type_e = :type <=> :lsquare $_gen30 :rsquare -> Type( name=$0, subtype=$2 ) + ctx.rule = rules[111] + ast_parameters = OrderedDict([ + ('name', 0), + ('subtype', 2), + ]) + tree.astTransform = AstTransformNodeCreator('Type', ast_parameters) + tree.add(left) + tree.add(expect(ctx, 25)) # :lsquare + tree.add(parse__gen30(ctx)) + tree.add(expect(ctx, 50)) # :rsquare + return tree +# END definitions for expression parser: type_e # START definitions for expression parser: e infix_binding_power_e = { - 0: 2000, # $e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 ) - 11: 3000, # $e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 ) - 7: 4000, # $e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 ) - 40: 4000, # $e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 ) - 24: 5000, # $e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 ) - 43: 5000, # $e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 ) - 45: 5000, # $e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 ) - 52: 5000, # $e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 ) - 9: 6000, # $e = $e :plus $e -> Add( lhs=$0, rhs=$2 ) - 32: 6000, # $e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 ) - 37: 7000, # $e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 ) - 13: 7000, # $e = $e :slash $e -> Divide( lhs=$0, rhs=$2 ) - 8: 7000, # $e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 ) - 10: 9000, # $e = :identifier <=> :lparen list(nt=$e, sep=:comma, min=0, sep_terminates=False) :rparen -> FunctionCall( name=$0, params=$2 ) - 19: 10000, # $e = :identifier <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 ) - 2: 11000, # $e = :identifier <=> :dot :identifier -> MemberAccess( lhs=$0, rhs=$2 ) + 11: 2000, # $e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 ) + 14: 3000, # $e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 ) + 52: 4000, # $e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 ) + 16: 4000, # $e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 ) + 17: 5000, # $e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 ) + 22: 5000, # $e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 ) + 53: 5000, # $e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 ) + 46: 5000, # $e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 ) + 51: 6000, # $e = $e :plus $e -> Add( lhs=$0, rhs=$2 ) + 23: 6000, # $e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 ) + 29: 7000, # $e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 ) + 36: 7000, # $e = $e :slash $e -> Divide( lhs=$0, rhs=$2 ) + 30: 7000, # $e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 ) + 48: 9000, # $e = :identifier <=> :lparen list(nt=$e, sep=:comma, min=0, sep_terminates=False) :rparen -> FunctionCall( name=$0, params=$2 ) + 25: 10000, # $e = :identifier <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 ) + 37: 11000, # $e = :identifier <=> :dot :identifier -> MemberAccess( lhs=$0, rhs=$2 ) } prefix_binding_power_e = { - 18: 8000, # $e = :not $e -> LogicalNot( expression=$1 ) - 9: 8000, # $e = :plus $e -> UnaryPlus( expression=$1 ) - 32: 8000, # $e = :dash $e -> UnaryNegation( expression=$1 ) + 54: 8000, # $e = :not $e -> LogicalNot( expression=$1 ) + 51: 8000, # $e = :plus $e -> UnaryPlus( expression=$1 ) + 23: 8000, # $e = :dash $e -> UnaryNegation( expression=$1 ) } def get_infix_binding_power_e(terminal_id): try: @@ -1282,7 +1347,7 @@ def parse_e_internal(ctx, rbp=0): left.isExpr = True return left def nud_e(ctx): - tree = ParseTree(NonTerminal(69, 'e')) + tree = ParseTree(NonTerminal(91, 'e')) current = ctx.tokens.current() ctx.nonterminal = "e" if not current: @@ -1295,8 +1360,8 @@ def nud_e(ctx): ]) tree.astTransform = AstTransformNodeCreator('LogicalNot', ast_parameters) tree.nudMorphemeCount = 2 - tree.add(expect(ctx, 18)) - tree.add(parse_e_internal(ctx, get_prefix_binding_power_e(18))) + tree.add(expect(ctx, 54)) + tree.add(parse_e_internal(ctx, get_prefix_binding_power_e(54))) tree.isPrefix = True elif current.id in rule_first[127]: # $e = :plus $e -> UnaryPlus( expression=$1 ) @@ -1306,8 +1371,8 @@ def nud_e(ctx): ]) tree.astTransform = AstTransformNodeCreator('UnaryPlus', ast_parameters) tree.nudMorphemeCount = 2 - tree.add(expect(ctx, 9)) - tree.add(parse_e_internal(ctx, get_prefix_binding_power_e(9))) + tree.add(expect(ctx, 51)) + tree.add(parse_e_internal(ctx, get_prefix_binding_power_e(51))) tree.isPrefix = True elif current.id in rule_first[128]: # $e = :dash $e -> UnaryNegation( expression=$1 ) @@ -1317,27 +1382,27 @@ def nud_e(ctx): ]) tree.astTransform = AstTransformNodeCreator('UnaryNegation', ast_parameters) tree.nudMorphemeCount = 2 - tree.add(expect(ctx, 32)) - tree.add(parse_e_internal(ctx, get_prefix_binding_power_e(32))) + tree.add(expect(ctx, 23)) + tree.add(parse_e_internal(ctx, get_prefix_binding_power_e(23))) tree.isPrefix = True elif current.id in rule_first[133]: # $e = :identifier <=> :lparen $_gen32 :rparen -> FunctionCall( name=$0, params=$2 ) ctx.rule = rules[133] tree.astTransform = AstTransformSubstitution(0) tree.nudMorphemeCount = 1 - tree.add(expect(ctx, 17)) + tree.add(expect(ctx, 47)) elif current.id in rule_first[134]: # $e = :identifier <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 ) ctx.rule = rules[134] tree.astTransform = AstTransformSubstitution(0) tree.nudMorphemeCount = 1 - tree.add(expect(ctx, 17)) + tree.add(expect(ctx, 47)) elif current.id in rule_first[135]: # $e = :identifier <=> :dot :identifier -> MemberAccess( lhs=$0, rhs=$2 ) ctx.rule = rules[135] tree.astTransform = AstTransformSubstitution(0) tree.nudMorphemeCount = 1 - tree.add(expect(ctx, 17)) + tree.add(expect(ctx, 47)) elif current.id in rule_first[140]: # $e = :object :lbrace $_gen34 :rbrace -> ObjectLiteral( map=$2 ) ctx.rule = rules[140] @@ -1346,10 +1411,10 @@ def nud_e(ctx): ]) tree.astTransform = AstTransformNodeCreator('ObjectLiteral', ast_parameters) tree.nudMorphemeCount = 4 - tree.add(expect(ctx, 49)) - tree.add(expect(ctx, 14)) + tree.add(expect(ctx, 1)) + tree.add(expect(ctx, 42)) tree.add(parse__gen34(ctx)) - tree.add(expect(ctx, 36)) + tree.add(expect(ctx, 33)) elif current.id in rule_first[141]: # $e = :lsquare $_gen32 :rsquare -> ArrayLiteral( values=$1 ) ctx.rule = rules[141] @@ -1358,9 +1423,9 @@ def nud_e(ctx): ]) tree.astTransform = AstTransformNodeCreator('ArrayLiteral', ast_parameters) tree.nudMorphemeCount = 3 - tree.add(expect(ctx, 19)) - tree.add(parse__gen32(ctx)) tree.add(expect(ctx, 25)) + tree.add(parse__gen32(ctx)) + tree.add(expect(ctx, 50)) elif current.id in rule_first[146]: # $e = :lbrace $_gen36 :rbrace -> MapLiteral( map=$1 ) ctx.rule = rules[146] @@ -1369,53 +1434,53 @@ def nud_e(ctx): ]) tree.astTransform = AstTransformNodeCreator('MapLiteral', ast_parameters) tree.nudMorphemeCount = 3 - tree.add(expect(ctx, 14)) + tree.add(expect(ctx, 42)) tree.add(parse__gen36(ctx)) - tree.add(expect(ctx, 36)) + tree.add(expect(ctx, 33)) elif current.id in rule_first[147]: # $e = :lparen $e :rparen -> $1 ctx.rule = rules[147] tree.astTransform = AstTransformSubstitution(1) tree.nudMorphemeCount = 3 - tree.add(expect(ctx, 10)) + tree.add(expect(ctx, 48)) tree.add(parse_e(ctx)) - tree.add(expect(ctx, 35)) + tree.add(expect(ctx, 45)) elif current.id in rule_first[148]: # $e = :string ctx.rule = rules[148] tree.astTransform = AstTransformSubstitution(0) tree.nudMorphemeCount = 1 - tree.add(expect(ctx, 41)) + tree.add(expect(ctx, 49)) elif current.id in rule_first[149]: # $e = :identifier ctx.rule = rules[149] tree.astTransform = AstTransformSubstitution(0) tree.nudMorphemeCount = 1 - tree.add(expect(ctx, 17)) + tree.add(expect(ctx, 47)) elif current.id in rule_first[150]: # $e = :boolean ctx.rule = rules[150] tree.astTransform = AstTransformSubstitution(0) tree.nudMorphemeCount = 1 - tree.add(expect(ctx, 51)) + tree.add(expect(ctx, 41)) elif current.id in rule_first[151]: # $e = :integer ctx.rule = rules[151] tree.astTransform = AstTransformSubstitution(0) tree.nudMorphemeCount = 1 - tree.add(expect(ctx, 3)) + tree.add(expect(ctx, 27)) elif current.id in rule_first[152]: # $e = :float ctx.rule = rules[152] tree.astTransform = AstTransformSubstitution(0) tree.nudMorphemeCount = 1 - tree.add(expect(ctx, 28)) + tree.add(expect(ctx, 26)) return tree def led_e(left, ctx): - tree = ParseTree(NonTerminal(69, 'e')) + tree = ParseTree(NonTerminal(91, 'e')) current = ctx.tokens.current() ctx.nonterminal = "e" - if current.id == 0: # :double_pipe + if current.id == 11: # :double_pipe # $e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 ) ctx.rule = rules[113] ast_parameters = OrderedDict([ @@ -1425,11 +1490,11 @@ def led_e(left, ctx): tree.astTransform = AstTransformNodeCreator('LogicalOr', ast_parameters) tree.isExprNud = True tree.add(left) - tree.add(expect(ctx, 0)) # :double_pipe + tree.add(expect(ctx, 11)) # :double_pipe modifier = 0 tree.isInfix = True - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(0) - modifier)) - if current.id == 11: # :double_ampersand + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(11) - modifier)) + if current.id == 14: # :double_ampersand # $e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 ) ctx.rule = rules[114] ast_parameters = OrderedDict([ @@ -1439,11 +1504,11 @@ def led_e(left, ctx): tree.astTransform = AstTransformNodeCreator('LogicalAnd', ast_parameters) tree.isExprNud = True tree.add(left) - tree.add(expect(ctx, 11)) # :double_ampersand + tree.add(expect(ctx, 14)) # :double_ampersand modifier = 0 tree.isInfix = True - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(11) - modifier)) - if current.id == 7: # :double_equal + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(14) - modifier)) + if current.id == 52: # :double_equal # $e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 ) ctx.rule = rules[115] ast_parameters = OrderedDict([ @@ -1453,11 +1518,11 @@ def led_e(left, ctx): tree.astTransform = AstTransformNodeCreator('Equals', ast_parameters) tree.isExprNud = True tree.add(left) - tree.add(expect(ctx, 7)) # :double_equal + tree.add(expect(ctx, 52)) # :double_equal modifier = 0 tree.isInfix = True - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(7) - modifier)) - if current.id == 40: # :not_equal + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(52) - modifier)) + if current.id == 16: # :not_equal # $e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 ) ctx.rule = rules[116] ast_parameters = OrderedDict([ @@ -1467,11 +1532,11 @@ def led_e(left, ctx): tree.astTransform = AstTransformNodeCreator('NotEquals', ast_parameters) tree.isExprNud = True tree.add(left) - tree.add(expect(ctx, 40)) # :not_equal + tree.add(expect(ctx, 16)) # :not_equal modifier = 0 tree.isInfix = True - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(40) - modifier)) - if current.id == 24: # :lt + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(16) - modifier)) + if current.id == 17: # :lt # $e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 ) ctx.rule = rules[117] ast_parameters = OrderedDict([ @@ -1481,11 +1546,11 @@ def led_e(left, ctx): tree.astTransform = AstTransformNodeCreator('LessThan', ast_parameters) tree.isExprNud = True tree.add(left) - tree.add(expect(ctx, 24)) # :lt + tree.add(expect(ctx, 17)) # :lt modifier = 0 tree.isInfix = True - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(24) - modifier)) - if current.id == 43: # :lteq + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(17) - modifier)) + if current.id == 22: # :lteq # $e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 ) ctx.rule = rules[118] ast_parameters = OrderedDict([ @@ -1495,11 +1560,11 @@ def led_e(left, ctx): tree.astTransform = AstTransformNodeCreator('LessThanOrEqual', ast_parameters) tree.isExprNud = True tree.add(left) - tree.add(expect(ctx, 43)) # :lteq + tree.add(expect(ctx, 22)) # :lteq modifier = 0 tree.isInfix = True - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(43) - modifier)) - if current.id == 45: # :gt + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(22) - modifier)) + if current.id == 53: # :gt # $e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 ) ctx.rule = rules[119] ast_parameters = OrderedDict([ @@ -1509,11 +1574,11 @@ def led_e(left, ctx): tree.astTransform = AstTransformNodeCreator('GreaterThan', ast_parameters) tree.isExprNud = True tree.add(left) - tree.add(expect(ctx, 45)) # :gt + tree.add(expect(ctx, 53)) # :gt modifier = 0 tree.isInfix = True - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(45) - modifier)) - if current.id == 52: # :gteq + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(53) - modifier)) + if current.id == 46: # :gteq # $e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 ) ctx.rule = rules[120] ast_parameters = OrderedDict([ @@ -1523,11 +1588,11 @@ def led_e(left, ctx): tree.astTransform = AstTransformNodeCreator('GreaterThanOrEqual', ast_parameters) tree.isExprNud = True tree.add(left) - tree.add(expect(ctx, 52)) # :gteq + tree.add(expect(ctx, 46)) # :gteq modifier = 0 tree.isInfix = True - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(52) - modifier)) - if current.id == 9: # :plus + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(46) - modifier)) + if current.id == 51: # :plus # $e = $e :plus $e -> Add( lhs=$0, rhs=$2 ) ctx.rule = rules[121] ast_parameters = OrderedDict([ @@ -1537,11 +1602,11 @@ def led_e(left, ctx): tree.astTransform = AstTransformNodeCreator('Add', ast_parameters) tree.isExprNud = True tree.add(left) - tree.add(expect(ctx, 9)) # :plus + tree.add(expect(ctx, 51)) # :plus modifier = 0 tree.isInfix = True - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(9) - modifier)) - if current.id == 32: # :dash + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(51) - modifier)) + if current.id == 23: # :dash # $e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 ) ctx.rule = rules[122] ast_parameters = OrderedDict([ @@ -1551,11 +1616,11 @@ def led_e(left, ctx): tree.astTransform = AstTransformNodeCreator('Subtract', ast_parameters) tree.isExprNud = True tree.add(left) - tree.add(expect(ctx, 32)) # :dash + tree.add(expect(ctx, 23)) # :dash modifier = 0 tree.isInfix = True - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(32) - modifier)) - if current.id == 37: # :asterisk + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(23) - modifier)) + if current.id == 29: # :asterisk # $e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 ) ctx.rule = rules[123] ast_parameters = OrderedDict([ @@ -1565,11 +1630,11 @@ def led_e(left, ctx): tree.astTransform = AstTransformNodeCreator('Multiply', ast_parameters) tree.isExprNud = True tree.add(left) - tree.add(expect(ctx, 37)) # :asterisk + tree.add(expect(ctx, 29)) # :asterisk modifier = 0 tree.isInfix = True - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(37) - modifier)) - if current.id == 13: # :slash + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(29) - modifier)) + if current.id == 36: # :slash # $e = $e :slash $e -> Divide( lhs=$0, rhs=$2 ) ctx.rule = rules[124] ast_parameters = OrderedDict([ @@ -1579,11 +1644,11 @@ def led_e(left, ctx): tree.astTransform = AstTransformNodeCreator('Divide', ast_parameters) tree.isExprNud = True tree.add(left) - tree.add(expect(ctx, 13)) # :slash + tree.add(expect(ctx, 36)) # :slash modifier = 0 tree.isInfix = True - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(13) - modifier)) - if current.id == 8: # :percent + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(36) - modifier)) + if current.id == 30: # :percent # $e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 ) ctx.rule = rules[125] ast_parameters = OrderedDict([ @@ -1593,11 +1658,11 @@ def led_e(left, ctx): tree.astTransform = AstTransformNodeCreator('Remainder', ast_parameters) tree.isExprNud = True tree.add(left) - tree.add(expect(ctx, 8)) # :percent + tree.add(expect(ctx, 30)) # :percent modifier = 0 tree.isInfix = True - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(8) - modifier)) - if current.id == 10: # :lparen + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(30) - modifier)) + if current.id == 48: # :lparen # $e = :identifier <=> :lparen $_gen32 :rparen -> FunctionCall( name=$0, params=$2 ) ctx.rule = rules[133] ast_parameters = OrderedDict([ @@ -1606,10 +1671,10 @@ def led_e(left, ctx): ]) tree.astTransform = AstTransformNodeCreator('FunctionCall', ast_parameters) tree.add(left) - tree.add(expect(ctx, 10)) # :lparen + tree.add(expect(ctx, 48)) # :lparen tree.add(parse__gen32(ctx)) - tree.add(expect(ctx, 35)) # :rparen - if current.id == 19: # :lsquare + tree.add(expect(ctx, 45)) # :rparen + if current.id == 25: # :lsquare # $e = :identifier <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 ) ctx.rule = rules[134] ast_parameters = OrderedDict([ @@ -1618,11 +1683,11 @@ def led_e(left, ctx): ]) tree.astTransform = AstTransformNodeCreator('ArrayOrMapLookup', ast_parameters) tree.add(left) - tree.add(expect(ctx, 19)) # :lsquare + tree.add(expect(ctx, 25)) # :lsquare modifier = 0 - tree.add(parse_e_internal(ctx, get_infix_binding_power_e(19) - modifier)) - tree.add(expect(ctx, 25)) # :rsquare - if current.id == 2: # :dot + tree.add(parse_e_internal(ctx, get_infix_binding_power_e(25) - modifier)) + tree.add(expect(ctx, 50)) # :rsquare + if current.id == 37: # :dot # $e = :identifier <=> :dot :identifier -> MemberAccess( lhs=$0, rhs=$2 ) ctx.rule = rules[135] ast_parameters = OrderedDict([ @@ -1631,385 +1696,279 @@ def led_e(left, ctx): ]) tree.astTransform = AstTransformNodeCreator('MemberAccess', ast_parameters) tree.add(left) - tree.add(expect(ctx, 2)) # :dot - tree.add(expect(ctx, 17)) # :identifier + tree.add(expect(ctx, 37)) # :dot + tree.add(expect(ctx, 47)) # :identifier return tree # END definitions for expression parser: e -# START definitions for expression parser: type_e -infix_binding_power_type_e = { - 19: 1000, # $type_e = :type <=> :lsquare list(nt=$type_e, sep=:comma, min=0, sep_terminates=False) :rsquare -> Type( name=$0, subtype=$2 ) -} -prefix_binding_power_type_e = { -} -def get_infix_binding_power_type_e(terminal_id): - try: - return infix_binding_power_type_e[terminal_id] - except: - return 0 -def get_prefix_binding_power_type_e(terminal_id): - try: - return prefix_binding_power_type_e[terminal_id] - except: - return 0 -def parse_type_e(ctx): - return parse_type_e_internal(ctx, rbp=0) -def parse_type_e_internal(ctx, rbp=0): - left = nud_type_e(ctx) - if isinstance(left, ParseTree): - left.isExpr = True - left.isNud = True - while ctx.tokens.current() and rbp < get_infix_binding_power_type_e(ctx.tokens.current().id): - left = led_type_e(left, ctx) - if left: - left.isExpr = True - return left -def nud_type_e(ctx): - tree = ParseTree(NonTerminal(85, 'type_e')) - current = ctx.tokens.current() - ctx.nonterminal = "type_e" - if not current: - return tree - if current.id in rule_first[111]: - # $type_e = :type <=> :lsquare $_gen30 :rsquare -> Type( name=$0, subtype=$2 ) - ctx.rule = rules[111] - tree.astTransform = AstTransformSubstitution(0) - tree.nudMorphemeCount = 1 - tree.add(expect(ctx, 26)) - elif current.id in rule_first[112]: - # $type_e = :type - ctx.rule = rules[112] - tree.astTransform = AstTransformSubstitution(0) - tree.nudMorphemeCount = 1 - tree.add(expect(ctx, 26)) - return tree -def led_type_e(left, ctx): - tree = ParseTree(NonTerminal(85, 'type_e')) - current = ctx.tokens.current() - ctx.nonterminal = "type_e" - if current.id == 19: # :lsquare - # $type_e = :type <=> :lsquare $_gen30 :rsquare -> Type( name=$0, subtype=$2 ) - ctx.rule = rules[111] - ast_parameters = OrderedDict([ - ('name', 0), - ('subtype', 2), - ]) - tree.astTransform = AstTransformNodeCreator('Type', ast_parameters) - tree.add(left) - tree.add(expect(ctx, 19)) # :lsquare - tree.add(parse__gen30(ctx)) - tree.add(expect(ctx, 25)) # :rsquare - return tree -# END definitions for expression parser: type_e -def parse_wf_outputs(ctx): +def parse_wf_output(ctx): current = ctx.tokens.current() rule = table[0][current.id] if current else -1 - tree = ParseTree(NonTerminal(56, 'wf_outputs')) - ctx.nonterminal = "wf_outputs" + tree = ParseTree(NonTerminal(56, 'wf_output')) + ctx.nonterminal = "wf_output" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 98: # $wf_outputs = :output :lbrace $_gen27 :rbrace -> WorkflowOutputs( outputs=$2 ) - ctx.rule = rules[98] + if rule == 101: # $wf_output = :fqn $_gen29 -> WorkflowOutput( fqn=$0, wildcard=$1 ) + ctx.rule = rules[101] ast_parameters = OrderedDict([ - ('outputs', 2), + ('fqn', 0), + ('wildcard', 1), ]) - tree.astTransform = AstTransformNodeCreator('WorkflowOutputs', ast_parameters) - t = expect(ctx, 46) # :output - tree.add(t) - t = expect(ctx, 14) # :lbrace + tree.astTransform = AstTransformNodeCreator('WorkflowOutput', ast_parameters) + t = expect(ctx, 44) # :fqn tree.add(t) - subtree = parse__gen27(ctx) + subtree = parse__gen29(ctx) tree.add(subtree) - t = expect(ctx, 36) # :rbrace - tree.add(t) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), [terminals[x] for x in nonterminal_first[56] if x >=0], - rules[98] + rules[101] ) -def parse_wf_output_wildcard(ctx): +def parse__gen11(ctx): current = ctx.tokens.current() rule = table[1][current.id] if current else -1 - tree = ParseTree(NonTerminal(57, 'wf_output_wildcard')) - ctx.nonterminal = "wf_output_wildcard" - tree.list = False + tree = ParseTree(NonTerminal(57, '_gen11')) + ctx.nonterminal = "_gen11" + tree.list = True + if current != None and current.id in nonterminal_follow[57] and current.id not in nonterminal_first[57]: + return tree if current == None: - raise ctx.errors.unexpected_eof() - if rule == 102: # $wf_output_wildcard = :dot :asterisk -> $1 - ctx.rule = rules[102] - tree.astTransform = AstTransformSubstitution(1) - t = expect(ctx, 2) # :dot - tree.add(t) - t = expect(ctx, 37) # :asterisk - tree.add(t) return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[57] if x >=0], - rules[102] - ) -def parse_sections(ctx): + if rule == 36: # $_gen11 = $cmd_param_kv $_gen12 + ctx.rule = rules[36] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_cmd_param_kv(ctx) + tree.add(subtree) + subtree = parse__gen12(ctx) + tree.add(subtree) + return tree + return tree +def parse__gen29(ctx): current = ctx.tokens.current() rule = table[2][current.id] if current else -1 - tree = ParseTree(NonTerminal(58, 'sections')) - ctx.nonterminal = "sections" + tree = ParseTree(NonTerminal(58, '_gen29')) + ctx.nonterminal = "_gen29" tree.list = False + if current != None and current.id in nonterminal_follow[58] and current.id not in nonterminal_first[58]: + return tree if current == None: - raise ctx.errors.unexpected_eof() - if rule == 24: # $sections = $command - ctx.rule = rules[24] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_command(ctx) - tree.add(subtree) return tree - elif rule == 25: # $sections = $outputs - ctx.rule = rules[25] + if rule == 99: # $_gen29 = $wf_output_wildcard + ctx.rule = rules[99] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_outputs(ctx) + subtree = parse_wf_output_wildcard(ctx) tree.add(subtree) return tree - elif rule == 26: # $sections = $runtime - ctx.rule = rules[26] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_runtime(ctx) - tree.add(subtree) + return tree +def parse__gen15(ctx): + current = ctx.tokens.current() + rule = table[3][current.id] if current else -1 + tree = ParseTree(NonTerminal(59, '_gen15')) + ctx.nonterminal = "_gen15" + tree.list = True + if current != None and current.id in nonterminal_follow[59] and current.id not in nonterminal_first[59]: return tree - elif rule == 27: # $sections = $parameter_meta - ctx.rule = rules[27] + if current == None: + return tree + if rule == 51: # $_gen15 = $kv $_gen16 + ctx.rule = rules[51] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_parameter_meta(ctx) + subtree = parse_kv(ctx) tree.add(subtree) - return tree - elif rule == 28: # $sections = $meta - ctx.rule = rules[28] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_meta(ctx) + subtree = parse__gen16(ctx) tree.add(subtree) return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[58] if x >=0], - rules[28] - ) -def parse_scatter(ctx): + return tree +def parse_if_stmt(ctx): current = ctx.tokens.current() - rule = table[3][current.id] if current else -1 - tree = ParseTree(NonTerminal(59, 'scatter')) - ctx.nonterminal = "scatter" + rule = table[4][current.id] if current else -1 + tree = ParseTree(NonTerminal(60, 'if_stmt')) + ctx.nonterminal = "if_stmt" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 105: # $scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen19 :rbrace -> Scatter( item=$2, collection=$4, body=$7 ) - ctx.rule = rules[105] + if rule == 104: # $if_stmt = :if :lparen $e :rparen :lbrace $_gen19 :rbrace -> If( expression=$2, body=$5 ) + ctx.rule = rules[104] ast_parameters = OrderedDict([ - ('item', 2), - ('collection', 4), - ('body', 7), + ('expression', 2), + ('body', 5), ]) - tree.astTransform = AstTransformNodeCreator('Scatter', ast_parameters) - t = expect(ctx, 44) # :scatter - tree.add(t) - t = expect(ctx, 10) # :lparen - tree.add(t) - t = expect(ctx, 17) # :identifier + tree.astTransform = AstTransformNodeCreator('If', ast_parameters) + t = expect(ctx, 13) # :if tree.add(t) - t = expect(ctx, 50) # :in + t = expect(ctx, 48) # :lparen tree.add(t) subtree = parse_e(ctx) tree.add(subtree) - t = expect(ctx, 35) # :rparen + t = expect(ctx, 45) # :rparen tree.add(t) - t = expect(ctx, 14) # :lbrace + t = expect(ctx, 42) # :lbrace tree.add(t) subtree = parse__gen19(ctx) tree.add(subtree) - t = expect(ctx, 36) # :rbrace - tree.add(t) - return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[59] if x >=0], - rules[105] - ) -def parse_parameter_meta(ctx): - current = ctx.tokens.current() - rule = table[4][current.id] if current else -1 - tree = ParseTree(NonTerminal(60, 'parameter_meta')) - ctx.nonterminal = "parameter_meta" - tree.list = False - if current == None: - raise ctx.errors.unexpected_eof() - if rule == 49: # $parameter_meta = :parameter_meta $map -> ParameterMeta( map=$1 ) - ctx.rule = rules[49] - ast_parameters = OrderedDict([ - ('map', 1), - ]) - tree.astTransform = AstTransformNodeCreator('ParameterMeta', ast_parameters) - t = expect(ctx, 39) # :parameter_meta + t = expect(ctx, 33) # :rbrace tree.add(t) - subtree = parse_map(ctx) - tree.add(subtree) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), [terminals[x] for x in nonterminal_first[60] if x >=0], - rules[49] + rules[104] ) -def parse_cmd_param(ctx): +def parse__gen24(ctx): current = ctx.tokens.current() rule = table[5][current.id] if current else -1 - tree = ParseTree(NonTerminal(61, 'cmd_param')) - ctx.nonterminal = "cmd_param" - tree.list = False + tree = ParseTree(NonTerminal(61, '_gen24')) + ctx.nonterminal = "_gen24" + tree.list = True + if current != None and current.id in nonterminal_follow[61] and current.id not in nonterminal_first[61]: + return tree if current == None: - raise ctx.errors.unexpected_eof() - if rule == 40: # $cmd_param = :cmd_param_start $_gen11 $e :cmd_param_end -> CommandParameter( attributes=$1, expr=$2 ) - ctx.rule = rules[40] - ast_parameters = OrderedDict([ - ('attributes', 1), - ('expr', 2), - ]) - tree.astTransform = AstTransformNodeCreator('CommandParameter', ast_parameters) - t = expect(ctx, 6) # :cmd_param_start - tree.add(t) - subtree = parse__gen11(ctx) + return tree + if rule == 83: # $_gen24 = $call_input $_gen24 + ctx.rule = rules[83] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_call_input(ctx) tree.add(subtree) - subtree = parse_e(ctx) + subtree = parse__gen24(ctx) tree.add(subtree) - t = expect(ctx, 20) # :cmd_param_end - tree.add(t) return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[61] if x >=0], - rules[40] - ) -def parse__gen16(ctx): + return tree +def parse__gen37(ctx): current = ctx.tokens.current() rule = table[6][current.id] if current else -1 - tree = ParseTree(NonTerminal(62, '_gen16')) - ctx.nonterminal = "_gen16" + tree = ParseTree(NonTerminal(62, '_gen37')) + ctx.nonterminal = "_gen37" tree.list = True if current != None and current.id in nonterminal_follow[62] and current.id not in nonterminal_first[62]: return tree if current == None: return tree - if rule == 52: # $_gen16 = $kv $_gen16 - ctx.rule = rules[52] + if rule == 143: # $_gen37 = :comma $map_kv $_gen37 + ctx.rule = rules[143] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_kv(ctx) + t = expect(ctx, 43) # :comma + tree.add(t) + tree.listSeparator = t + subtree = parse_map_kv(ctx) tree.add(subtree) - subtree = parse__gen16(ctx) + subtree = parse__gen37(ctx) tree.add(subtree) return tree return tree -def parse__gen20(ctx): +def parse__gen1(ctx): current = ctx.tokens.current() rule = table[7][current.id] if current else -1 - tree = ParseTree(NonTerminal(63, '_gen20')) - ctx.nonterminal = "_gen20" + tree = ParseTree(NonTerminal(63, '_gen1')) + ctx.nonterminal = "_gen1" tree.list = True if current != None and current.id in nonterminal_follow[63] and current.id not in nonterminal_first[63]: return tree if current == None: return tree - if rule == 67: # $_gen20 = $wf_body_element $_gen20 - ctx.rule = rules[67] + if rule == 1: # $_gen1 = $import $_gen1 + ctx.rule = rules[1] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_wf_body_element(ctx) + subtree = parse_import(ctx) tree.add(subtree) - subtree = parse__gen20(ctx) + subtree = parse__gen1(ctx) tree.add(subtree) return tree return tree -def parse_cmd_param_kv(ctx): +def parse__gen18(ctx): current = ctx.tokens.current() rule = table[8][current.id] if current else -1 - tree = ParseTree(NonTerminal(64, 'cmd_param_kv')) - ctx.nonterminal = "cmd_param_kv" + tree = ParseTree(NonTerminal(64, '_gen18')) + ctx.nonterminal = "_gen18" tree.list = False + if current != None and current.id in nonterminal_follow[64] and current.id not in nonterminal_first[64]: + return tree if current == None: - raise ctx.errors.unexpected_eof() - if rule == 41: # $cmd_param_kv = :cmd_attr_hint :identifier :equal $e -> CommandParameterAttr( key=$1, value=$3 ) - ctx.rule = rules[41] - ast_parameters = OrderedDict([ - ('key', 1), - ('value', 3), - ]) - tree.astTransform = AstTransformNodeCreator('CommandParameterAttr', ast_parameters) - t = expect(ctx, 16) # :cmd_attr_hint - tree.add(t) - t = expect(ctx, 17) # :identifier - tree.add(t) - t = expect(ctx, 53) # :equal - tree.add(t) - subtree = parse_e(ctx) + return tree + if rule == 59: # $_gen18 = $setter + ctx.rule = rules[59] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_setter(ctx) tree.add(subtree) return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[64] if x >=0], - rules[41] - ) -def parse_alias(ctx): + return tree +def parse_workflow_or_task(ctx): current = ctx.tokens.current() rule = table[9][current.id] if current else -1 - tree = ParseTree(NonTerminal(65, 'alias')) - ctx.nonterminal = "alias" + tree = ParseTree(NonTerminal(65, 'workflow_or_task')) + ctx.nonterminal = "workflow_or_task" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 93: # $alias = :as :identifier -> $1 - ctx.rule = rules[93] - tree.astTransform = AstTransformSubstitution(1) - t = expect(ctx, 34) # :as - tree.add(t) - t = expect(ctx, 17) # :identifier - tree.add(t) + if rule == 9: # $workflow_or_task = $workflow + ctx.rule = rules[9] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_workflow(ctx) + tree.add(subtree) + return tree + elif rule == 10: # $workflow_or_task = $task + ctx.rule = rules[10] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_task(ctx) + tree.add(subtree) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), [terminals[x] for x in nonterminal_first[65] if x >=0], - rules[93] + rules[10] ) -def parse_meta(ctx): +def parse__gen10(ctx): current = ctx.tokens.current() rule = table[10][current.id] if current else -1 - tree = ParseTree(NonTerminal(66, 'meta')) - ctx.nonterminal = "meta" + tree = ParseTree(NonTerminal(66, '_gen10')) + ctx.nonterminal = "_gen10" + tree.list = True + if current != None and current.id in nonterminal_follow[66] and current.id not in nonterminal_first[66]: + return tree + if current == None: + return tree + if rule == 30: # $_gen10 = $command_part $_gen10 + ctx.rule = rules[30] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_command_part(ctx) + tree.add(subtree) + subtree = parse__gen10(ctx) + tree.add(subtree) + return tree + return tree +def parse_postfix_quantifier(ctx): + current = ctx.tokens.current() + rule = table[11][current.id] if current else -1 + tree = ParseTree(NonTerminal(67, 'postfix_quantifier')) + ctx.nonterminal = "postfix_quantifier" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 50: # $meta = :meta $map -> Meta( map=$1 ) - ctx.rule = rules[50] - ast_parameters = OrderedDict([ - ('map', 1), - ]) - tree.astTransform = AstTransformNodeCreator('Meta', ast_parameters) - t = expect(ctx, 30) # :meta + if rule == 63: # $postfix_quantifier = :qmark + ctx.rule = rules[63] + tree.astTransform = AstTransformSubstitution(0) + t = expect(ctx, 38) # :qmark + tree.add(t) + return tree + elif rule == 64: # $postfix_quantifier = :plus + ctx.rule = rules[64] + tree.astTransform = AstTransformSubstitution(0) + t = expect(ctx, 51) # :plus tree.add(t) - subtree = parse_map(ctx) - tree.add(subtree) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[66] if x >=0], - rules[50] + [terminals[x] for x in nonterminal_first[67] if x >=0], + rules[64] ) def parse_mapping(ctx): current = ctx.tokens.current() - rule = table[11][current.id] if current else -1 - tree = ParseTree(NonTerminal(67, 'mapping')) + rule = table[12][current.id] if current else -1 + tree = ParseTree(NonTerminal(68, 'mapping')) ctx.nonterminal = "mapping" tree.list = False if current == None: @@ -2021,9 +1980,9 @@ def parse_mapping(ctx): ('value', 2), ]) tree.astTransform = AstTransformNodeCreator('IOMapping', ast_parameters) - t = expect(ctx, 17) # :identifier + t = expect(ctx, 47) # :identifier tree.add(t) - t = expect(ctx, 53) # :equal + t = expect(ctx, 15) # :equal tree.add(t) subtree = parse_e(ctx) tree.add(subtree) @@ -2031,261 +1990,270 @@ def parse_mapping(ctx): raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[67] if x >=0], + [terminals[x] for x in nonterminal_first[68] if x >=0], rules[92] ) -def parse__gen1(ctx): +def parse_task(ctx): current = ctx.tokens.current() - rule = table[12][current.id] if current else -1 - tree = ParseTree(NonTerminal(68, '_gen1')) - ctx.nonterminal = "_gen1" - tree.list = True - if current != None and current.id in nonterminal_follow[68] and current.id not in nonterminal_first[68]: - return tree + rule = table[13][current.id] if current else -1 + tree = ParseTree(NonTerminal(69, 'task')) + ctx.nonterminal = "task" + tree.list = False if current == None: - return tree - if rule == 1: # $_gen1 = $import $_gen1 - ctx.rule = rules[1] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_import(ctx) + raise ctx.errors.unexpected_eof() + if rule == 23: # $task = :task :identifier :lbrace $_gen5 $_gen7 :rbrace -> Task( name=$1, declarations=$3, sections=$4 ) + ctx.rule = rules[23] + ast_parameters = OrderedDict([ + ('name', 1), + ('declarations', 3), + ('sections', 4), + ]) + tree.astTransform = AstTransformNodeCreator('Task', ast_parameters) + t = expect(ctx, 8) # :task + tree.add(t) + t = expect(ctx, 47) # :identifier + tree.add(t) + t = expect(ctx, 42) # :lbrace + tree.add(t) + subtree = parse__gen5(ctx) tree.add(subtree) - subtree = parse__gen1(ctx) + subtree = parse__gen7(ctx) tree.add(subtree) + t = expect(ctx, 33) # :rbrace + tree.add(t) return tree - return tree -def parse__gen26(ctx): + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[69] if x >=0], + rules[23] + ) +def parse_scatter(ctx): current = ctx.tokens.current() rule = table[14][current.id] if current else -1 - tree = ParseTree(NonTerminal(70, '_gen26')) - ctx.nonterminal = "_gen26" - tree.list = True - if current != None and current.id in nonterminal_follow[70] and current.id not in nonterminal_first[70]: - return tree + tree = ParseTree(NonTerminal(70, 'scatter')) + ctx.nonterminal = "scatter" + tree.list = False if current == None: - return tree - if rule == 88: # $_gen26 = :comma $mapping $_gen26 - ctx.rule = rules[88] - tree.astTransform = AstTransformSubstitution(0) - t = expect(ctx, 15) # :comma - tree.add(t) - tree.listSeparator = t - subtree = parse_mapping(ctx) - tree.add(subtree) - subtree = parse__gen26(ctx) + raise ctx.errors.unexpected_eof() + if rule == 105: # $scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen19 :rbrace -> Scatter( item=$2, collection=$4, body=$7 ) + ctx.rule = rules[105] + ast_parameters = OrderedDict([ + ('item', 2), + ('collection', 4), + ('body', 7), + ]) + tree.astTransform = AstTransformNodeCreator('Scatter', ast_parameters) + t = expect(ctx, 20) # :scatter + tree.add(t) + t = expect(ctx, 48) # :lparen + tree.add(t) + t = expect(ctx, 47) # :identifier + tree.add(t) + t = expect(ctx, 10) # :in + tree.add(t) + subtree = parse_e(ctx) + tree.add(subtree) + t = expect(ctx, 45) # :rparen + tree.add(t) + t = expect(ctx, 42) # :lbrace + tree.add(t) + subtree = parse__gen19(ctx) tree.add(subtree) + t = expect(ctx, 33) # :rbrace + tree.add(t) return tree - return tree -def parse__gen8(ctx): + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[70] if x >=0], + rules[105] + ) +def parse__gen19(ctx): current = ctx.tokens.current() rule = table[15][current.id] if current else -1 - tree = ParseTree(NonTerminal(71, '_gen8')) - ctx.nonterminal = "_gen8" + tree = ParseTree(NonTerminal(71, '_gen19')) + ctx.nonterminal = "_gen19" tree.list = True if current != None and current.id in nonterminal_follow[71] and current.id not in nonterminal_first[71]: return tree if current == None: return tree - if rule == 20: # $_gen8 = $sections $_gen8 - ctx.rule = rules[20] + if rule == 66: # $_gen19 = $wf_body_element $_gen20 + ctx.rule = rules[66] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_sections(ctx) + subtree = parse_wf_body_element(ctx) tree.add(subtree) - subtree = parse__gen8(ctx) + subtree = parse__gen20(ctx) tree.add(subtree) return tree return tree -def parse__gen31(ctx): +def parse__gen8(ctx): current = ctx.tokens.current() rule = table[16][current.id] if current else -1 - tree = ParseTree(NonTerminal(72, '_gen31')) - ctx.nonterminal = "_gen31" + tree = ParseTree(NonTerminal(72, '_gen8')) + ctx.nonterminal = "_gen8" tree.list = True if current != None and current.id in nonterminal_follow[72] and current.id not in nonterminal_first[72]: return tree if current == None: return tree - if rule == 108: # $_gen31 = :comma $type_e $_gen31 - ctx.rule = rules[108] + if rule == 20: # $_gen8 = $sections $_gen8 + ctx.rule = rules[20] tree.astTransform = AstTransformSubstitution(0) - t = expect(ctx, 15) # :comma - tree.add(t) - tree.listSeparator = t - subtree = parse_type_e(ctx) + subtree = parse_sections(ctx) tree.add(subtree) - subtree = parse__gen31(ctx) + subtree = parse__gen8(ctx) tree.add(subtree) return tree return tree -def parse_runtime(ctx): +def parse_output_kv(ctx): current = ctx.tokens.current() rule = table[17][current.id] if current else -1 - tree = ParseTree(NonTerminal(73, 'runtime')) - ctx.nonterminal = "runtime" + tree = ParseTree(NonTerminal(73, 'output_kv')) + ctx.nonterminal = "output_kv" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 48: # $runtime = :runtime $map -> Runtime( map=$1 ) - ctx.rule = rules[48] + if rule == 47: # $output_kv = $type_e :identifier :equal $e -> Output( type=$0, var=$1, expression=$3 ) + ctx.rule = rules[47] ast_parameters = OrderedDict([ - ('map', 1), + ('type', 0), + ('var', 1), + ('expression', 3), ]) - tree.astTransform = AstTransformNodeCreator('Runtime', ast_parameters) - t = expect(ctx, 1) # :runtime + tree.astTransform = AstTransformNodeCreator('Output', ast_parameters) + subtree = parse_type_e(ctx) + tree.add(subtree) + t = expect(ctx, 47) # :identifier tree.add(t) - subtree = parse_map(ctx) + t = expect(ctx, 15) # :equal + tree.add(t) + subtree = parse_e(ctx) tree.add(subtree) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), [terminals[x] for x in nonterminal_first[73] if x >=0], - rules[48] + rules[47] ) -def parse__gen9(ctx): +def parse_parameter_meta(ctx): current = ctx.tokens.current() rule = table[18][current.id] if current else -1 - tree = ParseTree(NonTerminal(74, '_gen9')) - ctx.nonterminal = "_gen9" - tree.list = True - if current != None and current.id in nonterminal_follow[74] and current.id not in nonterminal_first[74]: - return tree + tree = ParseTree(NonTerminal(74, 'parameter_meta')) + ctx.nonterminal = "parameter_meta" + tree.list = False if current == None: - return tree - if rule == 29: # $_gen9 = $command_part $_gen10 - ctx.rule = rules[29] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_command_part(ctx) - tree.add(subtree) - subtree = parse__gen10(ctx) + raise ctx.errors.unexpected_eof() + if rule == 49: # $parameter_meta = :parameter_meta $map -> ParameterMeta( map=$1 ) + ctx.rule = rules[49] + ast_parameters = OrderedDict([ + ('map', 1), + ]) + tree.astTransform = AstTransformNodeCreator('ParameterMeta', ast_parameters) + t = expect(ctx, 39) # :parameter_meta + tree.add(t) + subtree = parse_map(ctx) tree.add(subtree) return tree - return tree -def parse_workflow_or_task(ctx): + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[74] if x >=0], + rules[49] + ) +def parse__gen7(ctx): current = ctx.tokens.current() rule = table[19][current.id] if current else -1 - tree = ParseTree(NonTerminal(75, 'workflow_or_task')) - ctx.nonterminal = "workflow_or_task" - tree.list = False + tree = ParseTree(NonTerminal(75, '_gen7')) + ctx.nonterminal = "_gen7" + tree.list = True + if current != None and current.id in nonterminal_follow[75] and current.id not in nonterminal_first[75]: + return tree if current == None: - raise ctx.errors.unexpected_eof() - if rule == 9: # $workflow_or_task = $workflow - ctx.rule = rules[9] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_workflow(ctx) - tree.add(subtree) return tree - elif rule == 10: # $workflow_or_task = $task - ctx.rule = rules[10] + if rule == 19: # $_gen7 = $sections $_gen8 + ctx.rule = rules[19] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_task(ctx) + subtree = parse_sections(ctx) + tree.add(subtree) + subtree = parse__gen8(ctx) tree.add(subtree) return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[75] if x >=0], - rules[10] - ) -def parse_object_kv(ctx): + return tree +def parse_wf_outputs(ctx): current = ctx.tokens.current() rule = table[20][current.id] if current else -1 - tree = ParseTree(NonTerminal(76, 'object_kv')) - ctx.nonterminal = "object_kv" + tree = ParseTree(NonTerminal(76, 'wf_outputs')) + ctx.nonterminal = "wf_outputs" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 106: # $object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 ) - ctx.rule = rules[106] + if rule == 98: # $wf_outputs = :output :lbrace $_gen27 :rbrace -> WorkflowOutputs( outputs=$2 ) + ctx.rule = rules[98] ast_parameters = OrderedDict([ - ('key', 0), - ('value', 2), + ('outputs', 2), ]) - tree.astTransform = AstTransformNodeCreator('ObjectKV', ast_parameters) - t = expect(ctx, 17) # :identifier + tree.astTransform = AstTransformNodeCreator('WorkflowOutputs', ast_parameters) + t = expect(ctx, 40) # :output tree.add(t) - t = expect(ctx, 22) # :colon + t = expect(ctx, 42) # :lbrace tree.add(t) - subtree = parse_e(ctx) + subtree = parse__gen27(ctx) tree.add(subtree) + t = expect(ctx, 33) # :rbrace + tree.add(t) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), [terminals[x] for x in nonterminal_first[76] if x >=0], - rules[106] + rules[98] ) -def parse__gen2(ctx): +def parse__gen6(ctx): current = ctx.tokens.current() rule = table[21][current.id] if current else -1 - tree = ParseTree(NonTerminal(77, '_gen2')) - ctx.nonterminal = "_gen2" + tree = ParseTree(NonTerminal(77, '_gen6')) + ctx.nonterminal = "_gen6" tree.list = True if current != None and current.id in nonterminal_follow[77] and current.id not in nonterminal_first[77]: return tree if current == None: return tree - if rule == 4: # $_gen2 = $workflow_or_task $_gen3 - ctx.rule = rules[4] + if rule == 16: # $_gen6 = $declaration $_gen6 + ctx.rule = rules[16] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_workflow_or_task(ctx) + subtree = parse_declaration(ctx) tree.add(subtree) - subtree = parse__gen3(ctx) + subtree = parse__gen6(ctx) tree.add(subtree) return tree return tree -def parse__gen15(ctx): +def parse__gen22(ctx): current = ctx.tokens.current() rule = table[22][current.id] if current else -1 - tree = ParseTree(NonTerminal(78, '_gen15')) - ctx.nonterminal = "_gen15" - tree.list = True + tree = ParseTree(NonTerminal(78, '_gen22')) + ctx.nonterminal = "_gen22" + tree.list = False if current != None and current.id in nonterminal_follow[78] and current.id not in nonterminal_first[78]: return tree if current == None: return tree - if rule == 51: # $_gen15 = $kv $_gen16 - ctx.rule = rules[51] + if rule == 79: # $_gen22 = $call_body + ctx.rule = rules[79] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_kv(ctx) - tree.add(subtree) - subtree = parse__gen16(ctx) + subtree = parse_call_body(ctx) tree.add(subtree) return tree return tree -def parse_call_input(ctx): - current = ctx.tokens.current() - rule = table[23][current.id] if current else -1 - tree = ParseTree(NonTerminal(79, 'call_input')) - ctx.nonterminal = "call_input" - tree.list = False - if current == None: - raise ctx.errors.unexpected_eof() - if rule == 91: # $call_input = :input :colon $_gen25 -> Inputs( map=$2 ) - ctx.rule = rules[91] - ast_parameters = OrderedDict([ - ('map', 2), - ]) - tree.astTransform = AstTransformNodeCreator('Inputs', ast_parameters) - t = expect(ctx, 5) # :input - tree.add(t) - t = expect(ctx, 22) # :colon - tree.add(t) - subtree = parse__gen25(ctx) - tree.add(subtree) - return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[79] if x >=0], - rules[91] - ) def parse__gen17(ctx): current = ctx.tokens.current() - rule = table[24][current.id] if current else -1 - tree = ParseTree(NonTerminal(80, '_gen17')) + rule = table[23][current.id] if current else -1 + tree = ParseTree(NonTerminal(79, '_gen17')) ctx.nonterminal = "_gen17" tree.list = False - if current != None and current.id in nonterminal_follow[80] and current.id not in nonterminal_first[80]: + if current != None and current.id in nonterminal_follow[79] and current.id not in nonterminal_first[79]: return tree if current == None: return tree @@ -2296,86 +2264,58 @@ def parse__gen17(ctx): tree.add(subtree) return tree return tree -def parse_import_namespace(ctx): +def parse_alias(ctx): current = ctx.tokens.current() - rule = table[25][current.id] if current else -1 - tree = ParseTree(NonTerminal(81, 'import_namespace')) - ctx.nonterminal = "import_namespace" + rule = table[24][current.id] if current else -1 + tree = ParseTree(NonTerminal(80, 'alias')) + ctx.nonterminal = "alias" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 14: # $import_namespace = :as :identifier -> $1 - ctx.rule = rules[14] + if rule == 93: # $alias = :as :identifier -> $1 + ctx.rule = rules[93] tree.astTransform = AstTransformSubstitution(1) - t = expect(ctx, 34) # :as + t = expect(ctx, 21) # :as tree.add(t) - t = expect(ctx, 17) # :identifier + t = expect(ctx, 47) # :identifier tree.add(t) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[81] if x >=0], - rules[14] + [terminals[x] for x in nonterminal_first[80] if x >=0], + rules[93] ) -def parse_setter(ctx): +def parse__gen33(ctx): current = ctx.tokens.current() - rule = table[26][current.id] if current else -1 - tree = ParseTree(NonTerminal(82, 'setter')) - ctx.nonterminal = "setter" - tree.list = False + rule = table[25][current.id] if current else -1 + tree = ParseTree(NonTerminal(81, '_gen33')) + ctx.nonterminal = "_gen33" + tree.list = True + if current != None and current.id in nonterminal_follow[81] and current.id not in nonterminal_first[81]: + return tree if current == None: - raise ctx.errors.unexpected_eof() - if rule == 62: # $setter = :equal $e -> $1 - ctx.rule = rules[62] - tree.astTransform = AstTransformSubstitution(1) - t = expect(ctx, 53) # :equal + return tree + if rule == 130: # $_gen33 = :comma $e $_gen33 + ctx.rule = rules[130] + tree.astTransform = AstTransformSubstitution(0) + t = expect(ctx, 43) # :comma tree.add(t) + tree.listSeparator = t subtree = parse_e(ctx) tree.add(subtree) + subtree = parse__gen33(ctx) + tree.add(subtree) return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[82] if x >=0], - rules[62] - ) -def parse_map_kv(ctx): + return tree +def parse__gen23(ctx): current = ctx.tokens.current() - rule = table[27][current.id] if current else -1 - tree = ParseTree(NonTerminal(83, 'map_kv')) - ctx.nonterminal = "map_kv" - tree.list = False - if current == None: - raise ctx.errors.unexpected_eof() - if rule == 65: # $map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 ) - ctx.rule = rules[65] - ast_parameters = OrderedDict([ - ('key', 0), - ('value', 2), - ]) - tree.astTransform = AstTransformNodeCreator('MapLiteralKv', ast_parameters) - subtree = parse_e(ctx) - tree.add(subtree) - t = expect(ctx, 22) # :colon - tree.add(t) - subtree = parse_e(ctx) - tree.add(subtree) - return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[83] if x >=0], - rules[65] - ) -def parse__gen23(ctx): - current = ctx.tokens.current() - rule = table[28][current.id] if current else -1 - tree = ParseTree(NonTerminal(84, '_gen23')) - ctx.nonterminal = "_gen23" - tree.list = True - if current != None and current.id in nonterminal_follow[84] and current.id not in nonterminal_first[84]: - return tree + rule = table[26][current.id] if current else -1 + tree = ParseTree(NonTerminal(82, '_gen23')) + ctx.nonterminal = "_gen23" + tree.list = True + if current != None and current.id in nonterminal_follow[82] and current.id not in nonterminal_first[82]: + return tree if current == None: return tree if rule == 82: # $_gen23 = $call_input $_gen24 @@ -2387,491 +2327,470 @@ def parse__gen23(ctx): tree.add(subtree) return tree return tree -def parse_document(ctx): +def parse_outputs(ctx): current = ctx.tokens.current() - rule = table[30][current.id] if current else -1 - tree = ParseTree(NonTerminal(86, 'document')) - ctx.nonterminal = "document" + rule = table[27][current.id] if current else -1 + tree = ParseTree(NonTerminal(83, 'outputs')) + ctx.nonterminal = "outputs" tree.list = False - if current != None and current.id in nonterminal_follow[86] and current.id not in nonterminal_first[86]: - return tree if current == None: - return tree - if rule == 8: # $document = $_gen0 $_gen2 -> Document( imports=$0, definitions=$1 ) - ctx.rule = rules[8] + raise ctx.errors.unexpected_eof() + if rule == 46: # $outputs = :output :lbrace $_gen13 :rbrace -> Outputs( attributes=$2 ) + ctx.rule = rules[46] ast_parameters = OrderedDict([ - ('imports', 0), - ('definitions', 1), + ('attributes', 2), ]) - tree.astTransform = AstTransformNodeCreator('Document', ast_parameters) - subtree = parse__gen0(ctx) - tree.add(subtree) - subtree = parse__gen2(ctx) + tree.astTransform = AstTransformNodeCreator('Outputs', ast_parameters) + t = expect(ctx, 40) # :output + tree.add(t) + t = expect(ctx, 42) # :lbrace + tree.add(t) + subtree = parse__gen13(ctx) tree.add(subtree) + t = expect(ctx, 33) # :rbrace + tree.add(t) return tree - return tree -def parse__gen12(ctx): + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[83] if x >=0], + rules[46] + ) +def parse__gen3(ctx): current = ctx.tokens.current() - rule = table[31][current.id] if current else -1 - tree = ParseTree(NonTerminal(87, '_gen12')) - ctx.nonterminal = "_gen12" + rule = table[28][current.id] if current else -1 + tree = ParseTree(NonTerminal(84, '_gen3')) + ctx.nonterminal = "_gen3" tree.list = True - if current != None and current.id in nonterminal_follow[87] and current.id not in nonterminal_first[87]: + if current != None and current.id in nonterminal_follow[84] and current.id not in nonterminal_first[84]: return tree if current == None: return tree - if rule == 37: # $_gen12 = $cmd_param_kv $_gen12 - ctx.rule = rules[37] + if rule == 5: # $_gen3 = $workflow_or_task $_gen3 + ctx.rule = rules[5] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_cmd_param_kv(ctx) + subtree = parse_workflow_or_task(ctx) tree.add(subtree) - subtree = parse__gen12(ctx) + subtree = parse__gen3(ctx) tree.add(subtree) return tree return tree -def parse__gen14(ctx): +def parse__gen35(ctx): current = ctx.tokens.current() - rule = table[32][current.id] if current else -1 - tree = ParseTree(NonTerminal(88, '_gen14')) - ctx.nonterminal = "_gen14" + rule = table[29][current.id] if current else -1 + tree = ParseTree(NonTerminal(85, '_gen35')) + ctx.nonterminal = "_gen35" tree.list = True - if current != None and current.id in nonterminal_follow[88] and current.id not in nonterminal_first[88]: + if current != None and current.id in nonterminal_follow[85] and current.id not in nonterminal_first[85]: return tree if current == None: return tree - if rule == 43: # $_gen14 = $output_kv $_gen14 - ctx.rule = rules[43] + if rule == 137: # $_gen35 = :comma $object_kv $_gen35 + ctx.rule = rules[137] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_output_kv(ctx) + t = expect(ctx, 43) # :comma + tree.add(t) + tree.listSeparator = t + subtree = parse_object_kv(ctx) tree.add(subtree) - subtree = parse__gen14(ctx) + subtree = parse__gen35(ctx) tree.add(subtree) return tree return tree -def parse_declaration(ctx): +def parse_runtime(ctx): current = ctx.tokens.current() - rule = table[33][current.id] if current else -1 - tree = ParseTree(NonTerminal(89, 'declaration')) - ctx.nonterminal = "declaration" + rule = table[30][current.id] if current else -1 + tree = ParseTree(NonTerminal(86, 'runtime')) + ctx.nonterminal = "runtime" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 61: # $declaration = $type_e $_gen17 :identifier $_gen18 -> Declaration( type=$0, postfix=$1, name=$2, expression=$3 ) - ctx.rule = rules[61] + if rule == 48: # $runtime = :runtime $map -> Runtime( map=$1 ) + ctx.rule = rules[48] ast_parameters = OrderedDict([ - ('type', 0), - ('postfix', 1), - ('name', 2), - ('expression', 3), + ('map', 1), ]) - tree.astTransform = AstTransformNodeCreator('Declaration', ast_parameters) - subtree = parse_type_e(ctx) + tree.astTransform = AstTransformNodeCreator('Runtime', ast_parameters) + t = expect(ctx, 12) # :runtime + tree.add(t) + subtree = parse_map(ctx) tree.add(subtree) - subtree = parse__gen17(ctx) + return tree + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[86] if x >=0], + rules[48] + ) +def parse_while_loop(ctx): + current = ctx.tokens.current() + rule = table[31][current.id] if current else -1 + tree = ParseTree(NonTerminal(87, 'while_loop')) + ctx.nonterminal = "while_loop" + tree.list = False + if current == None: + raise ctx.errors.unexpected_eof() + if rule == 103: # $while_loop = :while :lparen $e :rparen :lbrace $_gen19 :rbrace -> WhileLoop( expression=$2, body=$5 ) + ctx.rule = rules[103] + ast_parameters = OrderedDict([ + ('expression', 2), + ('body', 5), + ]) + tree.astTransform = AstTransformNodeCreator('WhileLoop', ast_parameters) + t = expect(ctx, 34) # :while + tree.add(t) + t = expect(ctx, 48) # :lparen + tree.add(t) + subtree = parse_e(ctx) tree.add(subtree) - t = expect(ctx, 17) # :identifier + t = expect(ctx, 45) # :rparen tree.add(t) - subtree = parse__gen18(ctx) + t = expect(ctx, 42) # :lbrace + tree.add(t) + subtree = parse__gen19(ctx) tree.add(subtree) + t = expect(ctx, 33) # :rbrace + tree.add(t) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[89] if x >=0], - rules[61] + [terminals[x] for x in nonterminal_first[87] if x >=0], + rules[103] ) -def parse__gen22(ctx): +def parse_import(ctx): current = ctx.tokens.current() - rule = table[34][current.id] if current else -1 - tree = ParseTree(NonTerminal(90, '_gen22')) - ctx.nonterminal = "_gen22" + rule = table[32][current.id] if current else -1 + tree = ParseTree(NonTerminal(88, 'import')) + ctx.nonterminal = "import" tree.list = False - if current != None and current.id in nonterminal_follow[90] and current.id not in nonterminal_first[90]: - return tree if current == None: + raise ctx.errors.unexpected_eof() + if rule == 13: # $import = :import :string $_gen4 -> Import( uri=$1, namespace=$2 ) + ctx.rule = rules[13] + ast_parameters = OrderedDict([ + ('uri', 1), + ('namespace', 2), + ]) + tree.astTransform = AstTransformNodeCreator('Import', ast_parameters) + t = expect(ctx, 7) # :import + tree.add(t) + t = expect(ctx, 49) # :string + tree.add(t) + subtree = parse__gen4(ctx) + tree.add(subtree) return tree - if rule == 79: # $_gen22 = $call_body - ctx.rule = rules[79] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_call_body(ctx) + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[88] if x >=0], + rules[13] + ) +def parse_workflow(ctx): + current = ctx.tokens.current() + rule = table[33][current.id] if current else -1 + tree = ParseTree(NonTerminal(89, 'workflow')) + ctx.nonterminal = "workflow" + tree.list = False + if current == None: + raise ctx.errors.unexpected_eof() + if rule == 70: # $workflow = :workflow :identifier :lbrace $_gen19 :rbrace -> Workflow( name=$1, body=$3 ) + ctx.rule = rules[70] + ast_parameters = OrderedDict([ + ('name', 1), + ('body', 3), + ]) + tree.astTransform = AstTransformNodeCreator('Workflow', ast_parameters) + t = expect(ctx, 9) # :workflow + tree.add(t) + t = expect(ctx, 47) # :identifier + tree.add(t) + t = expect(ctx, 42) # :lbrace + tree.add(t) + subtree = parse__gen19(ctx) tree.add(subtree) + t = expect(ctx, 33) # :rbrace + tree.add(t) return tree - return tree -def parse__gen35(ctx): + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[89] if x >=0], + rules[70] + ) +def parse__gen2(ctx): current = ctx.tokens.current() - rule = table[35][current.id] if current else -1 - tree = ParseTree(NonTerminal(91, '_gen35')) - ctx.nonterminal = "_gen35" + rule = table[34][current.id] if current else -1 + tree = ParseTree(NonTerminal(90, '_gen2')) + ctx.nonterminal = "_gen2" tree.list = True - if current != None and current.id in nonterminal_follow[91] and current.id not in nonterminal_first[91]: + if current != None and current.id in nonterminal_follow[90] and current.id not in nonterminal_first[90]: return tree if current == None: return tree - if rule == 137: # $_gen35 = :comma $object_kv $_gen35 - ctx.rule = rules[137] + if rule == 4: # $_gen2 = $workflow_or_task $_gen3 + ctx.rule = rules[4] tree.astTransform = AstTransformSubstitution(0) - t = expect(ctx, 15) # :comma - tree.add(t) - tree.listSeparator = t - subtree = parse_object_kv(ctx) + subtree = parse_workflow_or_task(ctx) tree.add(subtree) - subtree = parse__gen35(ctx) + subtree = parse__gen3(ctx) tree.add(subtree) return tree return tree -def parse__gen36(ctx): +def parse__gen12(ctx): current = ctx.tokens.current() rule = table[36][current.id] if current else -1 - tree = ParseTree(NonTerminal(92, '_gen36')) - ctx.nonterminal = "_gen36" + tree = ParseTree(NonTerminal(92, '_gen12')) + ctx.nonterminal = "_gen12" tree.list = True if current != None and current.id in nonterminal_follow[92] and current.id not in nonterminal_first[92]: return tree if current == None: return tree - if rule == 142: # $_gen36 = $map_kv $_gen37 - ctx.rule = rules[142] + if rule == 37: # $_gen12 = $cmd_param_kv $_gen12 + ctx.rule = rules[37] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_map_kv(ctx) + subtree = parse_cmd_param_kv(ctx) tree.add(subtree) - subtree = parse__gen37(ctx) + subtree = parse__gen12(ctx) tree.add(subtree) return tree return tree -def parse_task(ctx): +def parse__gen20(ctx): current = ctx.tokens.current() rule = table[37][current.id] if current else -1 - tree = ParseTree(NonTerminal(93, 'task')) - ctx.nonterminal = "task" - tree.list = False + tree = ParseTree(NonTerminal(93, '_gen20')) + ctx.nonterminal = "_gen20" + tree.list = True + if current != None and current.id in nonterminal_follow[93] and current.id not in nonterminal_first[93]: + return tree if current == None: - raise ctx.errors.unexpected_eof() - if rule == 23: # $task = :task :identifier :lbrace $_gen5 $_gen7 :rbrace -> Task( name=$1, declarations=$3, sections=$4 ) - ctx.rule = rules[23] - ast_parameters = OrderedDict([ - ('name', 1), - ('declarations', 3), - ('sections', 4), - ]) - tree.astTransform = AstTransformNodeCreator('Task', ast_parameters) - t = expect(ctx, 47) # :task - tree.add(t) - t = expect(ctx, 17) # :identifier - tree.add(t) - t = expect(ctx, 14) # :lbrace - tree.add(t) - subtree = parse__gen5(ctx) + return tree + if rule == 67: # $_gen20 = $wf_body_element $_gen20 + ctx.rule = rules[67] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_wf_body_element(ctx) tree.add(subtree) - subtree = parse__gen7(ctx) + subtree = parse__gen20(ctx) tree.add(subtree) - t = expect(ctx, 36) # :rbrace - tree.add(t) return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[93] if x >=0], - rules[23] - ) -def parse__gen7(ctx): + return tree +def parse__gen25(ctx): current = ctx.tokens.current() rule = table[38][current.id] if current else -1 - tree = ParseTree(NonTerminal(94, '_gen7')) - ctx.nonterminal = "_gen7" + tree = ParseTree(NonTerminal(94, '_gen25')) + ctx.nonterminal = "_gen25" tree.list = True if current != None and current.id in nonterminal_follow[94] and current.id not in nonterminal_first[94]: return tree if current == None: return tree - if rule == 19: # $_gen7 = $sections $_gen8 - ctx.rule = rules[19] + if rule == 87: # $_gen25 = $mapping $_gen26 + ctx.rule = rules[87] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_sections(ctx) + subtree = parse_mapping(ctx) tree.add(subtree) - subtree = parse__gen8(ctx) + subtree = parse__gen26(ctx) tree.add(subtree) return tree return tree -def parse__gen3(ctx): +def parse__gen30(ctx): current = ctx.tokens.current() rule = table[39][current.id] if current else -1 - tree = ParseTree(NonTerminal(95, '_gen3')) - ctx.nonterminal = "_gen3" + tree = ParseTree(NonTerminal(95, '_gen30')) + ctx.nonterminal = "_gen30" tree.list = True if current != None and current.id in nonterminal_follow[95] and current.id not in nonterminal_first[95]: return tree if current == None: return tree - if rule == 5: # $_gen3 = $workflow_or_task $_gen3 - ctx.rule = rules[5] + if rule == 107: # $_gen30 = $type_e $_gen31 + ctx.rule = rules[107] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_workflow_or_task(ctx) + subtree = parse_type_e(ctx) tree.add(subtree) - subtree = parse__gen3(ctx) + subtree = parse__gen31(ctx) tree.add(subtree) return tree return tree -def parse__gen10(ctx): +def parse__gen36(ctx): current = ctx.tokens.current() rule = table[40][current.id] if current else -1 - tree = ParseTree(NonTerminal(96, '_gen10')) - ctx.nonterminal = "_gen10" + tree = ParseTree(NonTerminal(96, '_gen36')) + ctx.nonterminal = "_gen36" tree.list = True if current != None and current.id in nonterminal_follow[96] and current.id not in nonterminal_first[96]: return tree if current == None: return tree - if rule == 30: # $_gen10 = $command_part $_gen10 - ctx.rule = rules[30] + if rule == 142: # $_gen36 = $map_kv $_gen37 + ctx.rule = rules[142] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_command_part(ctx) + subtree = parse_map_kv(ctx) tree.add(subtree) - subtree = parse__gen10(ctx) + subtree = parse__gen37(ctx) tree.add(subtree) return tree return tree -def parse_kv(ctx): +def parse_map(ctx): current = ctx.tokens.current() rule = table[41][current.id] if current else -1 - tree = ParseTree(NonTerminal(97, 'kv')) - ctx.nonterminal = "kv" + tree = ParseTree(NonTerminal(97, 'map')) + ctx.nonterminal = "map" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 56: # $kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 ) - ctx.rule = rules[56] - ast_parameters = OrderedDict([ - ('key', 0), - ('value', 2), - ]) - tree.astTransform = AstTransformNodeCreator('RuntimeAttribute', ast_parameters) - t = expect(ctx, 17) # :identifier - tree.add(t) - t = expect(ctx, 22) # :colon + if rule == 55: # $map = :lbrace $_gen15 :rbrace -> $1 + ctx.rule = rules[55] + tree.astTransform = AstTransformSubstitution(1) + t = expect(ctx, 42) # :lbrace tree.add(t) - subtree = parse_e(ctx) + subtree = parse__gen15(ctx) tree.add(subtree) + t = expect(ctx, 33) # :rbrace + tree.add(t) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), [terminals[x] for x in nonterminal_first[97] if x >=0], - rules[56] + rules[55] ) -def parse_postfix_quantifier(ctx): +def parse__gen26(ctx): current = ctx.tokens.current() rule = table[42][current.id] if current else -1 - tree = ParseTree(NonTerminal(98, 'postfix_quantifier')) - ctx.nonterminal = "postfix_quantifier" - tree.list = False + tree = ParseTree(NonTerminal(98, '_gen26')) + ctx.nonterminal = "_gen26" + tree.list = True + if current != None and current.id in nonterminal_follow[98] and current.id not in nonterminal_first[98]: + return tree if current == None: - raise ctx.errors.unexpected_eof() - if rule == 63: # $postfix_quantifier = :qmark - ctx.rule = rules[63] - tree.astTransform = AstTransformSubstitution(0) - t = expect(ctx, 33) # :qmark - tree.add(t) return tree - elif rule == 64: # $postfix_quantifier = :plus - ctx.rule = rules[64] + if rule == 88: # $_gen26 = :comma $mapping $_gen26 + ctx.rule = rules[88] tree.astTransform = AstTransformSubstitution(0) - t = expect(ctx, 9) # :plus + t = expect(ctx, 43) # :comma tree.add(t) + tree.listSeparator = t + subtree = parse_mapping(ctx) + tree.add(subtree) + subtree = parse__gen26(ctx) + tree.add(subtree) return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[98] if x >=0], - rules[64] - ) -def parse_call(ctx): + return tree +def parse_declaration(ctx): current = ctx.tokens.current() rule = table[43][current.id] if current else -1 - tree = ParseTree(NonTerminal(99, 'call')) - ctx.nonterminal = "call" + tree = ParseTree(NonTerminal(99, 'declaration')) + ctx.nonterminal = "declaration" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 81: # $call = :call :fqn $_gen21 $_gen22 -> Call( task=$1, alias=$2, body=$3 ) - ctx.rule = rules[81] + if rule == 61: # $declaration = $type_e $_gen17 :identifier $_gen18 -> Declaration( type=$0, postfix=$1, name=$2, expression=$3 ) + ctx.rule = rules[61] ast_parameters = OrderedDict([ - ('task', 1), - ('alias', 2), - ('body', 3), + ('type', 0), + ('postfix', 1), + ('name', 2), + ('expression', 3), ]) - tree.astTransform = AstTransformNodeCreator('Call', ast_parameters) - t = expect(ctx, 48) # :call - tree.add(t) - t = expect(ctx, 27) # :fqn - tree.add(t) - subtree = parse__gen21(ctx) + tree.astTransform = AstTransformNodeCreator('Declaration', ast_parameters) + subtree = parse_type_e(ctx) tree.add(subtree) - subtree = parse__gen22(ctx) + subtree = parse__gen17(ctx) + tree.add(subtree) + t = expect(ctx, 47) # :identifier + tree.add(t) + subtree = parse__gen18(ctx) tree.add(subtree) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), [terminals[x] for x in nonterminal_first[99] if x >=0], - rules[81] + rules[61] ) -def parse__gen28(ctx): +def parse__gen16(ctx): current = ctx.tokens.current() rule = table[44][current.id] if current else -1 - tree = ParseTree(NonTerminal(100, '_gen28')) - ctx.nonterminal = "_gen28" + tree = ParseTree(NonTerminal(100, '_gen16')) + ctx.nonterminal = "_gen16" tree.list = True if current != None and current.id in nonterminal_follow[100] and current.id not in nonterminal_first[100]: return tree if current == None: return tree - if rule == 95: # $_gen28 = $wf_output $_gen28 - ctx.rule = rules[95] + if rule == 52: # $_gen16 = $kv $_gen16 + ctx.rule = rules[52] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_wf_output(ctx) + subtree = parse_kv(ctx) tree.add(subtree) - subtree = parse__gen28(ctx) + subtree = parse__gen16(ctx) tree.add(subtree) return tree return tree -def parse__gen34(ctx): +def parse__gen28(ctx): current = ctx.tokens.current() rule = table[45][current.id] if current else -1 - tree = ParseTree(NonTerminal(101, '_gen34')) - ctx.nonterminal = "_gen34" + tree = ParseTree(NonTerminal(101, '_gen28')) + ctx.nonterminal = "_gen28" tree.list = True if current != None and current.id in nonterminal_follow[101] and current.id not in nonterminal_first[101]: return tree if current == None: return tree - if rule == 136: # $_gen34 = $object_kv $_gen35 - ctx.rule = rules[136] + if rule == 95: # $_gen28 = $wf_output $_gen28 + ctx.rule = rules[95] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_object_kv(ctx) + subtree = parse_wf_output(ctx) tree.add(subtree) - subtree = parse__gen35(ctx) + subtree = parse__gen28(ctx) tree.add(subtree) return tree return tree -def parse__gen19(ctx): +def parse_import_namespace(ctx): current = ctx.tokens.current() rule = table[46][current.id] if current else -1 - tree = ParseTree(NonTerminal(102, '_gen19')) - ctx.nonterminal = "_gen19" - tree.list = True - if current != None and current.id in nonterminal_follow[102] and current.id not in nonterminal_first[102]: - return tree - if current == None: - return tree - if rule == 66: # $_gen19 = $wf_body_element $_gen20 - ctx.rule = rules[66] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_wf_body_element(ctx) - tree.add(subtree) - subtree = parse__gen20(ctx) - tree.add(subtree) - return tree - return tree -def parse_while_loop(ctx): - current = ctx.tokens.current() - rule = table[47][current.id] if current else -1 - tree = ParseTree(NonTerminal(103, 'while_loop')) - ctx.nonterminal = "while_loop" - tree.list = False - if current == None: - raise ctx.errors.unexpected_eof() - if rule == 103: # $while_loop = :while :lparen $e :rparen :lbrace $_gen19 :rbrace -> WhileLoop( expression=$2, body=$5 ) - ctx.rule = rules[103] - ast_parameters = OrderedDict([ - ('expression', 2), - ('body', 5), - ]) - tree.astTransform = AstTransformNodeCreator('WhileLoop', ast_parameters) - t = expect(ctx, 12) # :while - tree.add(t) - t = expect(ctx, 10) # :lparen - tree.add(t) - subtree = parse_e(ctx) - tree.add(subtree) - t = expect(ctx, 35) # :rparen - tree.add(t) - t = expect(ctx, 14) # :lbrace - tree.add(t) - subtree = parse__gen19(ctx) - tree.add(subtree) - t = expect(ctx, 36) # :rbrace - tree.add(t) - return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[103] if x >=0], - rules[103] - ) -def parse_map(ctx): - current = ctx.tokens.current() - rule = table[48][current.id] if current else -1 - tree = ParseTree(NonTerminal(104, 'map')) - ctx.nonterminal = "map" + tree = ParseTree(NonTerminal(102, 'import_namespace')) + ctx.nonterminal = "import_namespace" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 55: # $map = :lbrace $_gen15 :rbrace -> $1 - ctx.rule = rules[55] + if rule == 14: # $import_namespace = :as :identifier -> $1 + ctx.rule = rules[14] tree.astTransform = AstTransformSubstitution(1) - t = expect(ctx, 14) # :lbrace + t = expect(ctx, 21) # :as tree.add(t) - subtree = parse__gen15(ctx) - tree.add(subtree) - t = expect(ctx, 36) # :rbrace + t = expect(ctx, 47) # :identifier tree.add(t) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[104] if x >=0], - rules[55] + [terminals[x] for x in nonterminal_first[102] if x >=0], + rules[14] ) -def parse_if_stmt(ctx): +def parse__gen21(ctx): current = ctx.tokens.current() - rule = table[49][current.id] if current else -1 - tree = ParseTree(NonTerminal(105, 'if_stmt')) - ctx.nonterminal = "if_stmt" + rule = table[47][current.id] if current else -1 + tree = ParseTree(NonTerminal(103, '_gen21')) + ctx.nonterminal = "_gen21" tree.list = False + if current != None and current.id in nonterminal_follow[103] and current.id not in nonterminal_first[103]: + return tree if current == None: - raise ctx.errors.unexpected_eof() - if rule == 104: # $if_stmt = :if :lparen $e :rparen :lbrace $_gen19 :rbrace -> If( expression=$2, body=$5 ) - ctx.rule = rules[104] - ast_parameters = OrderedDict([ - ('expression', 2), - ('body', 5), - ]) - tree.astTransform = AstTransformNodeCreator('If', ast_parameters) - t = expect(ctx, 29) # :if - tree.add(t) - t = expect(ctx, 10) # :lparen - tree.add(t) - subtree = parse_e(ctx) - tree.add(subtree) - t = expect(ctx, 35) # :rparen - tree.add(t) - t = expect(ctx, 14) # :lbrace - tree.add(t) - subtree = parse__gen19(ctx) + return tree + if rule == 77: # $_gen21 = $alias + ctx.rule = rules[77] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_alias(ctx) tree.add(subtree) - t = expect(ctx, 36) # :rbrace - tree.add(t) return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[105] if x >=0], - rules[104] - ) + return tree def parse_wf_body_element(ctx): current = ctx.tokens.current() - rule = table[50][current.id] if current else -1 - tree = ParseTree(NonTerminal(106, 'wf_body_element')) + rule = table[48][current.id] if current else -1 + tree = ParseTree(NonTerminal(104, 'wf_body_element')) ctx.nonterminal = "wf_body_element" tree.list = False if current == None: @@ -2915,167 +2834,180 @@ def parse_wf_body_element(ctx): raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[106] if x >=0], + [terminals[x] for x in nonterminal_first[104] if x >=0], rules[76] ) -def parse__gen0(ctx): +def parse__gen4(ctx): + current = ctx.tokens.current() + rule = table[49][current.id] if current else -1 + tree = ParseTree(NonTerminal(105, '_gen4')) + ctx.nonterminal = "_gen4" + tree.list = False + if current != None and current.id in nonterminal_follow[105] and current.id not in nonterminal_first[105]: + return tree + if current == None: + return tree + if rule == 11: # $_gen4 = $import_namespace + ctx.rule = rules[11] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_import_namespace(ctx) + tree.add(subtree) + return tree + return tree +def parse_object_kv(ctx): + current = ctx.tokens.current() + rule = table[50][current.id] if current else -1 + tree = ParseTree(NonTerminal(106, 'object_kv')) + ctx.nonterminal = "object_kv" + tree.list = False + if current == None: + raise ctx.errors.unexpected_eof() + if rule == 106: # $object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 ) + ctx.rule = rules[106] + ast_parameters = OrderedDict([ + ('key', 0), + ('value', 2), + ]) + tree.astTransform = AstTransformNodeCreator('ObjectKV', ast_parameters) + t = expect(ctx, 47) # :identifier + tree.add(t) + t = expect(ctx, 31) # :colon + tree.add(t) + subtree = parse_e(ctx) + tree.add(subtree) + return tree + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[106] if x >=0], + rules[106] + ) +def parse__gen34(ctx): current = ctx.tokens.current() rule = table[51][current.id] if current else -1 - tree = ParseTree(NonTerminal(107, '_gen0')) - ctx.nonterminal = "_gen0" + tree = ParseTree(NonTerminal(107, '_gen34')) + ctx.nonterminal = "_gen34" tree.list = True if current != None and current.id in nonterminal_follow[107] and current.id not in nonterminal_first[107]: return tree if current == None: return tree - if rule == 0: # $_gen0 = $import $_gen1 - ctx.rule = rules[0] + if rule == 136: # $_gen34 = $object_kv $_gen35 + ctx.rule = rules[136] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_import(ctx) + subtree = parse_object_kv(ctx) tree.add(subtree) - subtree = parse__gen1(ctx) + subtree = parse__gen35(ctx) tree.add(subtree) return tree return tree -def parse__gen6(ctx): +def parse_map_kv(ctx): current = ctx.tokens.current() rule = table[52][current.id] if current else -1 - tree = ParseTree(NonTerminal(108, '_gen6')) - ctx.nonterminal = "_gen6" - tree.list = True - if current != None and current.id in nonterminal_follow[108] and current.id not in nonterminal_first[108]: - return tree + tree = ParseTree(NonTerminal(108, 'map_kv')) + ctx.nonterminal = "map_kv" + tree.list = False if current == None: - return tree - if rule == 16: # $_gen6 = $declaration $_gen6 - ctx.rule = rules[16] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_declaration(ctx) + raise ctx.errors.unexpected_eof() + if rule == 65: # $map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 ) + ctx.rule = rules[65] + ast_parameters = OrderedDict([ + ('key', 0), + ('value', 2), + ]) + tree.astTransform = AstTransformNodeCreator('MapLiteralKv', ast_parameters) + subtree = parse_e(ctx) tree.add(subtree) - subtree = parse__gen6(ctx) + t = expect(ctx, 31) # :colon + tree.add(t) + subtree = parse_e(ctx) tree.add(subtree) return tree - return tree -def parse__gen5(ctx): + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[108] if x >=0], + rules[65] + ) +def parse__gen9(ctx): current = ctx.tokens.current() rule = table[53][current.id] if current else -1 - tree = ParseTree(NonTerminal(109, '_gen5')) - ctx.nonterminal = "_gen5" + tree = ParseTree(NonTerminal(109, '_gen9')) + ctx.nonterminal = "_gen9" tree.list = True if current != None and current.id in nonterminal_follow[109] and current.id not in nonterminal_first[109]: return tree if current == None: return tree - if rule == 15: # $_gen5 = $declaration $_gen6 - ctx.rule = rules[15] + if rule == 29: # $_gen9 = $command_part $_gen10 + ctx.rule = rules[29] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_declaration(ctx) + subtree = parse_command_part(ctx) tree.add(subtree) - subtree = parse__gen6(ctx) + subtree = parse__gen10(ctx) tree.add(subtree) return tree return tree -def parse__gen33(ctx): +def parse__gen5(ctx): current = ctx.tokens.current() - rule = table[54][current.id] if current else -1 - tree = ParseTree(NonTerminal(110, '_gen33')) - ctx.nonterminal = "_gen33" + rule = table[55][current.id] if current else -1 + tree = ParseTree(NonTerminal(111, '_gen5')) + ctx.nonterminal = "_gen5" tree.list = True - if current != None and current.id in nonterminal_follow[110] and current.id not in nonterminal_first[110]: + if current != None and current.id in nonterminal_follow[111] and current.id not in nonterminal_first[111]: return tree if current == None: return tree - if rule == 130: # $_gen33 = :comma $e $_gen33 - ctx.rule = rules[130] + if rule == 15: # $_gen5 = $declaration $_gen6 + ctx.rule = rules[15] tree.astTransform = AstTransformSubstitution(0) - t = expect(ctx, 15) # :comma - tree.add(t) - tree.listSeparator = t - subtree = parse_e(ctx) + subtree = parse_declaration(ctx) tree.add(subtree) - subtree = parse__gen33(ctx) + subtree = parse__gen6(ctx) tree.add(subtree) return tree return tree -def parse_outputs(ctx): +def parse_setter(ctx): current = ctx.tokens.current() - rule = table[55][current.id] if current else -1 - tree = ParseTree(NonTerminal(111, 'outputs')) - ctx.nonterminal = "outputs" + rule = table[56][current.id] if current else -1 + tree = ParseTree(NonTerminal(112, 'setter')) + ctx.nonterminal = "setter" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 46: # $outputs = :output :lbrace $_gen13 :rbrace -> Outputs( attributes=$2 ) - ctx.rule = rules[46] - ast_parameters = OrderedDict([ - ('attributes', 2), - ]) - tree.astTransform = AstTransformNodeCreator('Outputs', ast_parameters) - t = expect(ctx, 46) # :output - tree.add(t) - t = expect(ctx, 14) # :lbrace + if rule == 62: # $setter = :equal $e -> $1 + ctx.rule = rules[62] + tree.astTransform = AstTransformSubstitution(1) + t = expect(ctx, 15) # :equal tree.add(t) - subtree = parse__gen13(ctx) + subtree = parse_e(ctx) tree.add(subtree) - t = expect(ctx, 36) # :rbrace - tree.add(t) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[111] if x >=0], - rules[46] + [terminals[x] for x in nonterminal_first[112] if x >=0], + rules[62] ) -def parse__gen37(ctx): +def parse__gen27(ctx): current = ctx.tokens.current() - rule = table[56][current.id] if current else -1 - tree = ParseTree(NonTerminal(112, '_gen37')) - ctx.nonterminal = "_gen37" + rule = table[57][current.id] if current else -1 + tree = ParseTree(NonTerminal(113, '_gen27')) + ctx.nonterminal = "_gen27" tree.list = True - if current != None and current.id in nonterminal_follow[112] and current.id not in nonterminal_first[112]: + if current != None and current.id in nonterminal_follow[113] and current.id not in nonterminal_first[113]: return tree if current == None: return tree - if rule == 143: # $_gen37 = :comma $map_kv $_gen37 - ctx.rule = rules[143] + if rule == 94: # $_gen27 = $wf_output $_gen28 + ctx.rule = rules[94] tree.astTransform = AstTransformSubstitution(0) - t = expect(ctx, 15) # :comma - tree.add(t) - tree.listSeparator = t - subtree = parse_map_kv(ctx) + subtree = parse_wf_output(ctx) tree.add(subtree) - subtree = parse__gen37(ctx) + subtree = parse__gen28(ctx) tree.add(subtree) return tree return tree -def parse_import(ctx): - current = ctx.tokens.current() - rule = table[57][current.id] if current else -1 - tree = ParseTree(NonTerminal(113, 'import')) - ctx.nonterminal = "import" - tree.list = False - if current == None: - raise ctx.errors.unexpected_eof() - if rule == 13: # $import = :import :string $_gen4 -> Import( uri=$1, namespace=$2 ) - ctx.rule = rules[13] - ast_parameters = OrderedDict([ - ('uri', 1), - ('namespace', 2), - ]) - tree.astTransform = AstTransformNodeCreator('Import', ast_parameters) - t = expect(ctx, 55) # :import - tree.add(t) - t = expect(ctx, 41) # :string - tree.add(t) - subtree = parse__gen4(ctx) - tree.add(subtree) - return tree - raise ctx.errors.unexpected_symbol( - ctx.nonterminal, - ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[113] if x >=0], - rules[13] - ) def parse__gen32(ctx): current = ctx.tokens.current() rule = table[58][current.id] if current else -1 @@ -3095,362 +3027,430 @@ def parse__gen32(ctx): tree.add(subtree) return tree return tree -def parse_command_part(ctx): +def parse_kv(ctx): current = ctx.tokens.current() rule = table[59][current.id] if current else -1 - tree = ParseTree(NonTerminal(115, 'command_part')) - ctx.nonterminal = "command_part" + tree = ParseTree(NonTerminal(115, 'kv')) + ctx.nonterminal = "kv" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 34: # $command_part = :cmd_part - ctx.rule = rules[34] - tree.astTransform = AstTransformSubstitution(0) - t = expect(ctx, 54) # :cmd_part + if rule == 56: # $kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 ) + ctx.rule = rules[56] + ast_parameters = OrderedDict([ + ('key', 0), + ('value', 2), + ]) + tree.astTransform = AstTransformNodeCreator('RuntimeAttribute', ast_parameters) + t = expect(ctx, 47) # :identifier tree.add(t) - return tree - elif rule == 35: # $command_part = $cmd_param - ctx.rule = rules[35] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_cmd_param(ctx) + t = expect(ctx, 31) # :colon + tree.add(t) + subtree = parse_e(ctx) tree.add(subtree) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), [terminals[x] for x in nonterminal_first[115] if x >=0], - rules[35] + rules[56] ) -def parse__gen29(ctx): +def parse_meta(ctx): current = ctx.tokens.current() rule = table[60][current.id] if current else -1 - tree = ParseTree(NonTerminal(116, '_gen29')) - ctx.nonterminal = "_gen29" + tree = ParseTree(NonTerminal(116, 'meta')) + ctx.nonterminal = "meta" tree.list = False - if current != None and current.id in nonterminal_follow[116] and current.id not in nonterminal_first[116]: - return tree if current == None: - return tree - if rule == 99: # $_gen29 = $wf_output_wildcard - ctx.rule = rules[99] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_wf_output_wildcard(ctx) + raise ctx.errors.unexpected_eof() + if rule == 50: # $meta = :meta $map -> Meta( map=$1 ) + ctx.rule = rules[50] + ast_parameters = OrderedDict([ + ('map', 1), + ]) + tree.astTransform = AstTransformNodeCreator('Meta', ast_parameters) + t = expect(ctx, 19) # :meta + tree.add(t) + subtree = parse_map(ctx) tree.add(subtree) return tree - return tree -def parse__gen11(ctx): + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[116] if x >=0], + rules[50] + ) +def parse_command_part(ctx): current = ctx.tokens.current() rule = table[61][current.id] if current else -1 - tree = ParseTree(NonTerminal(117, '_gen11')) - ctx.nonterminal = "_gen11" - tree.list = True - if current != None and current.id in nonterminal_follow[117] and current.id not in nonterminal_first[117]: - return tree + tree = ParseTree(NonTerminal(117, 'command_part')) + ctx.nonterminal = "command_part" + tree.list = False if current == None: + raise ctx.errors.unexpected_eof() + if rule == 34: # $command_part = :cmd_part + ctx.rule = rules[34] + tree.astTransform = AstTransformSubstitution(0) + t = expect(ctx, 24) # :cmd_part + tree.add(t) return tree - if rule == 36: # $_gen11 = $cmd_param_kv $_gen12 - ctx.rule = rules[36] + elif rule == 35: # $command_part = $cmd_param + ctx.rule = rules[35] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_cmd_param_kv(ctx) - tree.add(subtree) - subtree = parse__gen12(ctx) + subtree = parse_cmd_param(ctx) tree.add(subtree) return tree - return tree -def parse__gen30(ctx): + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[117] if x >=0], + rules[35] + ) +def parse__gen14(ctx): current = ctx.tokens.current() rule = table[62][current.id] if current else -1 - tree = ParseTree(NonTerminal(118, '_gen30')) - ctx.nonterminal = "_gen30" + tree = ParseTree(NonTerminal(118, '_gen14')) + ctx.nonterminal = "_gen14" tree.list = True if current != None and current.id in nonterminal_follow[118] and current.id not in nonterminal_first[118]: return tree if current == None: return tree - if rule == 107: # $_gen30 = $type_e $_gen31 - ctx.rule = rules[107] + if rule == 43: # $_gen14 = $output_kv $_gen14 + ctx.rule = rules[43] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_type_e(ctx) + subtree = parse_output_kv(ctx) tree.add(subtree) - subtree = parse__gen31(ctx) + subtree = parse__gen14(ctx) tree.add(subtree) return tree return tree -def parse__gen24(ctx): +def parse_wf_output_wildcard(ctx): current = ctx.tokens.current() rule = table[63][current.id] if current else -1 - tree = ParseTree(NonTerminal(119, '_gen24')) - ctx.nonterminal = "_gen24" - tree.list = True - if current != None and current.id in nonterminal_follow[119] and current.id not in nonterminal_first[119]: - return tree + tree = ParseTree(NonTerminal(119, 'wf_output_wildcard')) + ctx.nonterminal = "wf_output_wildcard" + tree.list = False if current == None: + raise ctx.errors.unexpected_eof() + if rule == 102: # $wf_output_wildcard = :dot :asterisk -> $1 + ctx.rule = rules[102] + tree.astTransform = AstTransformSubstitution(1) + t = expect(ctx, 37) # :dot + tree.add(t) + t = expect(ctx, 29) # :asterisk + tree.add(t) return tree - if rule == 83: # $_gen24 = $call_input $_gen24 - ctx.rule = rules[83] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_call_input(ctx) - tree.add(subtree) - subtree = parse__gen24(ctx) - tree.add(subtree) - return tree - return tree -def parse_command(ctx): + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[119] if x >=0], + rules[102] + ) +def parse_call_body(ctx): current = ctx.tokens.current() rule = table[64][current.id] if current else -1 - tree = ParseTree(NonTerminal(120, 'command')) - ctx.nonterminal = "command" + tree = ParseTree(NonTerminal(120, 'call_body')) + ctx.nonterminal = "call_body" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 33: # $command = :raw_command :raw_cmd_start $_gen9 :raw_cmd_end -> RawCommand( parts=$2 ) - ctx.rule = rules[33] + if rule == 86: # $call_body = :lbrace $_gen5 $_gen23 :rbrace -> CallBody( declarations=$1, io=$2 ) + ctx.rule = rules[86] ast_parameters = OrderedDict([ - ('parts', 2), + ('declarations', 1), + ('io', 2), ]) - tree.astTransform = AstTransformNodeCreator('RawCommand', ast_parameters) - t = expect(ctx, 23) # :raw_command - tree.add(t) - t = expect(ctx, 4) # :raw_cmd_start + tree.astTransform = AstTransformNodeCreator('CallBody', ast_parameters) + t = expect(ctx, 42) # :lbrace tree.add(t) - subtree = parse__gen9(ctx) + subtree = parse__gen5(ctx) + tree.add(subtree) + subtree = parse__gen23(ctx) tree.add(subtree) - t = expect(ctx, 42) # :raw_cmd_end + t = expect(ctx, 33) # :rbrace tree.add(t) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), [terminals[x] for x in nonterminal_first[120] if x >=0], - rules[33] + rules[86] ) -def parse__gen4(ctx): +def parse__gen31(ctx): current = ctx.tokens.current() rule = table[65][current.id] if current else -1 - tree = ParseTree(NonTerminal(121, '_gen4')) - ctx.nonterminal = "_gen4" - tree.list = False + tree = ParseTree(NonTerminal(121, '_gen31')) + ctx.nonterminal = "_gen31" + tree.list = True if current != None and current.id in nonterminal_follow[121] and current.id not in nonterminal_first[121]: return tree if current == None: return tree - if rule == 11: # $_gen4 = $import_namespace - ctx.rule = rules[11] + if rule == 108: # $_gen31 = :comma $type_e $_gen31 + ctx.rule = rules[108] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_import_namespace(ctx) + t = expect(ctx, 43) # :comma + tree.add(t) + tree.listSeparator = t + subtree = parse_type_e(ctx) + tree.add(subtree) + subtree = parse__gen31(ctx) tree.add(subtree) return tree return tree -def parse__gen21(ctx): +def parse_document(ctx): current = ctx.tokens.current() rule = table[66][current.id] if current else -1 - tree = ParseTree(NonTerminal(122, '_gen21')) - ctx.nonterminal = "_gen21" + tree = ParseTree(NonTerminal(122, 'document')) + ctx.nonterminal = "document" tree.list = False if current != None and current.id in nonterminal_follow[122] and current.id not in nonterminal_first[122]: return tree if current == None: return tree - if rule == 77: # $_gen21 = $alias - ctx.rule = rules[77] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_alias(ctx) + if rule == 8: # $document = $_gen0 $_gen2 -> Document( imports=$0, definitions=$1 ) + ctx.rule = rules[8] + ast_parameters = OrderedDict([ + ('imports', 0), + ('definitions', 1), + ]) + tree.astTransform = AstTransformNodeCreator('Document', ast_parameters) + subtree = parse__gen0(ctx) + tree.add(subtree) + subtree = parse__gen2(ctx) tree.add(subtree) return tree return tree -def parse__gen27(ctx): +def parse_sections(ctx): current = ctx.tokens.current() rule = table[67][current.id] if current else -1 - tree = ParseTree(NonTerminal(123, '_gen27')) - ctx.nonterminal = "_gen27" + tree = ParseTree(NonTerminal(123, 'sections')) + ctx.nonterminal = "sections" + tree.list = False + if current == None: + raise ctx.errors.unexpected_eof() + if rule == 24: # $sections = $command + ctx.rule = rules[24] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_command(ctx) + tree.add(subtree) + return tree + elif rule == 25: # $sections = $outputs + ctx.rule = rules[25] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_outputs(ctx) + tree.add(subtree) + return tree + elif rule == 26: # $sections = $runtime + ctx.rule = rules[26] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_runtime(ctx) + tree.add(subtree) + return tree + elif rule == 27: # $sections = $parameter_meta + ctx.rule = rules[27] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_parameter_meta(ctx) + tree.add(subtree) + return tree + elif rule == 28: # $sections = $meta + ctx.rule = rules[28] + tree.astTransform = AstTransformSubstitution(0) + subtree = parse_meta(ctx) + tree.add(subtree) + return tree + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[123] if x >=0], + rules[28] + ) +def parse__gen13(ctx): + current = ctx.tokens.current() + rule = table[68][current.id] if current else -1 + tree = ParseTree(NonTerminal(124, '_gen13')) + ctx.nonterminal = "_gen13" tree.list = True - if current != None and current.id in nonterminal_follow[123] and current.id not in nonterminal_first[123]: + if current != None and current.id in nonterminal_follow[124] and current.id not in nonterminal_first[124]: return tree if current == None: return tree - if rule == 94: # $_gen27 = $wf_output $_gen28 - ctx.rule = rules[94] + if rule == 42: # $_gen13 = $output_kv $_gen14 + ctx.rule = rules[42] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_wf_output(ctx) + subtree = parse_output_kv(ctx) tree.add(subtree) - subtree = parse__gen28(ctx) + subtree = parse__gen14(ctx) tree.add(subtree) return tree return tree -def parse_workflow(ctx): +def parse_call_input(ctx): current = ctx.tokens.current() - rule = table[68][current.id] if current else -1 - tree = ParseTree(NonTerminal(124, 'workflow')) - ctx.nonterminal = "workflow" + rule = table[69][current.id] if current else -1 + tree = ParseTree(NonTerminal(125, 'call_input')) + ctx.nonterminal = "call_input" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 70: # $workflow = :workflow :identifier :lbrace $_gen19 :rbrace -> Workflow( name=$1, body=$3 ) - ctx.rule = rules[70] + if rule == 91: # $call_input = :input :colon $_gen25 -> Inputs( map=$2 ) + ctx.rule = rules[91] ast_parameters = OrderedDict([ - ('name', 1), - ('body', 3), + ('map', 2), ]) - tree.astTransform = AstTransformNodeCreator('Workflow', ast_parameters) - t = expect(ctx, 31) # :workflow - tree.add(t) - t = expect(ctx, 17) # :identifier + tree.astTransform = AstTransformNodeCreator('Inputs', ast_parameters) + t = expect(ctx, 32) # :input tree.add(t) - t = expect(ctx, 14) # :lbrace + t = expect(ctx, 31) # :colon tree.add(t) - subtree = parse__gen19(ctx) + subtree = parse__gen25(ctx) tree.add(subtree) - t = expect(ctx, 36) # :rbrace - tree.add(t) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[124] if x >=0], - rules[70] + [terminals[x] for x in nonterminal_first[125] if x >=0], + rules[91] ) -def parse_call_body(ctx): +def parse_cmd_param(ctx): current = ctx.tokens.current() - rule = table[69][current.id] if current else -1 - tree = ParseTree(NonTerminal(125, 'call_body')) - ctx.nonterminal = "call_body" + rule = table[70][current.id] if current else -1 + tree = ParseTree(NonTerminal(126, 'cmd_param')) + ctx.nonterminal = "cmd_param" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 86: # $call_body = :lbrace $_gen5 $_gen23 :rbrace -> CallBody( declarations=$1, io=$2 ) - ctx.rule = rules[86] + if rule == 40: # $cmd_param = :cmd_param_start $_gen11 $e :cmd_param_end -> CommandParameter( attributes=$1, expr=$2 ) + ctx.rule = rules[40] ast_parameters = OrderedDict([ - ('declarations', 1), - ('io', 2), + ('attributes', 1), + ('expr', 2), ]) - tree.astTransform = AstTransformNodeCreator('CallBody', ast_parameters) - t = expect(ctx, 14) # :lbrace + tree.astTransform = AstTransformNodeCreator('CommandParameter', ast_parameters) + t = expect(ctx, 35) # :cmd_param_start tree.add(t) - subtree = parse__gen5(ctx) + subtree = parse__gen11(ctx) tree.add(subtree) - subtree = parse__gen23(ctx) + subtree = parse_e(ctx) tree.add(subtree) - t = expect(ctx, 36) # :rbrace + t = expect(ctx, 6) # :cmd_param_end tree.add(t) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[125] if x >=0], - rules[86] + [terminals[x] for x in nonterminal_first[126] if x >=0], + rules[40] ) -def parse__gen25(ctx): +def parse_cmd_param_kv(ctx): current = ctx.tokens.current() - rule = table[70][current.id] if current else -1 - tree = ParseTree(NonTerminal(126, '_gen25')) - ctx.nonterminal = "_gen25" + rule = table[71][current.id] if current else -1 + tree = ParseTree(NonTerminal(127, 'cmd_param_kv')) + ctx.nonterminal = "cmd_param_kv" + tree.list = False + if current == None: + raise ctx.errors.unexpected_eof() + if rule == 41: # $cmd_param_kv = :cmd_attr_hint :identifier :equal $e -> CommandParameterAttr( key=$1, value=$3 ) + ctx.rule = rules[41] + ast_parameters = OrderedDict([ + ('key', 1), + ('value', 3), + ]) + tree.astTransform = AstTransformNodeCreator('CommandParameterAttr', ast_parameters) + t = expect(ctx, 2) # :cmd_attr_hint + tree.add(t) + t = expect(ctx, 47) # :identifier + tree.add(t) + t = expect(ctx, 15) # :equal + tree.add(t) + subtree = parse_e(ctx) + tree.add(subtree) + return tree + raise ctx.errors.unexpected_symbol( + ctx.nonterminal, + ctx.tokens.current(), + [terminals[x] for x in nonterminal_first[127] if x >=0], + rules[41] + ) +def parse__gen0(ctx): + current = ctx.tokens.current() + rule = table[72][current.id] if current else -1 + tree = ParseTree(NonTerminal(128, '_gen0')) + ctx.nonterminal = "_gen0" tree.list = True - if current != None and current.id in nonterminal_follow[126] and current.id not in nonterminal_first[126]: + if current != None and current.id in nonterminal_follow[128] and current.id not in nonterminal_first[128]: return tree if current == None: return tree - if rule == 87: # $_gen25 = $mapping $_gen26 - ctx.rule = rules[87] + if rule == 0: # $_gen0 = $import $_gen1 + ctx.rule = rules[0] tree.astTransform = AstTransformSubstitution(0) - subtree = parse_mapping(ctx) + subtree = parse_import(ctx) tree.add(subtree) - subtree = parse__gen26(ctx) + subtree = parse__gen1(ctx) tree.add(subtree) return tree return tree -def parse_wf_output(ctx): +def parse_call(ctx): current = ctx.tokens.current() - rule = table[71][current.id] if current else -1 - tree = ParseTree(NonTerminal(127, 'wf_output')) - ctx.nonterminal = "wf_output" + rule = table[73][current.id] if current else -1 + tree = ParseTree(NonTerminal(129, 'call')) + ctx.nonterminal = "call" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 101: # $wf_output = :fqn $_gen29 -> WorkflowOutput( fqn=$0, wildcard=$1 ) - ctx.rule = rules[101] + if rule == 81: # $call = :call :fqn $_gen21 $_gen22 -> Call( task=$1, alias=$2, body=$3 ) + ctx.rule = rules[81] ast_parameters = OrderedDict([ - ('fqn', 0), - ('wildcard', 1), + ('task', 1), + ('alias', 2), + ('body', 3), ]) - tree.astTransform = AstTransformNodeCreator('WorkflowOutput', ast_parameters) - t = expect(ctx, 27) # :fqn + tree.astTransform = AstTransformNodeCreator('Call', ast_parameters) + t = expect(ctx, 18) # :call tree.add(t) - subtree = parse__gen29(ctx) + t = expect(ctx, 44) # :fqn + tree.add(t) + subtree = parse__gen21(ctx) + tree.add(subtree) + subtree = parse__gen22(ctx) tree.add(subtree) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[127] if x >=0], - rules[101] + [terminals[x] for x in nonterminal_first[129] if x >=0], + rules[81] ) -def parse_output_kv(ctx): +def parse_command(ctx): current = ctx.tokens.current() - rule = table[72][current.id] if current else -1 - tree = ParseTree(NonTerminal(128, 'output_kv')) - ctx.nonterminal = "output_kv" + rule = table[74][current.id] if current else -1 + tree = ParseTree(NonTerminal(130, 'command')) + ctx.nonterminal = "command" tree.list = False if current == None: raise ctx.errors.unexpected_eof() - if rule == 47: # $output_kv = $type_e :identifier :equal $e -> Output( type=$0, var=$1, expression=$3 ) - ctx.rule = rules[47] + if rule == 33: # $command = :raw_command :raw_cmd_start $_gen9 :raw_cmd_end -> RawCommand( parts=$2 ) + ctx.rule = rules[33] ast_parameters = OrderedDict([ - ('type', 0), - ('var', 1), - ('expression', 3), + ('parts', 2), ]) - tree.astTransform = AstTransformNodeCreator('Output', ast_parameters) - subtree = parse_type_e(ctx) - tree.add(subtree) - t = expect(ctx, 17) # :identifier + tree.astTransform = AstTransformNodeCreator('RawCommand', ast_parameters) + t = expect(ctx, 5) # :raw_command tree.add(t) - t = expect(ctx, 53) # :equal + t = expect(ctx, 3) # :raw_cmd_start tree.add(t) - subtree = parse_e(ctx) + subtree = parse__gen9(ctx) tree.add(subtree) + t = expect(ctx, 28) # :raw_cmd_end + tree.add(t) return tree raise ctx.errors.unexpected_symbol( ctx.nonterminal, ctx.tokens.current(), - [terminals[x] for x in nonterminal_first[128] if x >=0], - rules[47] + [terminals[x] for x in nonterminal_first[130] if x >=0], + rules[33] ) -def parse__gen13(ctx): - current = ctx.tokens.current() - rule = table[73][current.id] if current else -1 - tree = ParseTree(NonTerminal(129, '_gen13')) - ctx.nonterminal = "_gen13" - tree.list = True - if current != None and current.id in nonterminal_follow[129] and current.id not in nonterminal_first[129]: - return tree - if current == None: - return tree - if rule == 42: # $_gen13 = $output_kv $_gen14 - ctx.rule = rules[42] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_output_kv(ctx) - tree.add(subtree) - subtree = parse__gen14(ctx) - tree.add(subtree) - return tree - return tree -def parse__gen18(ctx): - current = ctx.tokens.current() - rule = table[74][current.id] if current else -1 - tree = ParseTree(NonTerminal(130, '_gen18')) - ctx.nonterminal = "_gen18" - tree.list = False - if current != None and current.id in nonterminal_follow[130] and current.id not in nonterminal_first[130]: - return tree - if current == None: - return tree - if rule == 59: # $_gen18 = $setter - ctx.rule = rules[59] - tree.astTransform = AstTransformSubstitution(0) - subtree = parse_setter(ctx) - tree.add(subtree) - return tree - return tree # Lexer Code # # START USER CODE def init(): @@ -3486,10 +3486,10 @@ def output(ctx, terminal, source_string, line, col): def unescape(ctx, terminal, source_string, line, col): for regex, c in ctx.user_context['replacements'].items(): source_string = regex.sub(chr(c), source_string) - source_string = source_string.replace("\u005C\u005C", "\u005C") + source_string = source_string.replace("\\\\", "\\") for regex, base in ctx.user_context['escapes'].items(): for escape_sequence, number in regex.findall(source_string): - source_string = source_string.replace(escape_sequence, chr(int(number, base))) + source_string = source_string.replace(escape_sequence, unichr(int(number, base))) default_action(ctx, terminal, source_string[1:-1], line, col) # END USER CODE def emit(ctx, terminal, source_string, line, col):