Suppose I'm writing a grammar rule for arithmetics, and for additions, I got this:
Additive-Expression
: Multiplicative-Expression
| Additive-Expression ("+"|"-") Multiplicative-Expression
;
The multiplicative rule is involved to establish the precedence of operators. Q: What's the name of the rule to the right of the colon ":"? Fall-back? Pass-thru? What are the references I can learn more?
-
$\begingroup$ Not backed by any real reference, but "atom unit" may be descriptive enough. $\endgroup$DannyNiu– DannyNiu2024年12月30日 11:48:28 +00:00Commented Dec 30, 2024 at 11:48
-
$\begingroup$ Or "the atom production rule", or just the "atom rule". $\endgroup$DannyNiu– DannyNiu2024年12月30日 11:56:10 +00:00Commented Dec 30, 2024 at 11:56
-
1$\begingroup$ I'd have called it the "base" or "limiting" rule/case (like any recursive definition) or the "degenerate rule/case" as there's no addition going on, after the mathematical use eg "degenerate triangle" en.wikipedia.org/wiki/Degeneracy_(mathematics) $\endgroup$jonathanjo– jonathanjo2024年12月30日 12:34:08 +00:00Commented Dec 30, 2024 at 12:34
-
$\begingroup$ @jonathanjo Degeneracy sounds most descriptive. $\endgroup$DannyNiu– DannyNiu2024年12月30日 12:59:38 +00:00Commented Dec 30, 2024 at 12:59
1 Answer 1
In the Dragon Book, it is called a "unit production" or "marker".
The first term underlines the size of the right-hand side, while the second one refers to the employment of the production to trigger arbitrary code before another more important reduction occurs.
Explore related questions
See similar questions with these tags.