Click here to Skip to main content
15,892,965 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: Sound of the Week Pin
peterkmx13-Nov-21 4:32
professionalpeterkmx13-Nov-21 4:32 
GeneralRe: Sound of the Week Pin
Sander Rossel16-Nov-21 7:32
professionalSander Rossel16-Nov-21 7:32 
GeneralCCC 12-11-2021 Pin
pkfox11-Nov-21 21:30
professionalpkfox11-Nov-21 21:30 
GeneralRe: CCC 12-11-2021 Pin
OriginalGriff11-Nov-21 21:51
mveOriginalGriff11-Nov-21 21:51 
GeneralRe: CCC 12-11-2021 Pin
pkfox11-Nov-21 21:55
professionalpkfox11-Nov-21 21:55 
GeneralRe: CCC 12-11-2021 Pin
OriginalGriff11-Nov-21 23:14
mveOriginalGriff11-Nov-21 23:14 
GeneralRe: CCC 12-11-2021 - Winner Pin
pkfox11-Nov-21 23:25
professionalpkfox11-Nov-21 23:25 
RantBottom Up Parsing is Frustrating Pin
honey the codewitch11-Nov-21 18:40
mvahoney the codewitch11-Nov-21 18:40 
The way it works is it takes a series of tokens/lexemes from an input stream and uses pattern matching to discern whether they match various rules like:
Foobar -> "foo" "bar"

Such that when it sees "foo" followed by "bar" in the input stream it knows the result is a Foobar

The upside of this is it's got a whole lot more recognizing power than starting from the point of Foobar and then checking the input stream for "foo" followed by "bar" (basically the reverse of the aforementioned process)

The downside is it means the tree is built from leaves to the root, meaning bottom up, meaning your recursive tree building is effectively "inside out", building the children first.

That's not normally a problem but it has some important ramifications, like if there's an error token in the tree it can't readily resolve the rest of the tree once encountered.

The other issue is it's more confusing from the standpoint of the end user of the parser. Sure once it's in the tree, it's all the same, but if you're using a pull parser rather than loading everything into an in memory tree, the pull parser for a bottom up parser is just weird to use.

And then the primary issue I have with them is that the algorithms to construct the parse tables are incomprehensible. I've written them before and I still hesitate to say I understand them. I have code that does it that I won't touch because of it. It's not the fault of the code - it's the algorithm that's ugly. The math is atrocious - it feels as though designed while drunk except that it's so bloody clever - too clever to understand by mere mortals. Sigh | :sigh:

I don't like it. Unfortunately it's a very practical way to parse, so it can't really be overlooked.
Real programmers use butterflies

GeneralRe: Bottom Up Parsing is Frustrating Pin
Greg Utas12-Nov-21 2:54
professionalGreg Utas12-Nov-21 2:54 
GeneralRe: Bottom Up Parsing is Frustrating Pin
honey the codewitch12-Nov-21 3:58
mvahoney the codewitch12-Nov-21 3:58 
GeneralRe: Bottom Up Parsing is Frustrating Pin
Greg Utas12-Nov-21 4:16
professionalGreg Utas12-Nov-21 4:16 
GeneralRe: Bottom Up Parsing is Frustrating Pin
honey the codewitch12-Nov-21 4:34
mvahoney the codewitch12-Nov-21 4:34 
GeneralHigh Cinema Pin
David O'Neil11-Nov-21 17:50
professionalDavid O'Neil11-Nov-21 17:50 
GeneralRe: High Cinema Pin
yacCarsten11-Nov-21 20:41
yacCarsten11-Nov-21 20:41 
GeneralRe: High Cinema Pin
Jon McKee11-Nov-21 21:08
professionalJon McKee11-Nov-21 21:08 
GeneralRe: High Cinema Pin
Nelek11-Nov-21 22:00
protectorNelek11-Nov-21 22:00 
GeneralHuh. Pin
Brisingr Aerowing11-Nov-21 14:20
professionalBrisingr Aerowing11-Nov-21 14:20 
GeneralRe: Huh. Pin
Richard MacCutchan11-Nov-21 21:08
mveRichard MacCutchan11-Nov-21 21:08 
GeneralRe: Huh. Pin
Sander Rossel11-Nov-21 22:53
professionalSander Rossel11-Nov-21 22:53 
JokeOh Deer.. PinPopular
Mike Hankey11-Nov-21 12:50
mveMike Hankey11-Nov-21 12:50 
GeneralRe: Oh Deer.. Pin
Greg Utas11-Nov-21 13:43
professionalGreg Utas11-Nov-21 13:43 
GeneralRe: Oh Deer.. Pin
Rajeev Jayaram11-Nov-21 20:46
Rajeev Jayaram11-Nov-21 20:46 
GeneralRe: Oh Deer.. Pin
Fueled By Decaff11-Nov-21 23:08
Fueled By Decaff11-Nov-21 23:08 
GeneralRe: Oh Deer.. Pin
den2k8811-Nov-21 23:29
professionalden2k8811-Nov-21 23:29 
GeneralRe: Oh Deer.. Pin
Slow Eddie12-Nov-21 1:40
professionalSlow Eddie12-Nov-21 1:40 

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.