# Is λ allowed in Deterministic CFG?

I have a non-deterministic CFG that says

S-> aS | aB | bB | λ;
B-> bB | λ

And I'm asked to create a deterministic CFG from that. I understand why the given CFG is non-deterministic because it contains

S-> aS | aB | [...]

But I think what I'm confused is why in my book does it say that A->λ productions are not allowed? I can't think of any other way to keep the solution a deterministic CFG if λ is not allowed.

[EDIT] The book defines deterministic CFG

"To recognize the full set of context-free languages, we require a non-deterministic stack automaton. We saw that any NFA could be replaced by an equivalent DFA but we cannot do this in the case of non-deterministic stack automaton. It is our good fortune that practical programming languages can be adequately described by deterministic CFG"

"We said that in Type 1 grammars, the nonterminal on the left-hand side could be replaced by ε. Since these restrictions are cumulative as we go from one level of the hierarchy to the next, this implies that Type 2 grammars may not have productions of the form A-> ε. In fact, we will see many CFGs have such productions, we must allow such productions as exceptions to the Type-1 restriction." - Introduction to Compiler Construction by Thomas W. Parsons

• I don’t see a definition here. Given the definition, you should have no problem answering the question on your own. Conversely, without the definition we can’t help you, since deterministic CFG is not a completely standard concept. Mar 7, 2019 at 6:56

• The definition of a deterministic context-free language is standard: $$L$$ is a deterministic context-free language if it is accepted by any deterministic pushdown automaton.
• The definition of a deterministic context-free grammar is not completely standard. If I remember correctly, I think it can be defined in a few slightly different ways. The one thing everyone agrees on is that, no matter what definition of deterministic CFGs you pick, the languages that can be accepted by such grammars should be exactly the deterministic context-free languages. But there are a few different ways to place restrictions on a CFG, while achieving this property. In particular, you can define deterministic CFGs in a way that allows it to include $$A \to \lambda$$ rule. Perhaps there is another definition that doesn't allow such rules, and perhaps your textbook has that definition in mind. Since your book doesn't state a precise definition, one can only guess. Perhaps the author decided that the exact specifics aren't too important, for the book's purposes.