Click here to Skip to main content
15,915,319 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: 28th Wedding Anniversary Today Pin
RickZeeland16-Aug-19 22:03
mveRickZeeland16-Aug-19 22:03 
GeneralRe: 28th Wedding Anniversary Today Pin
Mike Hankey17-Aug-19 0:08
mveMike Hankey17-Aug-19 0:08 
GeneralRe: 28th Wedding Anniversary Today Pin
Michael Martin17-Aug-19 1:37
professionalMichael Martin17-Aug-19 1:37 
GeneralRe: 28th Wedding Anniversary Today Pin
RickZeeland17-Aug-19 2:25
mveRickZeeland17-Aug-19 2:25 
GeneralRe: 28th Wedding Anniversary Today Pin
DRHuff17-Aug-19 4:32
DRHuff17-Aug-19 4:32 
GeneralRe: 28th Wedding Anniversary Today Pin
PIEBALDconsult17-Aug-19 8:36
mvePIEBALDconsult17-Aug-19 8:36 
GeneralRe: 28th Wedding Anniversary Today Pin
Bassam Abdul-Baki19-Aug-19 5:11
professionalBassam Abdul-Baki19-Aug-19 5:11 
Generalso i just noticed this weird thing - a tale of two algorithms Pin
honey the codewitch16-Aug-19 21:24
mvahoney the codewitch16-Aug-19 21:24 
So, we have two different styles of parsing algorithm for the purposes of this post.

LL(1): Parses from the root of the tree down to the leaves. The grammar directs the parse. The input is validated against the grammar. One token of lookahead

LALR(1): Parses from the leaves of the tree, up to the root, "reducing" as it goes. The input directs the parse. The grammar is validated against the input. One token of lookahead.

Obviously they work in radically different ways despite doing basically the same high level thing (parsing input)

Both of them take the same input - a Context Free Grammar, which is simple a collection of rules of the form:
A -> B C
B -> b
C -> c
C ->


What they do isn't important here, but both algorithms take this stuff as input.

And it occurred to me that both algorithms produce a triple nested array of ints (int[][][]) as output. This is the parse table representing the grammar.

That's a hell of a coincidence. The common inputs I understand, but the triple nested array of ints is just funny considering how different what they represent is.

The parse tables look nothing alike. The columns are different and the rows are different. LALR(1) is actually two tables merged into one - usually called the ACTION and GOTO tables. But it's like an outer join of two tables on a DB the way it's represented

In LL(1) the columns are terminal symbols and the rows are non-terminal symbols. each cell is a rule.
In LALR(1) the rows are STATE indexes, the columns are both nonterminal and terminal symbols, and each cell varies depending on what is happening. For terminals it will be a state ID to jump to, for non-terminals it will be a rule id, and usually the bits of the rule itself follow.

It's bizarre.

3 nested arrays either way.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

GeneralRe: so i just noticed this weird thing - a tale of two algorithms Pin
BillWoodruff17-Aug-19 4:00
professionalBillWoodruff17-Aug-19 4:00 
Questionany windows 10 experts out there? (found it never mind) Pin
honey the codewitch16-Aug-19 19:27
mvahoney the codewitch16-Aug-19 19:27 
AnswerRe: any windows 10 experts out there? (found it never mind) Pin
OriginalGriff16-Aug-19 19:40
mveOriginalGriff16-Aug-19 19:40 
GeneralRe: any windows 10 experts out there? (found it never mind) Pin
honey the codewitch16-Aug-19 19:42
mvahoney the codewitch16-Aug-19 19:42 
GeneralRe: any windows 10 experts out there? (found it never mind) Pin
BillWoodruff17-Aug-19 4:04
professionalBillWoodruff17-Aug-19 4:04 
GeneralMicrosoft .NET Rant - Regular Expressions Pin
honey the codewitch16-Aug-19 11:38
mvahoney the codewitch16-Aug-19 11:38 
GeneralRe: Microsoft .NET Rant - Regular Expressions Pin
PIEBALDconsult16-Aug-19 11:48
mvePIEBALDconsult16-Aug-19 11:48 
GeneralRe: Microsoft .NET Rant - Regular Expressions Pin
TheGreatAndPowerfulOz16-Aug-19 12:01
TheGreatAndPowerfulOz16-Aug-19 12:01 
GeneralRe: Microsoft .NET Rant - Regular Expressions Pin
honey the codewitch16-Aug-19 21:03
mvahoney the codewitch16-Aug-19 21:03 
GeneralRe: Microsoft .NET Rant - Regular Expressions Pin
honey the codewitch16-Aug-19 21:01
mvahoney the codewitch16-Aug-19 21:01 
RantRe: Microsoft .NET Rant - Regular Expressions Pin
lopatir16-Aug-19 21:43
lopatir16-Aug-19 21:43 
GeneralRe: Microsoft .NET Rant - Regular Expressions Pin
honey the codewitch16-Aug-19 21:44
mvahoney the codewitch16-Aug-19 21:44 
GeneralSometimes the universe wants us to sleep in Pin
PIEBALDconsult16-Aug-19 9:23
mvePIEBALDconsult16-Aug-19 9:23 
GeneralRe: Sometimes the universe wants us to sleep in Pin
Ron Anders16-Aug-19 9:52
Ron Anders16-Aug-19 9:52 
GeneralRe: Sometimes the universe wants us to sleep in Pin
Rage16-Aug-19 10:15
professionalRage16-Aug-19 10:15 
GeneralRe: Sometimes the universe wants us to sleep in Pin
littleGreenDude16-Aug-19 10:25
littleGreenDude16-Aug-19 10:25 
GeneralRe: Sometimes the universe wants us to sleep in Pin
Rage16-Aug-19 10:35
professionalRage16-Aug-19 10:35 

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.