Remove TABLE_R0 - it hasn't been used in a while

This commit is contained in:
rocky
2022-02-27 10:18:57 -05:00
parent f2a70a2758
commit ce5207333f
2 changed files with 16 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2017-2021 by Rocky Bernstein
# Copyright (c) 2017-2022 by Rocky Bernstein
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -169,11 +169,14 @@ TABLE_R = {
"DELETE_ATTR": ("%|del %c.%[-1]{pattr}\n", 0),
}
TABLE_R0 = {
# "BUILD_LIST": ( "[%C]", (0,-1,", ") ),
# "BUILD_TUPLE": ( "(%C)", (0,-1,", ") ),
# "CALL_FUNCTION": ( "%c(%P)", 0, (1,-1,", ") ),
}
# I'll leave this in for historical interest.
# TABLE_R0 it was like TABLE_R but the key was the *child* of the last child,
# or a grandchild of the node that this is considered.
# TABLE_R0 = {
# "BUILD_LIST": ( "[%C]", (0,-1,", ") ),
# "BUILD_TUPLE": ( "(%C)", (0,-1,", ") ),
# "CALL_FUNCTION": ( "%c(%P)", 0, (1,-1,", ") ),
# }
TABLE_DIRECT = {
"BINARY_ADD": ("+",),
@@ -425,7 +428,6 @@ TABLE_DIRECT = {
MAP_DIRECT = (TABLE_DIRECT,)
MAP_R0 = (TABLE_R0, -1, 0)
MAP_R = (TABLE_R, -1)
MAP = {
@@ -433,7 +435,6 @@ MAP = {
"call": MAP_R,
"delete": MAP_R,
"store": MAP_R,
"exprlist": MAP_R0,
}
ASSIGN_TUPLE_PARAM = lambda param_name: SyntaxTree(

View File

@@ -43,7 +43,7 @@ Python.
# describe rules and not have to create methods at all.
#
# So another other way to specify a semantic rule for a nonterminal is via
# one of the tables MAP_R0, MAP_R, or MAP_DIRECT where the key is the
# either tables MAP_R, or MAP_DIRECT where the key is the
# nonterminal name.
#
# These dictionaries use a printf-like syntax to direct substitution
@@ -63,15 +63,14 @@ Python.
# parse tree for N.
#
#
# N&K N N
# / | ... \ / | ... \ / | ... \
# O O O O O K O O O
# |
# K
# TABLE_DIRECT TABLE_R TABLE_R0
# N&K N
# / | ... \ / | ... \
# O O O O O K
#
#
# TABLE_DIRECT TABLE_R
#
# The default table is TABLE_DIRECT mapping By far, most rules used work this way.
# TABLE_R0 is rarely used.
#
# The key K is then extracted from the subtree and used to find one
# of the tables, T listed above. The result after applying T[K] is