1
$\begingroup$

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?

asked Dec 30, 2024 at 9:18
$\endgroup$
4
  • $\begingroup$ Not backed by any real reference, but "atom unit" may be descriptive enough. $\endgroup$ Commented Dec 30, 2024 at 11:48
  • $\begingroup$ Or "the atom production rule", or just the "atom rule". $\endgroup$ Commented 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$ Commented Dec 30, 2024 at 12:34
  • $\begingroup$ @jonathanjo Degeneracy sounds most descriptive. $\endgroup$ Commented Dec 30, 2024 at 12:59

1 Answer 1

1
$\begingroup$

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.

answered Aug 29 at 12:30
$\endgroup$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.