Click here to Skip to main content
15,891,529 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Eureka! I was stewing on a rant I made here and it clicked! Pin
honey the codewitch12-Nov-21 11:11
mvahoney the codewitch12-Nov-21 11:11 
GeneralRe: Eureka! I was stewing on a rant I made here and it clicked! Pin
Jon McKee12-Nov-21 11:34
professionalJon McKee12-Nov-21 11:34 
GeneralRe: Eureka! I was stewing on a rant I made here and it clicked! Pin
honey the codewitch12-Nov-21 11:40
mvahoney the codewitch12-Nov-21 11:40 
GeneralRe: Eureka! I was stewing on a rant I made here and it clicked! Pin
honey the codewitch12-Nov-21 11:49
mvahoney the codewitch12-Nov-21 11:49 
GeneralRe: Eureka! I was stewing on a rant I made here and it clicked! Pin
Jon McKee12-Nov-21 16:14
professionalJon McKee12-Nov-21 16:14 
GeneralRe: Eureka! I was stewing on a rant I made here and it clicked! Pin
honey the codewitch12-Nov-21 17:11
mvahoney the codewitch12-Nov-21 17:11 
GeneralRe: Eureka! I was stewing on a rant I made here and it clicked! Pin
BernardIE531712-Nov-21 13:23
BernardIE531712-Nov-21 13:23 
GeneralRe: Eureka! I was stewing on a rant I made here and it clicked! Pin
honey the codewitch12-Nov-21 13:50
mvahoney the codewitch12-Nov-21 13:50 
The Dragon Book has a way of making simple things complicated.

Basically, bottom up parsers work by deducing the next rule they need to match from the series of input tokens and previously matched rules they have on the stack.

Top down parsers work by deducing the next rule based on a decision table they run, and it expects the input tokens to match that table

The bottom line is that bottom up parsers primarily use the input tokens to drive their decision making process, using the grammar as a guide. Top down parser primarily use the the grammar to drive their decision making, using the input tokens as a guide.

The other difference is in the way they construct the tree as a result of this.

Bottom up parsers start at the leaves of the tree - the terminal tokens, and compile those into the next level rules, which it then compiles into the next level of rules (containing the rules it matched on the previous level before) and so on until it reaches the root of the tree. You will not get the root of the tree until *after* the entire document is parsed.

Top down parsers start at the root of the tree - the start non terminal in the grammar, and work their way toward the leaves - the terminals. They can yield the first node in the tree as soon as they start parsing - technically even before reading any input.

I find top down parsers to be superior to use, but bottom up parsers are more powerful generally speaking. LL(k) is as powerful as one needs it to be though, so if I can crack that, I can pretty much ignore bottom up parsing moving forward.
Real programmers use butterflies

GeneralWhat is Azure? Pin
Kevin Marois12-Nov-21 5:34
professionalKevin Marois12-Nov-21 5:34 
GeneralRe: What is Azure? PinPopular
Richard Deeming12-Nov-21 5:52
mveRichard Deeming12-Nov-21 5:52 
GeneralRe: What is Azure? Pin
Kevin Marois12-Nov-21 6:10
professionalKevin Marois12-Nov-21 6:10 
GeneralRe: What is Azure? Pin
Richard Deeming12-Nov-21 6:23
mveRichard Deeming12-Nov-21 6:23 
GeneralRe: What is Azure? Pin
Kevin Marois12-Nov-21 6:46
professionalKevin Marois12-Nov-21 6:46 
GeneralRe: What is Azure? Pin
Gary R. Wheeler13-Nov-21 5:53
Gary R. Wheeler13-Nov-21 5:53 
GeneralRe: What is Azure? Pin
dandy7212-Nov-21 8:30
dandy7212-Nov-21 8:30 
GeneralRe: What is Azure? Pin
OriginalGriff12-Nov-21 6:01
mveOriginalGriff12-Nov-21 6:01 
GeneralRe: What is Azure? Pin
Richard MacCutchan12-Nov-21 6:09
mveRichard MacCutchan12-Nov-21 6:09 
GeneralRe: What is Azure? Pin
RickZeeland12-Nov-21 6:17
mveRickZeeland12-Nov-21 6:17 
GeneralRe: What is Azure? Pin
k505412-Nov-21 6:37
mvek505412-Nov-21 6:37 
GeneralRe: What is Azure? PinPopular
kmoorevs12-Nov-21 6:34
kmoorevs12-Nov-21 6:34 
GeneralRe: What is Azure? Pin
Kevin Marois12-Nov-21 6:53
professionalKevin Marois12-Nov-21 6:53 
GeneralRe: What is Azure? Pin
Member 1532961312-Nov-21 7:10
Member 1532961312-Nov-21 7:10 
GeneralRe: What is Azure? Pin
Kevin Marois12-Nov-21 7:15
professionalKevin Marois12-Nov-21 7:15 
GeneralRe: What is Azure? Pin
kmoorevs12-Nov-21 8:10
kmoorevs12-Nov-21 8:10 
GeneralRe: What is Azure? Pin
Kevin Marois12-Nov-21 8:22
professionalKevin Marois12-Nov-21 8:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.