Click here to Skip to main content
15,893,337 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.

 
GeneralRIP: Graeme Edge, 'The Moody Blues' :( Pin
0x01AA12-Nov-21 7:01
mve0x01AA12-Nov-21 7:01 
GeneralRe: RIP: Graeme Edge, 'The Moody Blues' :( Pin
OriginalGriff12-Nov-21 6:40
mveOriginalGriff12-Nov-21 6:40 
GeneralRe: RIP: Graeme Edge, 'The Moody Blues' :( Pin
Mike Hankey12-Nov-21 6:43
mveMike Hankey12-Nov-21 6:43 
GeneralRe: RIP: Graeme Edge, 'The Moody Blues' :( Pin
Mike Hankey12-Nov-21 6:42
mveMike Hankey12-Nov-21 6:42 
GeneralRe: RIP: Graeme Edge, 'The Moody Blues' :( Pin
Slow Eddie13-Nov-21 2:39
professionalSlow Eddie13-Nov-21 2:39 
PraiseEureka! I was stewing on a rant I made here and it clicked! Pin
honey the codewitch12-Nov-21 5:47
mvahoney the codewitch12-Nov-21 5:47 
GeneralRe: Eureka! I was stewing on a rant I made here and it clicked! Pin
0x01AA12-Nov-21 5:53
mve0x01AA12-Nov-21 5:53 
GeneralRe: Eureka! I was stewing on a rant I made here and it clicked! Pin
honey the codewitch12-Nov-21 6:06
mvahoney the codewitch12-Nov-21 6:06 
Sorry, it's a result of trying to keep my post brief and compress a lot of information into a little space.

Tokenizing, or lexing text uses state machines to run regular expressions over an input text stream. It marks "lexemes" in text like IntegerLiteral or Keyword or StringLiteral. In the end it tags all text with a symbol id indicating what it is (keyword, int literal, or whatever) - these are returned as a series (stream) of tokens.

These tokens are used by parsers, which use a special kind of state machine that drives a stack as well as an input cursor. The input cursor this time is over tokens instead of text.

Parsers to put it simply, impose a hierarchal structure over those stream of tokens, based on a grammar. This yields a parse tree.

Some parsers (the LL family of parsers) use leftmost derivation and therefore construct the trees from the top down, starting at the root node in the grammar and working toward the leaves by eating input tokens.

Some parsers (the LR family of parsers) use rightmost derivation and therefore construct the trees from the leaves to the root, matching a series of tokens (or previously reduced rules), and then replacing those with the rule that represents them until the root rule is reduced. Recursively you can create a tree with this as well.

LL(1) means LL parsing with 1 token of lookahead. LL(0) parsers are not practical as they can't match anything significant (but LR(0) can).

LL(2) is more difficult because the extra disjunctions causes an exponential growth of your parse tables. Think of it like the difference between the number of guesses you'd have to make to brute force a 1 vs 2 digit pin #. It's like that.

LL(k) means k is arbitrary and usually dictated by whatever the grammar demands.

I think I can achieve LL(k) by using some of the algorithm from my LR parser construction.
Real programmers use butterflies

GeneralRe: Eureka! I was stewing on a rant I made here and it clicked! Pin
0x01AA12-Nov-21 7:00
mve0x01AA12-Nov-21 7:00 
GeneralRe: Eureka! I was stewing on a rant I made here and it clicked! Pin
honey the codewitch12-Nov-21 7:23
mvahoney the codewitch12-Nov-21 7:23 
GeneralRe: Eureka! I was stewing on a rant I made here and it clicked! Pin
Jon McKee12-Nov-21 10:38
professionalJon McKee12-Nov-21 10:38 
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 
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 

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.