Click here to Skip to main content
15,900,108 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: I'm stumped and in the worst way. Pin
lopatir20-Feb-20 5:39
lopatir20-Feb-20 5:39 
GeneralRe: I'm stumped and in the worst way. Pin
Gerry Schmitz20-Feb-20 6:17
mveGerry Schmitz20-Feb-20 6:17 
GeneralRe: I'm stumped and in the worst way. Pin
honey the codewitch20-Feb-20 6:30
mvahoney the codewitch20-Feb-20 6:30 
GeneralRe: I'm stumped and in the worst way. Pin
David O'Neil20-Feb-20 6:52
professionalDavid O'Neil20-Feb-20 6:52 
GeneralRe: I'm stumped and in the worst way. Pin
honey the codewitch20-Feb-20 7:04
mvahoney the codewitch20-Feb-20 7:04 
GeneralRe: I'm stumped and in the worst way. Pin
David O'Neil20-Feb-20 7:22
professionalDavid O'Neil20-Feb-20 7:22 
GeneralRe: I'm stumped and in the worst way. Pin
honey the codewitch20-Feb-20 7:51
mvahoney the codewitch20-Feb-20 7:51 
GeneralRe: I'm stumped and in the worst way. Pin
David O'Neil20-Feb-20 8:17
professionalDavid O'Neil20-Feb-20 8:17 
honey the codewitch wrote:
shift while
shift (
shift true
shift )
reduce WhileStart
reduce Statement

Isn't that top-down?

My understanding was that bottom-up was like:

parse the ')' to a rparen and build a 'rparen' leaf
parse the 'true' and place it in the tree
parse the '(' to a lparen and insert it
... 'while' ...
reduce WhileStart
reduce Statement

So my approach would be to start with a blank statement at the beginning
add the rparen to it, so the tree is: Statement -> RParen
add the 'true' to it, so the tree is now: Statement -> True -> RParen
add the lparen to it, so: Statement -> LParen -> True -> RParen
the LParen can trigger a reduction at this step if you want
add the 'while': Statement -> While -> LParen -> True -> RParen
and reduce everything there if you want.

It would be a pretty straight tree in this case, but so be it. Maybe my understanding about top-down and bottom-up is incorrect.

GeneralRe: I'm stumped and in the worst way. Pin
honey the codewitch20-Feb-20 8:28
mvahoney the codewitch20-Feb-20 8:28 
GeneralRe: I'm stumped and in the worst way. Pin
RugbyLeague20-Feb-20 22:32
RugbyLeague20-Feb-20 22:32 
GeneralRe: I'm stumped and in the worst way. Pin
honey the codewitch20-Feb-20 22:49
mvahoney the codewitch20-Feb-20 22:49 
GeneralCCC - 2020-02-20 Pin
musefan19-Feb-20 22:01
musefan19-Feb-20 22:01 
GeneralRe: CCC - 2020-02-20 Pin
OriginalGriff19-Feb-20 22:06
mveOriginalGriff19-Feb-20 22:06 
GeneralRe: CCC - 2020-02-20 Pin
musefan19-Feb-20 22:14
musefan19-Feb-20 22:14 
GeneralRe: CCC - 2020-02-20 Pin
Richard MacCutchan19-Feb-20 22:16
mveRichard MacCutchan19-Feb-20 22:16 
GeneralRe: CCC - 2020-02-20 Pin
OriginalGriff19-Feb-20 22:29
mveOriginalGriff19-Feb-20 22:29 
GeneralRe: CCC - 2020-02-20 Pin
super20-Feb-20 0:09
professionalsuper20-Feb-20 0:09 
GeneralRe: CCC - 2020-02-20 Pin
Richard Deeming20-Feb-20 0:30
mveRichard Deeming20-Feb-20 0:30 
GeneralRe: CCC - 2020-02-20 Pin
OriginalGriff20-Feb-20 0:33
mveOriginalGriff20-Feb-20 0:33 
GeneralRe: CCC - 2020-02-20 - WINNER! Pin
musefan20-Feb-20 0:46
musefan20-Feb-20 0:46 
GeneralLarry Tesler: he has been CTRL_Xed. Pin
OriginalGriff19-Feb-20 20:20
mveOriginalGriff19-Feb-20 20:20 
GeneralRe: Larry Tesler: he has been CTRL_Xed. Pin
Amarnath S19-Feb-20 20:23
professionalAmarnath S19-Feb-20 20:23 
GeneralRe: Larry Tesler: he has been CTRL_Xed. Pin
Johnny J.19-Feb-20 22:12
professionalJohnny J.19-Feb-20 22:12 
GeneralRe: Larry Tesler: he has been CTRL_Xed. Pin
Mark_Wallace19-Feb-20 23:43
Mark_Wallace19-Feb-20 23:43 
GeneralRe: Larry Tesler: he has been CTRL_Xed. Pin
Kent Sharkey20-Feb-20 10:58
staffKent Sharkey20-Feb-20 10:58 

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.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   482 votes